The issue was that the xarray after the apply_ufunc step did not have the time dimension/coordinates set up properly. When the output xarray time dimension was of the same shape, the mapping was correctly done automatically, but otherwise not, so I simply set the new coordinates to the output_dates, whichever they may be. Additionally I simplified the function a bit.
The issue was that the
xarray
after theapply_ufunc
step did not have the time dimension/coordinates set up properly. When the outputxarray
time dimension was of the same shape, the mapping was correctly done automatically, but otherwise not, so I simply set the new coordinates to the output_dates, whichever they may be. Additionally I simplified the function a bit.I tested it and it now seems to work correctly.
Closes #85