Commit 52727c8b authored by Jeff Piollé's avatar Jeff Piollé

re-added two-dimensional time for Grid feature

parent f8260d7e
......@@ -790,35 +790,35 @@ class NCFile(AbstractMapper):
# if time is two-dimensional (ex: L3 with regridded passes)
# then the time coordinate variable can not have multiple
# dimensions. We need two variables.
# if feature == 'Grid':
# # single dimension time variable. We use start sensing
# # time as reference, by convention.
# self._create_field(varname, datatype, ('time',),
# fillvalue, comp, field)
# # and an offset 'dtime' variable, in seconds
# var = Variable(
# 'dtime',
# description='time difference from reference time',
# )
# comment = 'time plus sst_dtime gives pixel time'
# dims = field.dimensions
# if 'time' not in dims:
# dims = collections.OrderedDict([('time', 1)])
# for dim in field.dimensions:
# dims[dim] = field.dimensions[dim]
# units = field.units.split('since')[0].strip()
# dtimefield = Field(
# var,
# dimensions=dims,
# units=units,
# attributes={'comment': comment}
# )
# self._create_field(
# 'dtime', datatype,
# ('time', 'lat', 'lon',),
# self.get_netcdf_fillvalue(datatype),
# dtimefield, dtimefield)
# return
if feature == 'Grid' and len(field.dimensions) > 1:
# single dimension time variable. We use start sensing
# time as reference, by convention.
self._create_field(varname, datatype, ('time',),
fillvalue, comp, field)
# and an offset 'dtime' variable, in seconds
var = Variable(
'dtime',
description='time difference from reference time',
)
comment = 'time plus sst_dtime gives pixel time'
dims = field.dimensions
if 'time' not in dims:
dims = collections.OrderedDict([('time', 1)])
for dim in field.dimensions:
dims[dim] = field.dimensions[dim]
units = field.units.split('since')[0].strip()
dtimefield = Field(
var,
dimensions=dims,
units=units,
attributes={'comment': comment}
)
self._create_field(
'dtime', datatype,
('time', 'lat', 'lon',),
self.get_netcdf_fillvalue(datatype),
dtimefield, dtimefield)
return
# add a dummy time dimension for grids (CF convention) to all
# fields except lat/lon
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment