Skip to content

Expected time slice behavior? #2182

@pochedls

Description

@pochedls

I wanted to see if something I am experiencing is expected behavior. I am using UVCDAT v2.10.

I am trying to load monthly surface temperature data over the same time range (01-1979 through 12-2016). Using the same command I get different length time series, though both have data over this entire record. One ends on 2016-12-1 and the other ends on 2016-11-15 (prematurely - at least compared to the behavior I expected).

I am using this syntax: temp = f('air', time=('1979-01', '2016-12'))

The behavior I expected was that it would load data through the end of the month (they both start in 01-1979). This would make it very convenient for loading different datasets (e.g., various surface temperature datasets) with the same time axes.

If this is the expected behavior, is there an easy way to achieve this (or do I need to write something that carefully compares the time units and subsets the data appropriately)?

Example script loading NOAA GlobalTemp (lines 1 - 8) and GISTEMP data (lines 9 - 15). Notice that the record lengths and end months are different (despite using time=('1979-01', '2016-12') in both).

In [1]: import cdms2 

In [2]: f = cdms2.open('/export_backup2/pochedley1/data/surface/air.mon.anom.nc')

In [3]: temp = f('air', time=('1979-01','2016-12'))

In [4]: temp.shape
Out[4]: (456, 36, 72)  

In [5]: f.close()

In [6]: time=temp.getTime()

In [7]: timeComponent = time.asComponentTime()

In [8]: timeComponent[-1]
Out[8]: 2016-12-1 0:0:0.0

In [9]: f = cdms2.open('/export_backup2/pochedley1/data/surface/gistemp1200_ERSSTv4.nc')

In [10]: temp = f('tempanomaly', time=('1979-01','2016-12'))
/export_backup2/pochedley1/bin/anaconda2/envs/uvcdat2/lib/python2.7/site-packages/cdms2/axis.py:1624: UserWarning:
Your first bounds[0,0] -180.000000000000000 will be corrected to -180.000000000000000
Your bounds bounds[-1,1] 180.000000000000000 will be corrected to 180.000000000000000
  warnings.warn(msg, UserWarning)

In [11]: temp.shape
Out[11]: (455, 90, 180)

In [12]: f.close()

In [13]: time=temp.getTime()

In [14]: timeComponent = time.asComponentTime()

In [15]: timeComponent[-1]
Out[15]: 2016-11-15 0:0:0.0

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions