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
Correct the sun azimuth angle range within satpy. #2166
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2166 +/- ##
=======================================
Coverage 94.19% 94.20%
=======================================
Files 295 296 +1
Lines 45393 45410 +17
=======================================
+ Hits 42760 42777 +17
Misses 2633 2633
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
@adybbroe or @mraspaud any memory of why the azimuth angle is in a different range in pyorbital? @simonrp84 I'm tempted to request that the rayleigh correction be updated to only do the Also, tests please. |
I've added some tests to this now. What I did was rearrange the tests as was done in #2175, I moved a bunch of tests from |
At present, the azimuth angles returned for sun and satellite are on different ranges.
satpy.modifiers.angles._get_sun_azimuth_ndarray
returns values in the range-180. -> 180.
degrees.satpy.modifiers.angles._get_sensor_angles_ndarray
returns values in the range0. -> 360.
degrees.For things like Rayleigh correction this is not a problem as the angles are normalised on lines 56 and 57 of
atmosphere.py
. However, it would be better to make this normalisation directly on the solar angles before they're passed to any other functions.My reasoning for this is:
This PR applies a very simple fix (taken from
atmosphere.py
) to correct the solar azimuth range. Both azimuths will now be in the0 -> 360
range as expected.