-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ocgis2.0 MFTime requires that the time variable in all files have a calendar attribute #178
Comments
i've run the test script with latest from next branch and a fresh install:
Looks like it produced something:
|
ocgis is currently set back to ocgis-next v1.4 in flyingpigeon |
@cehbrecht Are you okay pulling from @nilshempelmann This is an |
Running fine with last ocgis-next version. |
Thanks, @nilshempelmann. This sounds similar to NCPP/ocgis#435. The issue results from inconsistent calendar-units on the time bounds variables. Older Is it easy for you to try and ignore the bounds with these datasets? I think a better solution is needed, but this is the first step. import ocgis
rd = ocgis.RequestDataset(paths)
rd.dimension_map.set_bounds(ocgis.constants.DimensionMapKey.TIME, None)
ops = ocgis.OcgOperations(dataset=rd, ...) |
OK I ll give it a try |
Fixed in next branch with: import ocgis
rd = ocgis.RequestDataset(paths)
rd.dimension_map.set_bounds(ocgis.constants.DimensionMapKey.TIME, None)
ops = ocgis.OcgOperations(dataset=rd, ...) |
@bekozi
@koldunovn
@cehbrecht
Here is a test snippet:
https://github.com/bird-house/flyingpigeon/blob/next/scripts/ocgis_indices_simple.py
running with a single file but not with mulitple ones.
$ python ocgis_indices_simple.py
/home/nils/.conda/envs/flyingpigeon/lib/python2.7/site-packages/ocgis-2.0.0-py2.7.egg/ocgis/driver/nc.py:129: UserWarning: endian-ness of dtype and endian kwarg do not match, using endian kwarg
ncvar = dataset.createVariable(var.name, dtype, dimensions=dimensions, fill_value=fill_value, **kwargs)
/home/nils/birdhouse/flyingpigeon/scripts/single_file/single_file.nc
Traceback (most recent call last):
File "ocgis_indices_simple.py", line 26, in
output_format='nc').execute()
File "/home/nils/.conda/envs/flyingpigeon/lib/python2.7/site-packages/ocgis-2.0.0-py2.7.egg/ocgis/ops/core.py", line 312, in execute
return interp.execute()
File "/home/nils/.conda/envs/flyingpigeon/lib/python2.7/site-packages/ocgis-2.0.0-py2.7.egg/ocgis/ops/interpreter.py", line 135, in execute
ret = conv.write()
File "/home/nils/.conda/envs/flyingpigeon/lib/python2.7/site-packages/ocgis-2.0.0-py2.7.egg/ocgis/conv/base.py", line 170, in write
for coll in self:
File "/home/nils/.conda/envs/flyingpigeon/lib/python2.7/site-packages/ocgis-2.0.0-py2.7.egg/ocgis/conv/base.py", line 120, in iter
for coll in self.colls:
File "/home/nils/.conda/envs/flyingpigeon/lib/python2.7/site-packages/ocgis-2.0.0-py2.7.egg/ocgis/ops/engine.py", line 58, in iter
for coll in self.iter_collections():
File "/home/nils/.conda/envs/flyingpigeon/lib/python2.7/site-packages/ocgis-2.0.0-py2.7.egg/ocgis/ops/engine.py", line 137, in iter_collections
coll = self.cengine.execute(coll, file_only=self.ops.file_only, tgds=tgds)
File "/home/nils/.conda/envs/flyingpigeon/lib/python2.7/site-packages/ocgis-2.0.0-py2.7.egg/ocgis/calc/engine.py", line 73, in execute
tgds_to_use[field.name] = field.time.get_grouping(self.grouping)
File "/home/nils/.conda/envs/flyingpigeon/lib/python2.7/site-packages/ocgis-2.0.0-py2.7.egg/ocgis/variable/temporal.py", line 249, in get_grouping
new_bounds, date_parts, repr_dt, dgroups = self.get_grouping_other(grouping)
File "/home/nils/.conda/envs/flyingpigeon/lib/python2.7/site-packages/ocgis-2.0.0-py2.7.egg/ocgis/variable/temporal.py", line 478, in get_grouping_other
value_datetime_bounds = self.bounds.value_datetime
File "/home/nils/.conda/envs/flyingpigeon/lib/python2.7/site-packages/ocgis-2.0.0-py2.7.egg/ocgis/variable/temporal.py", line 120, in value_datetime
if get_datetime_conversion_state(self.get_value().flatten()[0]):
File "/home/nils/.conda/envs/flyingpigeon/lib/python2.7/site-packages/ocgis-2.0.0-py2.7.egg/ocgis/variable/base.py", line 1224, in get_value
self._value = self.get_value()
File "/home/nils/.conda/envs/flyingpigeon/lib/python2.7/site-packages/ocgis-2.0.0-py2.7.egg/ocgis/variable/base.py", line 1459, in get_value
self._request_dataset.driver.init_variable_value(self)
File "/home/nils/.conda/envs/flyingpigeon/lib/python2.7/site-packages/ocgis-2.0.0-py2.7.egg/ocgis/driver/base.py", line 428, in init_variable_value
value = self.get_variable_value(variable)
File "/home/nils/.conda/envs/flyingpigeon/lib/python2.7/site-packages/ocgis-2.0.0-py2.7.egg/ocgis/driver/nc.py", line 50, in get_variable_value
return get_value_from_request_dataset(variable)
File "/home/nils/.conda/envs/flyingpigeon/lib/python2.7/site-packages/ocgis-2.0.0-py2.7.egg/ocgis/driver/nc.py", line 490, in get_value_from_request_dataset
ncvar = MFTime(ncvar)
File "netCDF4/_netCDF4.pyx", line 6104, in netCDF4._netCDF4.MFTime.init (netCDF4/_netCDF4.c:78273)
ValueError: MFTime requires that the time variable in all files have a calendar attribute
The text was updated successfully, but these errors were encountered: