Hi,
I am trying to use xarray to open CESM outputs in netCDF format.
Here is the error:
ValueError: unable to decode time units 'common_year since 1-1-1 0:0:0' with "calendar 'noleap'". Try opening your dataset with decode_times=False or installing cftime if it is not installed.
Apparently this is a common issue:
github.com
And I took their advice this way:
ds = xr.open_dataset('some_CESM_output_file.nc', decode_times=False)
ds.time_bound.attrs['calendar'] = ds.time.attrs['calendar']
ds = xr.decode_cf(ds, use_cftime=True)
However, still struggling with:
ValueError: zero not allowed as a reference year, does not exist in Julian or Gregorian calendars
I wonder if there is any trick to resolve this issue.
Thanks in advance for your suggestion,
Ali
I am trying to use xarray to open CESM outputs in netCDF format.
Here is the error:
ValueError: unable to decode time units 'common_year since 1-1-1 0:0:0' with "calendar 'noleap'". Try opening your dataset with decode_times=False or installing cftime if it is not installed.
Apparently this is a common issue:
time decoding error with "days since" · Issue #521 · pydata/xarray
I am trying to use xray with some CESM POP model netCDF output, which supposedly follows CF-1.0 conventions. It is failing because the models time units are "'days since 0000-01-01 00:00:00". When ...
And I took their advice this way:
ds = xr.open_dataset('some_CESM_output_file.nc', decode_times=False)
ds.time_bound.attrs['calendar'] = ds.time.attrs['calendar']
ds = xr.decode_cf(ds, use_cftime=True)
However, still struggling with:
ValueError: zero not allowed as a reference year, does not exist in Julian or Gregorian calendars
I wonder if there is any trick to resolve this issue.
Thanks in advance for your suggestion,
Ali