-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Hi devs!
I noticed a small bug in the time units that make them non-cf compliant and therefore unreadable by xarray.
The time units use all underscores as can be seen here:
netcdf hydro_2021-09-01_13_00_00 {
dimensions:
LinkID = 6531 ;
time = 288 ;
variables:
int LinkID(LinkID) ;
LinkID:long_name = "ID associated with each stream link" ;
int time(time) ;
time:long_name = "Time" ;
time:units = "minutes since 2021-09-01_13_00_00" ;
time:calendar = "julian" ;
float outputs(time, LinkID) ;
outputs:long_name = "Discharge" ;
outputs:units = "m^3/s" ;
}
but xarray is unable to decode this properly and it drops the hours. I was able to fix it in xarray with the following line, but I was wondering if it would be easy to fix in the code?
ds['time'] = pd.to_timedelta(ds['time'].values, unit='m') + pd.Timestamp('2021-09-01 13:00:00')
Thanks for your help and for this awesome model!
Lara
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels