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

Process multiple CoDICE APIDs per input file #1162

Merged

Conversation

bourque
Copy link
Collaborator

@bourque bourque commented Nov 18, 2024

Change Summary

Overview

Apologies for the large PR here. I found that it was difficult to split this up into smaller chunks since several aspects of this are dependent on each other.

This PR

  • Adds support for processing multiple APIDs per input file
  • Uses updated simulated CoDICE L0 test data, which resulted in various changes
  • Some updates to docstrings, in-line comments, and TODOs

Closes #769 and #992

New Files

  • imap_processing/tests/codice/data/imap_codice_l0_raw_20241110_v001.pkts
    • New simulated CoDICE L0 input data, containing multiple APIDs

Deleted Files

  • Individual APID test L0 files

Updated Files

  • imap_processing/cdf/config/imap_codice_global_cdf_attrs.yaml
    • Fixed typo
  • imap_processing/cdf/config/imap_codice_l1a_variable_attrs.yaml
    • Updates to housekeeping attribute names, and some new additions
  • imap_processing/codice/codice_l1a.py
    • Updated docstrings and in-line comments
    • Changes to support processing of multiple APIDs per input file
    • Implemented temporary workarounds until continuation packets can be supported (see CoDICE: Add support for continuation packets #1155)
    • Added function to log information about input file contents
  • imap_processing/codice/constants.py
    • Small tweak to expected number of positions for hi-counters-singles
  • imap_processing/codice/decompress.py
    • Modified code to operated on byte streams instead of strings
  • imap_processing/codice/utils.py
    • Added missing APID for hi-priorities data product
  • imap_processing/tests/codice/conftest.py
    • Now testing over single L0 file instead of one-file-per-APID
  • imap_processing/tests/codice/test_codice_l0.py
    • Now testing using the housekeeping packets in the new L0 test file
  • imap_processing/tests/codice/test_codice_l1a.py
    • Now testing using the new L0 test file with multiple APIDs
    • Added test for processing the entirety of the new file
  • imap_processing/tests/codice/test_codice_l1b.py
    • Turned off the testing until I can properly implement L1B
  • imap_processing/tests/codice/test_decompress.py
    • Updated test to reflect changes in algorithm

@bourque bourque added Ins: CoDICE Related to the CoDICE instrument Level: L1 Level 1 processing labels Nov 18, 2024
@bourque bourque self-assigned this Nov 18, 2024
Copy link
Contributor

@tech3371 tech3371 left a comment

Choose a reason for hiding this comment

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

In general, it looks great to me. I had few clarification questions.

imap_processing/tests/codice/conftest.py Show resolved Hide resolved
imap_processing/tests/codice/test_codice_l1a.py Outdated Show resolved Hide resolved
imap_processing/tests/codice/test_codice_l1a.py Outdated Show resolved Hide resolved
imap_processing/codice/codice_l1a.py Show resolved Hide resolved
imap_processing/codice/codice_l1a.py Outdated Show resolved Hide resolved
Comment on lines +193 to +195
for counter, variable_name in zip(
range(all_data.shape[1]), self.config["variable_names"]
):
Copy link
Contributor

Choose a reason for hiding this comment

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

I still have trouble understanding relationship between data's shape and variables names. Will this change in future PR? If so, ignore my comment.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For example, for the lo-sw-priorty data product, the dimensions of all_data in this case is (35, 5, 1, 12, 128). That is for 35 epochs, 5 species (or what I generically call "counters"), 1 position, 12 spin sectors, and 128 energy steps.

The data for each counter needs to be in its own CDF variable, so in order to iterate over each counter, I am iterating over all_data.shape[1].

I can add some comments in the code here to make it more clear, because it is quite confusing 😓

Copy link
Contributor

Choose a reason for hiding this comment

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

I understand. CoDICE is complicated but you are doing great job at setting up common processing code.

imap_processing/codice/codice_l1a.py Show resolved Hide resolved
imap_processing/codice/codice_l1a.py Show resolved Hide resolved
@bourque bourque requested a review from tech3371 November 19, 2024 19:04
Copy link
Contributor

@tech3371 tech3371 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 like a good setup for upcoming PR. Makes sense to me

@bourque bourque merged commit 032ef2b into IMAP-Science-Operations-Center:dev Nov 20, 2024
17 checks passed
@bourque bourque deleted the codice-multiple-packets branch November 20, 2024 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ins: CoDICE Related to the CoDICE instrument Level: L1 Level 1 processing
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

CoDICE: Add capability to decommutate multiple APIDs and multiple packets in a singe input file
2 participants