Skip to content

Fix VII (METimage) reader angles names#3317

Open
ameraner wants to merge 3 commits intopytroll:mainfrom
ameraner:fix-vii-angles
Open

Fix VII (METimage) reader angles names#3317
ameraner wants to merge 3 commits intopytroll:mainfrom
ameraner:fix-vii-angles

Conversation

@ameraner
Copy link
Member

@ameraner ameraner commented Dec 16, 2025

This PR fixes the names of satellite and solar angles in the yaml file of the VII/METimage reader, so that they adhere to the convention and are correctly used in predefined modifiers, such as the sunz_corrected defined in generic.yaml. As discussed in https://pytroll.slack.com/archives/C0LNH7LMB/p1765897278746739 .

Before this PR, the sunz_correction was not using the in-file angles as they could not be found due to the different name, causing issues when correcting Scenes with granules that were far apart in time; see the bright overcorrection over Europe, solved by this PR:
before
image
after
image

@ameraner ameraner self-assigned this Dec 16, 2025
@ameraner ameraner requested a review from djhoese as a code owner December 16, 2025 18:06
@ameraner ameraner added the bug label Dec 16, 2025
@ameraner ameraner requested a review from mraspaud as a code owner December 16, 2025 18:06
@ameraner ameraner requested review from pnuu December 16, 2025 18:12
@codecov
Copy link

codecov bot commented Dec 16, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.33%. Comparing base (2554db5) to head (c83da7b).
⚠️ Report is 18 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3317      +/-   ##
==========================================
- Coverage   96.34%   96.33%   -0.02%     
==========================================
  Files         463      463              
  Lines       58916    58916              
==========================================
- Hits        56760    56754       -6     
- Misses       2156     2162       +6     
Flag Coverage Δ
behaviourtests 3.59% <ø> (-0.01%) ⬇️
unittests 96.42% <ø> (-0.02%) ⬇️

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@pnuu pnuu left a comment

Choose a reason for hiding this comment

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

LGTM

Just wondering whether "observation" and "satellite" zenith angles are the same thing? It could be argued that observation zenith angle is the angle in which the satellite makes the measurement, while satellite zenith angle is the angle the satellite is seen from the observed location.

@ameraner
Copy link
Member Author

Yeah, I think "sensor", "viewing", "observation" and "satellite" _zenith are used interchangeably in the community - even in satpy each one of these is used. I went for "satellite" since that's what the default modifiers use, e.g.

rayleigh_corrected:
modifier: !!python/name:satpy.modifiers.PSPRayleighReflectance
atmosphere: us-standard
aerosol_type: rayleigh_only
prerequisites:
- wavelength: 0.67
modifiers: [sunz_corrected]
optional_prerequisites:
- satellite_azimuth_angle
- satellite_zenith_angle
- solar_azimuth_angle
- solar_zenith_angle

I checked and at the center of the swath the value is 0 (not 90), so that's as expected I'd say.

@ameraner
Copy link
Member Author

To confirm even more that the file variable indeed contains the commonly used viewing/satellite angle (the angle under which the satellite is seen from the ground): the METimage scanner goes up to +- 54.21°, while the "observation angle" data in the file goes up to e.g. 66.8° in my test granule. So I think we're good :)

@pnuu
Copy link
Member

pnuu commented Dec 17, 2025

Thanks for confirming!

CI build for Windows is failing on unrelated E rasterio._err.CPLE_AppDefinedError: Cannot open TIFF image error. I'll try restarting the tests, even if this isn't the typical Zenodo or Conda hickup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants