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 ability to clip AMI negative radiances #2806

Merged
merged 12 commits into from
Jul 20, 2024

Conversation

simonrp84
Copy link
Member

@simonrp84 simonrp84 commented May 28, 2024

This PR adds the ability to clip negative radiances from AMI datasets. It uses the same method already in place for GOES/ABI and, like ABI, this clipping is disabled by default.

  • Tests added
  • Fully documented

Copy link

codecov bot commented May 28, 2024

Codecov Report

Attention: Patch coverage is 98.92473% with 1 line in your changes missing coverage. Please review.

Project coverage is 95.96%. Comparing base (440925d) to head (7d13544).
Report is 501 commits behind head on main.

Files with missing lines Patch % Lines
satpy/readers/ami_l1b.py 93.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2806      +/-   ##
==========================================
- Coverage   95.96%   95.96%   -0.01%     
==========================================
  Files         366      366              
  Lines       53593    53764     +171     
==========================================
+ Hits        51433    51597     +164     
- Misses       2160     2167       +7     
Flag Coverage Δ
behaviourtests 4.03% <0.00%> (-0.01%) ⬇️
unittests 96.06% <98.92%> (-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.

@coveralls
Copy link

coveralls commented May 28, 2024

Pull Request Test Coverage Report for Build 10012906724

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 92 of 93 (98.92%) changed or added relevant lines in 2 files are covered.
  • 111 unchanged lines in 6 files lost coverage.
  • Overall coverage decreased (-0.001%) to 96.068%

Changes Missing Coverage Covered Lines Changed/Added Lines %
satpy/readers/ami_l1b.py 14 15 93.33%
Files with Coverage Reduction New Missed Lines %
satpy/tests/utils.py 2 93.16%
satpy/readers/hrit_jma.py 2 98.64%
satpy/tests/reader_tests/gms/test_gms5_vissr_l1b.py 3 98.67%
satpy/tests/reader_tests/gms/test_gms5_vissr_navigation.py 3 97.18%
satpy/resample.py 49 88.74%
satpy/writers/awips_tiled.py 52 83.97%
Totals Coverage Status
Change from base Build 9842330086: -0.001%
Covered Lines: 51826
Relevant Lines: 53947

💛 - Coveralls

@djhoese djhoese added enhancement code enhancements, features, improvements component:readers labels May 28, 2024
Copy link
Member

@djhoese djhoese left a comment

Choose a reason for hiding this comment

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

Thanks for tackling this. I just have some concerns about how information is stored/kept/used.

satpy/readers/ami_l1b.py Outdated Show resolved Hide resolved
satpy/tests/reader_tests/test_ami_l1b.py Outdated Show resolved Hide resolved
@djhoese
Copy link
Member

djhoese commented Jul 18, 2024

Ok @simonrp84 I've refactored the tests and hopefully they are easier to follow now BUT while doing this I noticed that the IR clipping tests actually use the fake visible data including the visible metadata. Any issue with me changing this to use the fake IR data?

@simonrp84
Copy link
Member Author

OK, thanks for your help on this Dave - really appreciate it. I tested your changes and they work nicely for me so I'm happy that it can be merged.

In the process of testing, though, I discovered that the AMI reader is broken with numpy>=2. I have added an additional commit that fixes this bug and enables the reader to work again.

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!

satpy/readers/ami_l1b.py Outdated Show resolved Hide resolved
satpy/readers/ami_l1b.py Outdated Show resolved Hide resolved
@djhoese
Copy link
Member

djhoese commented Jul 19, 2024

I did a little more cleanup, but now I'll merge this when CI passes.

@djhoese djhoese merged commit c924120 into pytroll:main Jul 20, 2024
17 of 18 checks passed
@simonrp84 simonrp84 deleted the clip_ami_radiance branch July 20, 2024 07:39
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.

4 participants