HIT L1A - Add attributes to science datasets#1835
Merged
vmartinez-cu merged 10 commits intoIMAP-Science-Operations-Center:devfrom Jun 23, 2025
Merged
HIT L1A - Add attributes to science datasets#1835vmartinez-cu merged 10 commits intoIMAP-Science-Operations-Center:devfrom
vmartinez-cu merged 10 commits intoIMAP-Science-Operations-Center:devfrom
Conversation
…esc to be more descriptive.
…adata for PHA event dataset
…sion labels. Update tests that validate coordinates to include dimension labels that were added to the dataset
…place to avoid losing the reference to the dataset object in the for loop
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds science data attributes to L1A datasets and updates tests and data processing to support the new attribute scheme. Key changes include:
- Adding new dimension label attributes (e.g., zenith_label, azimuth_label) in L1A and L2 dataset processing.
- Updating tests to verify the presence of new coordinate labels and converting coordinate collections to sets.
- Minor comment updates in decom_hit.py.
Reviewed Changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| imap_processing/tests/hit/test_hit_l2.py | Added new coordinate label assertions for scientific data attributes. |
| imap_processing/tests/hit/test_hit_l1b.py | Converted coordinate validations from list to set and added new label keys. |
| imap_processing/hit/l2/hit_l2.py | Updated coordinate assignment to directly add label arrays for dimensions. |
| imap_processing/hit/l1a/hit_l1a.py | Revised dataset iteration to use a dictionary for logical sources and updated coordinate attribute assignment. |
| imap_processing/hit/l0/decom_hit.py | Updated comment to remove obsolete reference to the YAML file. |
Comments suppressed due to low confidence (2)
imap_processing/hit/l1a/hit_l1a.py:292
- The removal of coordinate assignment for each data variable (previously done with ds[field].assign_coords(dims)) may affect downstream processing that expects these mappings. Please confirm that this change is intentional and that the new approach properly handles coordinate assignments.
for field in ds.data_vars.keys():
imap_processing/tests/hit/test_hit_l1b.py:388
- [nitpick] Changing the coordinate comparison from a list to a set assumes that the order of coordinates is irrelevant. Please verify that this change is aligned with the expected behavior of the dataset structure.
assert valid_coords == set(l1b_standard_rates_dataset.coords), (
79453f5
into
IMAP-Science-Operations-Center:dev
14 checks passed
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.
This PR adds L1A science data attributes to the yaml file and updates L1A processing to assign attributes to science datasets
Closes #1056
Closes #1193
Updated Files
Testing
Updated tests where needed. Mostly related to validating coordinates that now have dimension labels