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 SEVIRI level 2 AMV BUFR #2207

Merged
merged 11 commits into from
Nov 7, 2022
Merged

Conversation

manucarran
Copy link
Contributor

@manucarran manucarran commented Sep 28, 2022

This pull request has been created in order to add the missing SEVIRI level 2 AMV BUFR products to the corresponding satpy reader. The unit test file for the SEVIRI level 2 BUFR products has been updated in order to test the correct behaviour of the reader with AMV BUFR products (because these do not use the area definition).

As far as I see, there is no specific documentation to update for the SEVIRI level 2 BUFR reader.

@@ -104,6 +105,10 @@ def __init__(self, filename, filename_info, filetype_info, with_area_definition=
self.mpef_header['RectificationLongitude'] = f'E{int(rectification_longitude * 10):04d}'

self.with_adef = with_area_definition
if filetype_info['file_type'] == 'seviri_l2_bufr_amv':
logging.info("AMV BUFR data cannot be loaded with an area definition. Setting self.with_def = False.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably check if self.with_adef isn't already False right (ex. if self.with_adef and filetype_info...:)? Otherwise users will always get this no matter what they do.

Also, the .info should maybe be a warning? Or maybe a regular warnings.warn instead of a logging message? What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi David,

Sorry for the late reply. The idea is to make sure that self.with_adef is always set to False for the seviri_l2_bufr_amv products, regardless of whether an area definition is (in this case wrongly) provided or not. But you are probably right in that checking if self.with_adef is already False is probably clearer. I will see to that.

Copy link
Contributor Author

@manucarran manucarran Nov 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As for the logging.info, I agree. I will change it to logging.warning. Thanks for the suggestion.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea is to make sure that self.with_adef is always set to False for the seviri_l2_bufr_amv products

That's fine, but if I'm already following that desired behavior I shouldn't get extra information about how I'm not following the rules.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fully agree. :)

@djhoese djhoese added the enhancement code enhancements, features, improvements label Nov 1, 2022
@codecov
Copy link

codecov bot commented Nov 1, 2022

Codecov Report

Merging #2207 (e6f2d08) into main (a78ff28) will increase coverage by 0.03%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #2207      +/-   ##
==========================================
+ Coverage   94.16%   94.19%   +0.03%     
==========================================
  Files         295      295              
  Lines       45361    45393      +32     
==========================================
+ Hits        42714    42760      +46     
+ Misses       2647     2633      -14     
Flag Coverage Δ
behaviourtests 4.66% <0.00%> (+<0.01%) ⬆️
unittests 94.84% <100.00%> (+0.03%) ⬆️

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

Impacted Files Coverage Δ
satpy/readers/seviri_l2_bufr.py 96.12% <100.00%> (+0.15%) ⬆️
satpy/tests/reader_tests/test_seviri_l2_bufr.py 100.00% <100.00%> (ø)
satpy/readers/viirs_sdr.py 86.94% <0.00%> (-0.20%) ⬇️
satpy/readers/mviri_l1b_fiduceo_nc.py 100.00% <0.00%> (ø)
satpy/readers/seviri_l1b_native_hdr.py 100.00% <0.00%> (ø)
satpy/composites/__init__.py 90.25% <0.00%> (+0.01%) ⬆️
satpy/readers/ascat_l2_soilmoisture_bufr.py 97.40% <0.00%> (+0.06%) ⬆️
satpy/multiscene.py 91.90% <0.00%> (+0.07%) ⬆️
satpy/readers/eps_l1b.py 83.62% <0.00%> (+0.07%) ⬆️
... and 12 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@coveralls
Copy link

coveralls commented Nov 1, 2022

Coverage Status

Coverage increased (+0.002%) to 94.796% when pulling e6f2d08 on manucarran:add_seviri_l2_amv_bufr into a78ff28 on pytroll:main.

Copy link
Member

@mraspaud mraspaud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just one small comment.

AUTHORS.md Outdated
@@ -81,3 +81,4 @@ The following people have made contributions to this project:
- [praerien (praerien)](https://github.com/praerien)
- [Xin Zhang (zxdawn)](https://github.com/zxdawn)
- [Yufei Zhu (yufeizhu600)](https://github.com/yufeizhu600)
- [Manuel Carranza (manucarran)](https://github.com/manucarran)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please put you name in alphabetical order in the list.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the tip. Done.

Copy link
Member

@mraspaud mraspaud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mraspaud mraspaud merged commit 0c2b965 into pytroll:main Nov 7, 2022
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.

5 participants