type MFTime
object --+
|
_Variable --+
|
MFTime
MFTime(self, time, units=None)
Class providing an interface to a MFDataset time Variable by imposing
a unique common time unit to all files.
Example usage:
>>> import numpy
>>> f1 = Dataset('mftest_1.nc','w', format='NETCDF4_CLASSIC')
>>> f2 = Dataset('mftest_2.nc','w', format='NETCDF4_CLASSIC')
>>> f1.createDimension('time',None)
>>> f2.createDimension('time',None)
>>> t1 = f1.createVariable('time','i',('time',))
>>> t2 = f2.createVariable('time','i',('time',))
>>> t1.units = 'days since 2000-01-01'
>>> t2.units = 'days since 2000-02-01'
>>> t1.calendar = 'standard'
>>> t2.calendar = 'standard'
>>> t1[:] = numpy.arange(31)
>>> t2[:] = numpy.arange(30)
>>> f1.close()
>>> f2.close()
>>>
>>> f = MFDataset('mftest*nc')
>>> t = f.variables['time']
>>> print t.units
days since 2000-01-01
>>> print t[32]
1
>>> T = MFTime(t)
>>> print T[32]
32
|
__getitem__(...)
Get records from a concatenated set of variables. |
|
|
|
__init__(self,
time,
units=None)
Create a time Variable with units consistent across a multifile
dataset. |
|
|
Inherited from _Variable :
__getattr__ ,
__len__ ,
__str__ ,
ncattrs ,
set_auto_maskandscale ,
typecode
|
__getitem__(...)
(Indexing operator)
|
|
Get records from a concatenated set of variables.
- Overrides:
_Variable.__getitem__
- (inherited documentation)
|
__init__(self,
time,
units=None)
(Constructor)
|
|
Create a time Variable with units consistent across a multifile
dataset.
- Parameters:
time - Time variable from a MFDataset.
units - Time units, for example, 'days since 1979-01-01'. If None, use
the units from the master variable.
- Overrides:
_Variable.__init__
|