-
Notifications
You must be signed in to change notification settings - Fork 27
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
Changed azimuth angle range to ]-180, 180] #35
Changed azimuth angle range to ]-180, 180] #35
Conversation
As angles are saved as np.int16, with gain=0.01 and offset=0, all angles will now fit within the datatype.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! Just nitpicking.
LGTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for fixing the angles interval. I have a couple of comments that are more from the nitpicking domain than anything else, but I'll write them here for reference:
- The tests added are only indirectly testing the new code. In the spirit of unit testing, shouldn't a function be created (eg
centered_modulus
) that returns a centered modulus and test that first ? The tests provided here are absolutely relevant though, that's not a problem :) - It should be documented somewhere that the returned angles are going to be in the range ]-180, 180]
Otherwise, it looks good !
The centered_modulus function was suggested by Martin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One last thing... Looks good now otherwise!
pygac/gac_reader.py
Outdated
"""Get azimuth and zenith angles. | ||
|
||
Azimuth angle definition is the same as in pyorbital, but with | ||
different units (degrees not radians for sun azimuth angles) | ||
and different ranges. | ||
|
||
Angle definitions: | ||
azimuth angles: degree clockwise from north in range ]-180, 180] | ||
zenith angles: degree between zenith and sensor or sun in range [0, 90] | ||
absolute azimuth angle difference between sun and sensor: in [0, 180] | ||
|
||
Returns: | ||
azimuth angles for sun and satellite (sun_azi, sat_azi) | ||
zenith angles for sun and satellite (sun_zenith, sat_zenith) | ||
absolute azimuth angle difference (rel_azi) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you format the docstring in google-style? see here for an example: https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html
Updated azimuth angles range to be in ]-180, 180].
Before one angle was in ]-180, 180] and the other in [0, 360]
The range ]-180, 180] was selected as all angles then can be saved
using the current data type, offset and gain.