Closed ameraner closed 3 weeks ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 95.95%. Comparing base (
3b9c04e
) to head (d29268c
). Report is 1 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Totals | |
---|---|
Change from base Build 9157044280: | 0.002% |
Covered Lines: | 51600 |
Relevant Lines: | 53731 |
This PR fixes a bug in the
li_l2_nc
reader when requesting accumulated products as 1-d arrays (by usingreader_kwargs={'with_area_definition': False}
). Note that it is anyway recommended to request accumulated products as 2-d arrays usingreader_kwargs={'with_area_definition': True}
(as discussed in https://github.com/pytroll/satpy/pull/2789).The bug was due to a missing
*= -1
on the azimuth geos angle coordinate (used inside the 1-d coordinates calculation), needed to account for a convention difference between MTG data and Proj. Without this fix, the coordinates (particularly the longitude) are computed with fully wrong values.This PR fixes this issue and adds a test to check the consistency between the 1-d computed coordinates and the according coordinates extracted from the 2-d arrays with
AreaDefinition
. Before this fix this test would have failed. It also updates the test filecontents for more realistic tests.Checking the reader on a real-life case, comparing the resampled 1-d arrays and the 2-d arrays:
Before this PR, the lightning data is at fully wrong locations (left: resampled 1-d arrays, right: 2-d):![image](https://github.com/pytroll/satpy/assets/49722768/70724a60-04e1-4e69-84e8-a551a0318d49)
After this PR, the results are comparable (left: resampled 1-d arrays, right: 2-d)::![image](https://github.com/pytroll/satpy/assets/49722768/f4c31782-e9af-42df-a4cd-d3039ce13327)
According code: