-
Notifications
You must be signed in to change notification settings - Fork 32
Update glows_l1b_data.py, degrees=False correction #2944
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
Open
mstrumik
wants to merge
3
commits into
IMAP-Science-Operations-Center:dev
Choose a base branch
from
mstrumik:patch-1
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+118
−3
Open
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Good catch! Based on the definition of
spin_axis_orientation_average, I believe that the mean and standard deviation values need to be converted to degrees before setting the values on lines 950-951.It would probably be beneficial to add a specific test that covers this bug. The SDC can help with that if needed.
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 Tim. You are probably right regarding conversion to degrees. I am not able to find any conversion in the code. So either the conversion you suggested is implemented or alternatively geometry.cartesian_to_latitudinal() may have degrees=True but bounds in circmean/circstd will be low=-180, high=180. Am I supposed to propose the changes (next pull request) or it will be handled internally by SDC?
Regarding the testing, I was comparing variable values in CDFs produced by SDC with JSON files generated by GLOWS team and found some discrepancies that led me to this pull request. So there is some testing on the GLOWS-team side related to this bug. Were you thinking about this type of testing or rather unit tests in the SDC code?
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.
Based on the Scipy documentation for circmean and circstd, it looks like those functions require the inputs be in radians. So, my suggestion is just to convert the values that get stored to degrees. For example, keep your changes and then modify lines below to:
Typically, when you get feedback on a PR, you can just make additional changes on the git branch you are working on that resolve the comment or change requested. Commit those changes and push and the PR will automatically pick them up.
For testing, I was thinking about adding a unit test with some input data that specifically tests this issue you have found. Is there some set of input values and expected results that would check that the bug fixed by these changes works?
I have no idea what your coding experience is, but if you need help, it is also possible for me to check out your branch and make changes on it if showing rather than describing would be more helpful.
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.
Thanks Tim again. I completely agree with you regarding the code lines you proposed. I have limited experience with Github and IMAP code repository, so "check out your branch and make changes on it" solution would be probably the best one.
I am still thinking about a unit test for the bug.