Skip to content
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

Merged
merged 7 commits into from
Oct 17, 2019

Conversation

ninahakansson
Copy link
Collaborator

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.

As angles are saved as np.int16, with gain=0.01 and offset=0,
all angles will now fit within the datatype.
Copy link
Member

@sfinkens sfinkens left a 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.

pygac/tests/test_reader.py Show resolved Hide resolved
pygac/tests/test_reader.py Outdated Show resolved Hide resolved
pygac/tests/test_reader.py Show resolved Hide resolved
pygac/tests/test_reader.py Outdated Show resolved Hide resolved
@sfinkens
Copy link
Member

LGTM

Copy link
Member

@mraspaud mraspaud left a 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 !

Copy link
Member

@mraspaud mraspaud left a 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!

Comment on lines 456 to 471
"""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)

Copy link
Member

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

@mraspaud mraspaud merged commit b834739 into pytroll:master Oct 17, 2019
@sfinkens sfinkens mentioned this pull request Jul 17, 2020
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.

3 participants