Skip to content

HIT L1A - Add attributes to science datasets#1835

Merged
vmartinez-cu merged 10 commits intoIMAP-Science-Operations-Center:devfrom
vmartinez-cu:l1a_sci_attrs
Jun 23, 2025
Merged

HIT L1A - Add attributes to science datasets#1835
vmartinez-cu merged 10 commits intoIMAP-Science-Operations-Center:devfrom
vmartinez-cu:l1a_sci_attrs

Conversation

@vmartinez-cu
Copy link
Copy Markdown
Collaborator

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

  • imap_processing/cdf/config/imap_hit_l1a_variable_attrs.yaml
    • added science dataset attributes
  • imap_processing/hit/l0/decom_hit.py
    • removed comment
  • imap_processing/hit/l1a/hit_l1a.py
    • Updated code that adds attributes to science dataset
  • imap_processing/hit/l2/hit_l2.py
    • Minor update to code that adds dimension labels to datasets to match approach in L1A

Testing

Updated tests where needed. Mostly related to validating coordinates that now have dimension labels

@vmartinez-cu vmartinez-cu changed the title L1a sci attrs HIT L1A - Add attributes to science datasets Jun 20, 2025
@vmartinez-cu vmartinez-cu self-assigned this Jun 20, 2025
@vmartinez-cu vmartinez-cu added Ins: HIT Related to the HIT instrument Level: L1 Level 1 processing CDF Related to CDF files labels Jun 20, 2025
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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), (

Copy link
Copy Markdown
Contributor

@sdhoyt sdhoyt left a comment

Choose a reason for hiding this comment

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

Looks good!

@vmartinez-cu vmartinez-cu merged commit 79453f5 into IMAP-Science-Operations-Center:dev Jun 23, 2025
14 checks passed
@github-project-automation github-project-automation bot moved this to Done in IMAP Jun 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CDF Related to CDF files Ins: HIT Related to the HIT instrument Level: L1 Level 1 processing

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

HIT L1A - Add attrs to count rates CDF HIT L1A- Add science data attrs to CDF YAML

3 participants