When concatenating various CMIP6 models, I'm running into a datettime mismatch issue:
_ds = list(ds_regrid_dict.values())
_coord = list(ds_regrid_dict.keys())
ds_out_regrid = xr.concat(objs=_ds, dim=_coord, coords="all").rename({'concat_dim':'model'})
ds_out_regrid
TypeError: cannot compare cftime.DatetimeProlepticGregorian(1985, 1, 16, 12, 0, 0, 0, has_year_zero=True) and cftime.DatetimeNoLeap(1985, 1, 16, 12, 0, 0, 0, has_year_zero=True)
I'm adapting this example from online:
https://nordicesmhub.github.io/forces-2021/learning/example-notebooks/xesmf_regridding.html
Anyone know a smart way to get around this?
You might look into xarray's interp_calendar
or convert_calendar
to help align the calendars / time coords.
Katelyn FitzGerald said:
You might look into xarray's
interp_calendar
orconvert_calendar
to help align the calendars / time coords.
Thanks, I'll look into those.
Last updated: May 16 2025 at 17:14 UTC