-
Notifications
You must be signed in to change notification settings - Fork 17
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
Add DataMet backend for Italian Radar data #175
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #175 +/- ##
==========================================
+ Coverage 91.58% 91.70% +0.12%
==========================================
Files 21 22 +1
Lines 3991 4231 +240
==========================================
+ Hits 3655 3880 +225
- Misses 336 351 +15
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@wolfidan I've taken the chance to fix this up to green CI. Looks good so far. We might just copy/adapt code/tests from the other backends to finish this. Thanks for this nice addition! |
This works for me with different elevations. Looks that this is a top down strategy. import open_radar_data
import xarray as xr
fname = open_radar_data.DATASETS.fetch("H-000-VOL-ILMONTE-201907100700.tar.gz")
with xr.open_dataset(fname, engine="datamet", group="sweep_8") as ds:
display(ds)
ds = ds.set_coords("sweep_mode")
ds = ds.wrl.georef.georeference()
ds.DBTH.wrl.vis.plot() |
Maybe it's that the 90deg sweep is not measured in every volume? |
That's amazing, thanks a lot @kmuehlbauer, I will add more tests the week after the next to increase codecov |
@kmuehlbauer
doesn't work. I had to use
in the unit tests Maybe you can easily fix that. I'm looking forward to see you do this, so I can do it next time. |
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.
Can you try adding back in the engine="datamet" now that the linting issues have been resolved?
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.
Not sure why it doesn't work for you. But you would need to install the package first before being able to use the entrypoints.
Thanks @mgrover1 @kmuehlbauer , I'll change it very soon and see if it passes the tests |
Ok I changed according to your propositions. |
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.
Great work @wolfidan!
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.
Agreed - thanks so much for this contribution @wolfidan !!
* ADD: datamet backend for italian C-band data * ADD: add unit test for datamet backend * ENH: support for .gz files in DataMet reader * [ENH] black style formatting * remove version.py * make DataMetBackend discoverable * fix tests * fix entrypoint * ENH: add tests for datamet xarray backend * FIX: remove version.py * ENH: added more tests for datamet format * ENH: black fix * FIX: fix E721 in type comparison (ruff) * DOC: edited history.md * FIX: changed xradar.io.backends.DataMetBackendEntrypoint to 'datamet' * FIX: black formatting --------- Co-authored-by: Kai Mühlbauer <[email protected]> Co-authored-by: Kai Mühlbauer <[email protected]>
Dear xradar people, this is a first try at adding a new backend to read the data from the Italian radars provided by Gianfranco Vulpiani that we plan to use at the open radar course at ERAD2024.
https://zenodo.org/records/4897697
I must say that I had some trouble understanding all the classes that are required to wrap it into xarray, but I tried my best and it seems to work, as I was able to read all 165 provided files. I have added some tests but they are somewhat simplistic at the moment and only test the basic reader not the wrapper to xarray (other tests seem to do the same things).
The DataMet files are not consistent in which sweep corresponds to which elevation: sometimes sweep 1 could be 16° other times 90°. I find it a bit weird but left it as is and didn't try to remap it. I wonder if this could be an issue when reading them into pyart?
Thank you for your time.
Next week I will be in vacation and might not answer immediately, sorry about that.
history.md