Skip to content
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 a reader for NWC SAF GEO HRW data #3070

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

pnuu
Copy link
Member

@pnuu pnuu commented Feb 21, 2025

This PR adds a reader for the High Resolution Winds data from NWC SAF GEO.

The data structure is very complex, and due to the unsupported compound data type can't be opened with xr.open_dataset(). Because there are 259 datasets, I've made the dataset definitions dynamic instead of putting them into the reader YAML. The code is in a separate file because the internal structure is completely different to the other NWC SAF GEO products (see the linked issue).

By default the file handler reads the datasets separately for each imaging channel. That is, the datasets are named wind_vis06_air_pressure, wind_hrvis_wind_speed, and so on. The prefix is the name of the channel within the files.

The user can also supply reader_kwargs={"merge_channels": True} to collect all the data together. In this case the datasets are named without the prefix, such as air_pressure, wind_speed, etc.

@pnuu pnuu added enhancement code enhancements, features, improvements component:readers labels Feb 21, 2025
@pnuu pnuu self-assigned this Feb 21, 2025
Copy link

codecov bot commented Feb 21, 2025

Codecov Report

Attention: Patch coverage is 97.73756% with 5 lines in your changes missing coverage. Please review.

Project coverage is 96.13%. Comparing base (869e4fe) to head (b2c4dc9).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
satpy/readers/nwcsaf_hrw_nc.py 96.00% 5 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             main    #3070    +/-   ##
========================================
  Coverage   96.13%   96.13%            
========================================
  Files         383      385     +2     
  Lines       55688    55909   +221     
========================================
+ Hits        53534    53750   +216     
- Misses       2154     2159     +5     
Flag Coverage Δ
behaviourtests 3.87% <0.00%> (-0.02%) ⬇️
unittests 96.23% <97.73%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pnuu
Copy link
Member Author

pnuu commented Feb 24, 2025

I reduced the number of data rows that were written to the test data. With the original 1234 data points it took 19 seconds to run the tests on my laptop. Increasing to 12345 the tests took 170 seconds and with the current 123 only 2 seconds.

@pnuu
Copy link
Member Author

pnuu commented Feb 24, 2025

I'll have a look at adding a kwarg to merge the different channel observations, so the user could do something like

scn = Scene(reader="nwcsaf-geo", filenames=filenames, reader_kwargs={"merge_channels": True})
scn.load(["wind_speed", "wind_from_direction"])

instead of loading each of the channels (wind_vis06_wind_speed, wind_vis08_wind_speed, etc.) separately.

@pnuu
Copy link
Member Author

pnuu commented Feb 24, 2025

Also some documentation added.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 13564327912

Details

  • 218 of 223 (97.76%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.006%) to 96.243%

Changes Missing Coverage Covered Lines Changed/Added Lines %
satpy/readers/nwcsaf_hrw_nc.py 121 126 96.03%
Totals Coverage Status
Change from base Build 13543289700: 0.006%
Covered Lines: 53999
Relevant Lines: 56107

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:readers enhancement code enhancements, features, improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reader for NWC SAF HRW (high resolution winds) data
3 participants