Closed JGuetschow closed 1 week ago
Thanks for the report!
Will this be fixed by #9691, or is this a separate issue?
From looking at the tests added in #9691 , I think it will (one test is basically my failing example). I only looked at the open issues and could not find a fitting one. Great that it's already fixed.
Well, now we have one!
I'll close this as fixed by #9691, then.
What happened?
When using
xr.polyfit
on aDataArray
with time coordinate (datetime64
) the coefficients don't match the data but the data shifted such thatt_min = 0
. So the coefficients obtained can not be used in xr.polyval directly. This shift happens in_floatize_x
(https://github.com/pydata/xarray/blob/91962d6aec380cb83fe80b2afdfa556efdd817a3/xarray/core/missing.py#L585). With xarray 2024.10.0 the problem does not exist.What did you expect to happen?
I expected the coefficient of the polynomial to be consistent with the data such that they can be used in
xr.polyval
directly.Minimal Complete Verifiable Example
MVCE confirmation
Relevant log output
Anything else we need to know?
My original issue in the primap2 package is here: https://github.com/primap-community/primap2/issues/293 But that's just fyi, I think I have included all necessary information here.
Environment