I have a netcdf file that someone passed me that uses "years since DATE":
double time(time) ;
time:standard_name = "time" ;
time:long_name = "time" ;
time:calendar = "proleptic_gregorian" ;
time:axis = "T" ;
time:units = "years since 2000-1-1 00:00:00" ;
When I attempt to open this with xarray I get the error:
ValueError: unable to decode time units 'years since 2000-1-1 00:00:00' with calendar 'proleptic_gregorian'. Try opening your dataset with decode_times=False.
I can open when decode_times=False but then I can't slice the times. I found that changing the units to "days since" solved the error, but of course messes up the time axis (I simply overwrote the units with
ncatted -O -a units,time,m,c,"days since 2000-1-1 00:00:00" ./test.nc
as a test, but didn't update the actual time variable values)
Is there a trick to open netcdf data files with units "years since" in xarray?