Add function for interpreting quality flag#350
Merged
wtbarnes merged 3 commits intoLM-SAL:mainfrom Feb 12, 2025
Merged
Conversation
Contributor
Reviewer's Guide by SourceryThis PR introduces a new utility function for interpreting the 32-bit QUALITY flag from AIA observation headers and returns a list of messages for the set flag bits. The implementation includes a bitwise evaluation of the QUALITY value and uses a predefined mapping of flag bits to their associated messages. Additionally, parameterized tests are added to verify the function's correctness. Updated class diagram for aiapy/util/util.pyclassDiagram
class util_Module {
<<module>>
+check_quality_flag(quality: int): list
+sdo_location(time)
+telescope_number
- _QUALITY_FLAG_MESSAGES: dict
}
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey @wtbarnes - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider using a named tuple or dataclass instead of a dictionary for
_QUALITY_FLAG_MESSAGES. - The docstring could be improved by including an example of how to use the function.
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟡 Testing: 1 issue found
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Member
If that is what the guide says, I guess we can ask the JSOC?
I feel like that would be nice. Would kind of be nice if an AIA Map .quality returned both the value and message but thats probs not feasible.
Sure. |
nabobalis
approved these changes
Feb 12, 2025
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The
QUALITYkeyword in the AIA headers is a 32-bit integer that denotes the quality of an observation. Flags associated with the observation quality are encoded bit-wise, with a different message associated with each bit flag. See section 7.7.6 of the SDO user guide for more details.This PR adds a function that takes in the value of the
QUALITYkey and returns a list of messages associated with any quality flags that are set.A few questions:
utilthe right place for it to live?Summary by Sourcery
Add a function to interpret the AIA observation QUALITY flag.
New Features:
check_quality_flag()to interpret theQUALITYkeyword in AIA image headers, which is a bitmask indicating the status of the observation (e.g., nominal, calibration, eclipse).Tests:
check_quality_flag()function.