pytroll / satpy

Python package for earth-observing satellite data processing
http://satpy.readthedocs.org/en/latest/
GNU General Public License v3.0
1.08k stars 298 forks source link

Bugfix for Sentinel-2 radiance calculation #2896

Closed simonrp84 closed 2 months ago

simonrp84 commented 2 months ago

This PR fixes the radiance calculation for Sentinel-2 data. Currently, the code uses the method suitable for L1b counts -> radiance computation. However, L1b data is not (yet) available to users and the procedure is different for L1c data that's available via the Copernicus data ecosystem.

This PR switches to use the correct calculation.

In addition, I made some changes to the reader code in preparation for the upcoming availability of L1B data for Sentinel-2. This data isn't yet supported by the reader, though, so I have added an explicit error message / reader failure mode if the user tries to process L1B data.

codecov[bot] commented 2 months ago

Codecov Report

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

Project coverage is 96.07%. Comparing base (5e27be4) to head (fb1521a). Report is 150 commits behind head on main.

Files with missing lines Patch % Lines
satpy/readers/msi_safe.py 97.14% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #2896 +/- ## ========================================== + Coverage 96.05% 96.07% +0.01% ========================================== Files 370 373 +3 Lines 54320 54462 +142 ========================================== + Hits 52177 52323 +146 + Misses 2143 2139 -4 ``` | [Flag](https://app.codecov.io/gh/pytroll/satpy/pull/2896/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pytroll) | Coverage Δ | | |---|---|---| | [behaviourtests](https://app.codecov.io/gh/pytroll/satpy/pull/2896/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pytroll) | `3.98% <0.00%> (-0.02%)` | :arrow_down: | | [unittests](https://app.codecov.io/gh/pytroll/satpy/pull/2896/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pytroll) | `96.16% <98.57%> (+0.01%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pytroll#carryforward-flags-in-the-pull-request-comment) to find out more.

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

coveralls commented 2 months ago

Pull Request Test Coverage Report for Build 11141493051

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


Changes Missing Coverage Covered Lines Changed/Added Lines %
satpy/readers/msi_safe.py 35 36 97.22%
<!-- Total: 70 71 98.59% -->
Files with Coverage Reduction New Missed Lines %
satpy/tests/reader_tests/test_hrit_base.py 3 97.67%
satpy/readers/seadas_l2.py 3 96.97%
satpy/tests/reader_tests/modis_tests/_modis_fixtures.py 5 98.38%
satpy/readers/aapp_l1b.py 8 89.89%
satpy/readers/hdfeos_base.py 14 92.78%
satpy/readers/hrit_base.py 24 85.16%
<!-- Total: 57 -->
Totals Coverage Status
Change from base Build 10704576446: 0.002%
Covered Lines: 52557
Relevant Lines: 54651

💛 - Coveralls
simonrp84 commented 2 months ago

@mraspaud I've added a new commit that should address your suggestions / comments above.