satpy icon indicating copy to clipboard operation
satpy copied to clipboard

Add ability to clip AMI negative radiances

Open simonrp84 opened this issue 1 year ago • 2 comments

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

simonrp84 avatar May 28 '24 16:05 simonrp84

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 :warning:
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%) :arrow_down:
unittests 96.06% <98.92%> (-0.01%) :arrow_down:

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

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar May 28 '24 17:05 codecov[bot]

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%
<!-- Total: 92 93
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%
<!-- Total: 111
Totals Coverage Status
Change from base Build 9842330086: -0.001%
Covered Lines: 51826
Relevant Lines: 53947

💛 - Coveralls

coveralls avatar May 28 '24 17:05 coveralls

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?

djhoese avatar Jul 18 '24 16:07 djhoese

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.

simonrp84 avatar Jul 19 '24 15:07 simonrp84

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

djhoese avatar Jul 19 '24 18:07 djhoese