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

SWAPI Quality Flag #805

Merged
merged 3 commits into from
Sep 6, 2024

Conversation

tech3371
Copy link
Contributor

@tech3371 tech3371 commented Aug 30, 2024

Change Summary

Overview

Uses Quality flags class to set SWAPI quality flags. Closes #707

Updated Files

  • imap_processing/cdf/config/imap_swapi_global_cdf_attrs.yaml
    • update descriptor attrs
  • imap_processing/cdf/config/imap_swapi_variable_attrs.yaml
    • update flags attrs
  • imap_processing/quality_flags.py
    • Added SWAPI flags class
  • imap_processing/swapi/l1/swapi_l1.py
    • update L1 code to use new flag class
    • update uncertainty variables
  • imap_processing/swapi/l2/swapi_l2.py
    • updates based on l1 updates
  • pyproject.toml
    • too many argument error

Testing

update test based on above changes

@tech3371 tech3371 added enhancement New feature or request Ins: SWAPI Related to the SWAPI instrument Level: L1 Level 1 processing Level: L2 Level 2 processing labels Aug 30, 2024
@tech3371 tech3371 requested a review from a team August 30, 2024 22:16
@tech3371 tech3371 self-assigned this Aug 30, 2024
@tech3371 tech3371 requested review from bourque, sdhoyt, greglucas, subagonsouth, vmartinez-cu, laspsandoval and maxinelasp and removed request for a team August 30, 2024 22:16
@laspsandoval
Copy link
Contributor

Please update this page when you have a chance:
https://lasp.colorado.edu/galaxy/display/IMAP/Quality+Flags

Copy link
Contributor

@laspsandoval laspsandoval 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! I have a few questions/comments.

@@ -79,7 +79,7 @@ def test_decompress_count():
# compressed + no-overflow, compressed + overflow, no compression
raw_values = np.array([[12, 0xFFFF, 12]])
compression_flag = np.array([[1, 1, 0]])
expected = np.array([[12 * 16, -1, 12]])
expected = np.array([[12 * 16, np.iinfo(np.int32).max, 12]], dtype=np.int32)
returned_value = decompress_count(raw_values, compression_flag)
np.testing.assert_array_equal(returned_value, expected)

Copy link
Contributor

Choose a reason for hiding this comment

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

It would be helpful to have one test that shows the flags set in dataset["swp_flags"].

Copy link
Contributor Author

Choose a reason for hiding this comment

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

for sure! I will add a test for this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Laura, actually I am going to wait to add the test and do this in future PR if you don't mind. Right now, all flags are set to 0 but SWAPI will provide me some useful data that will have some good flags set. I will add the test with that change.

imap_processing/swapi/l1/swapi_l1.py Show resolved Hide resolved
imap_processing/quality_flags.py Show resolved Hide resolved
Copy link
Collaborator

@bourque bourque left a comment

Choose a reason for hiding this comment

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

I can't say much to the SWAPI DQ flags themselves, but the code changes look good to me!

pyproject.toml Show resolved Hide resolved
@tech3371
Copy link
Contributor Author

tech3371 commented Sep 6, 2024

I am going to merge this since there was not change request.

@tech3371 tech3371 merged commit 46bb8fd into IMAP-Science-Operations-Center:dev Sep 6, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Ins: SWAPI Related to the SWAPI instrument Level: L1 Level 1 processing Level: L2 Level 2 processing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SWAPI L2 Algorithm - Add quality flags
3 participants