-
Notifications
You must be signed in to change notification settings - Fork 8
wrong time values in results from compute_mon_anomaly and compute_mon_climatology #96
Comments
FYI, the incorrect time values seem to have been introduced with #75. When I run the above code with 6e89f2a, right before #75, the reported time values are somewhat reasonable.
|
@klindsay28, I am looking at this now. I understand what's going on: we are retaining the original time coordinate in "undecoded form" (i.e. float) and doing computations on it. I think this is appropriate for operations like I am thinking about how best to address the issue. |
Are you saying that xarray operations on datasets are being applied to coordinate variables? If so, that sounds undesirable. Actually, it sounds so undesirable that I think I must be misunderstanding what you are saying. However, if I am right, is there a way to tell xarray not to do that. |
@klindsay28 I have a partial fix for this issue on my fork: https://github.com/matt-long/esmlab Further work is required to clean things up and address #93. I addressed the first failure point there, but there's another error related to time_bound being decoded. |
Thanks. I'm able to use your fork with just a couple of workarounds in my scripts. |
@klindsay28, feel free to close this in case #98 fixes this issue |
The time values returned by compute_mon_anomaly and compute_mon_climatology are wrong.
The python code in the following file, which has a .txt suffix to enable me to attach it, exhibits the problem:
esmlab_compute_mon.py.txt
It uses the function
dset
from tests/conftest.py to create an example dataset, and then prints time from dset, and the datasets returned by compute_mon_anomaly and compute_mon_climatology.print(ds.time)
returns:print(compute_mon_anomaly(ds).time)
returns:I expect this to report the same values as
print(ds.time)
, and it does not.print(compute_mon_climatology(ds).time)
returns:I expect this to report values corresponding to mid-Jan, mid-Feb, ..., and it does not.
I expect this to have the same calendar attribute that ds has, and it does not.
I am using the trunk of esmlab. conda list returns the following for xarray, numpy, and esmlab:
The text was updated successfully, but these errors were encountered: