satpy icon indicating copy to clipboard operation
satpy copied to clipboard

Add utility function to compute the relative azimuth angle.

Open simonrp84 opened this issue 3 years ago • 2 comments

This PR adds a utility function to calculate the relative azimuth angle between sun and sensor. This code already existed in the PSPRayleighReflectance class, but here I move it to be a function in modifiers.angles.py so that users can access it more easily (as they can with the get_angles function).

Also, I have moved a lot of the angles tests from satpy/tests/test_modifiers.py into satpy/tests/modifier_tests/test_angles.py.

  • [x] Tests added
  • [x] Fully documented

simonrp84 avatar Aug 14 '22 11:08 simonrp84

Codecov Report

Merging #2175 (377283d) into main (fcbc517) will increase coverage by 0.00%. The diff coverage is 81.25%.

@@           Coverage Diff           @@
##             main    #2175   +/-   ##
=======================================
  Coverage   94.25%   94.25%           
=======================================
  Files         300      300           
  Lines       45638    45649   +11     
=======================================
+ Hits        43014    43026   +12     
+ Misses       2624     2623    -1     
Flag Coverage Δ
behaviourtests 4.66% <12.50%> (+<0.01%) :arrow_up:
unittests 94.89% <81.25%> (+<0.01%) :arrow_up:

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

Impacted Files Coverage Δ
satpy/modifiers/atmosphere.py 46.26% <25.00%> (+0.68%) :arrow_up:
satpy/modifiers/angles.py 99.16% <100.00%> (+0.01%) :arrow_up:
satpy/tests/modifier_tests/test_angles.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov[bot] avatar Aug 14 '22 11:08 codecov[bot]

Coverage Status

Coverage increased (+0.003%) to 94.847% when pulling 377283d69b18c57d7326cdcf4d8411c4b5186e7b on simonrp84:raa_calc into fcbc517578c7b8a3e206ec9b48d2f1cb4239ff87 on pytroll:main.

coveralls avatar Aug 14 '22 11:08 coveralls

Can I be of any help to make this merged @simonrp84? Would you be in favor of adding utility functions to compute also the phase angle and a sun glint angle or flag ?

ghiggi avatar Nov 03 '22 14:11 ghiggi

Thanks for the offer @ghiggi, I hope to get this PR ready today - phase_angle and sun_glint_angle would also be really useful, perhaps you could make a separate PR for that once this one is merged? Happy to help code / review it!

simonrp84 avatar Nov 09 '22 09:11 simonrp84