-
Notifications
You must be signed in to change notification settings - Fork 303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove the time_bnds #1246
Remove the time_bnds #1246
Conversation
Thanks for looking into this! I tried it out with the following example, but it doesn't work yet: In [1]: from glob import glob
In [2]: from satpy import MultiScene
In [3]: from satpy.multiscene import timeseries
In [4]: filenames = glob('/data/georing/ahi_hsd/*', recursive=True)
In [5]: mscn = MultiScene.from_files(filenames, reader="ahi_hsd")
In [6]: mscn.load(['B13'])
In [7]: blended_scene = mscn.blend(blend_function=timeseries)
In [8]: blended_scene.save_datasets(writer='cf', filename='test.nc')
Traceback:
...
ValueError: different number of dimensions on data and dims: 3 vs 2 I think this is because the start/end times passed to
If this turns out to be too much work, a quick fix could be to not add time bounds if the time dimension is larger than 1. |
👉 View analysis in DeepCode’s Dashboard | Configure the bot |
The satpy/satpy/writers/cf_writer.py Line 467 in d7fbbdf
I delete it instead of figuring how to make it work for many situations ... |
@zxdawn I'm not sure I understand this PR fully: Passing the time bounds to the encoding is according to the comment not necessary after xarray 0.14. However that line is not removed. Moreover, that is removed is the creation and insertion of the time bounds variable, and I don't understand why that is? |
@mraspaud Sorry, I forgot to delete the line of passing the time bounds to the encoding. Updated now. |
No problem. Did the tests not need updating? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, the only thing left I think is change the minimum version of xarray in setup.py
yeah, you need to fix the tests, making sure xarray is doing its job too. |
Updated the |
Codecov Report
@@ Coverage Diff @@
## master #1246 +/- ##
==========================================
- Coverage 92.62% 92.61% -0.02%
==========================================
Files 258 258
Lines 37847 37777 -70
==========================================
- Hits 35057 34987 -70
Misses 2790 2790
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@mraspaud @zxdawn I think there was a misunderstanding in the conversation here and on slack some time ago. xarray does not automatically add time bounds when you save a dataset to netcdf. Although not required by the CF conventions, they provide very valuable information and in my opinion we should keep them. That comment in If I remember correctly, the issue here is that |
@zxdawn you had another reason for removing this, right? |
Yes, absolutely! I'll just go ahead and close this, feel free to start another PR. |
Currently, thestart_time
is the minimumstart_times
whileend_time
is the maximumend_times
.It's better to support the datatime array which is useful for time_series blending inMultiScene
.Delete the useless
time_bnds
for new version of xarray.satpy/satpy/writers/cf_writer.py
Line 467 in d7fbbdf
flake8 satpy