Home | Trees | Indices | Help |
---|
|
object --+ | _Variable --+ | MFTime
Class providing an interface to a MFDataset time Variable by imposing a unique common time unit to all files. Example usage (See `netCDF4.MFTime.__init__` for more details): :::python >>> 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() >>> # Read the two files in at once, in one Dataset. >>> f = MFDataset("mftest*nc") >>> t = f.variables["time"] >>> print t.units days since 2000-01-01 >>> print t[32] # The value written in the file, inconsistent with the MF time units. 1 >>> T = MFTime(t) >>> print T[32] 32
|
|||
|
|||
|
|||
Inherited from Inherited from |
|
|||
__qualname__ =
|
|
|||
Inherited from |
|
Get records from a concatenated set of variables.
|
**`__init__(self, time, units=None)`** Create a time Variable with units consistent across a multifile dataset. **`time`**: Time variable from a `netCDF4.MFDataset`. **`units`**: Time units, for example, `days since 1979-01-01`. If None, use the units from the master variable.
|
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Sun Apr 3 06:23:31 2016 | http://epydoc.sourceforge.net |