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

Feature update angles computation #30

Merged

Conversation

ninahakansson
Copy link
Collaborator

@ninahakansson ninahakansson commented Sep 25, 2019

The PR will correct the (rel_azi) absolute azimuth difference angle that is retrieved from gac_reader.
Currently 180 minus rel_azi is retrieved from the reader and it is corrected again back to rel_azi in gac_io before writing.

Moved all computations to gac_reader and simplified.

Note that sun azimuth was before +=180
and satellite azimuth was before -=180.

The rel_azi written to hdf file should be the same as before.
Moved the absolute azimuth angle difference computation to pygac/__init__.py.
Also included unit test of this function.
Copy link
Collaborator

@adybbroe adybbroe left a comment

Choose a reason for hiding this comment

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

Looks fine to me

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.

This looks good to me, I just have some change request concerning the fancy indexing.

Also, regarding coding style, please install flake8 with the plugins flake8-docstrings, flake8-debugger, flake8-bugbear and run something like
git diff origin/master -- "*py" | flake8 --diff
to fix the styling issues.

pygac/__init__.py Outdated Show resolved Hide resolved
pygac/__init__.py Outdated Show resolved Hide resolved
pygac/gac_io.py Outdated Show resolved Hide resolved
pygac/gac_reader.py Outdated Show resolved Hide resolved
pygac/tests/test_angles.py Outdated Show resolved Hide resolved
pygac/tests/test_angles.py Show resolved Hide resolved
pygac/tests/test_angles.py Outdated Show resolved Hide resolved
pygac/tests/test_angles.py Outdated Show resolved Hide resolved
pygac/tests/test_angles.py Outdated Show resolved Hide resolved
@ninahakansson
Copy link
Collaborator Author

Regarding np.where, I am avoiding it because it makes a copy of the array. And the indexing only updates the elements in question.

@mraspaud mraspaud merged commit a5f7efb into pytroll:master Sep 26, 2019
@ninahakansson
Copy link
Collaborator Author

Note that this PR changed the azimuth angles. From documentation (that was updated in PR35).

Pygac was updated to use the same definition for angles as pyorbital (20190926, version 1.1.0). Previous versions used azimuth +/-180 degrees, which correspond to degrees clockwise from south. All angles are converted to degrees.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants