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

Add Hi sensor name to imap_hi_l1b_hk products #633

Conversation

subagonsouth
Copy link
Contributor

Change Summary

Fixes missing sensor name in Hi l1b housekeeping file

Overview

New Dependencies

None

New Files

None

Deleted Files

None

Updated Files

  • imap_processing/cdf/config/imap_hi_global_cdf_attrs.yaml
    • Add hi_l1b_hk global attributes entry
  • imap_processing/hi/l1b/hi_l1b.py
    • Convert l1b hk to use CDF attribute manager
    • Move Logical_source update to common l1b location
  • imap_processing/tests/hi/test_hi_l1b.py
    • Update test value for l1b_hk Logical_source

Testing

Test updated with new Logical_source value

closes #632

Convert l1b hk to use CDF attribute manager
Move Logical_source update to common l1b location
Update test value for l1b_hk Logical_source
@subagonsouth subagonsouth added Ins: Hi Related to the IMAP-Hi instrument CDF Related to CDF files labels Jun 17, 2024
@subagonsouth subagonsouth requested a review from a team June 17, 2024 15:29
@subagonsouth subagonsouth self-assigned this Jun 17, 2024
@subagonsouth subagonsouth requested review from bourque, sdhoyt, greglucas, tech3371, vmartinez-cu, daralynnrhode and anamanica and removed request for a team June 17, 2024 15:29
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.

I had one question. Otherwise, it looks great!

# TODO: write a function that extracts the sensor from Logical_source
# some functionality can be found in imap_data_access.file_validation but
# only works on full file names
sensor_str = logical_source_parts[-1].split("-")[0]
Copy link
Contributor

Choose a reason for hiding this comment

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

Before you had like this, was that not working?

sensor_str = l1a_dataset.attrs["Logical_source"].split("_")[-1].split("-")[0]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That was working, but it was parsing directly from Logical_source. I moved this code up into the hi_l1b function where I had already performed the first part of the parsing. Line 39 of hi_l1b.py:
logical_source_parts = l1a_dataset.attrs["Logical_source"].split("_").

Ultimately, this logic should be moved to a common location so that any instrument that wants to parse the sensor from Logical_source or filename can call that function.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah ok. Sorry, missed that part. Cool, that makes sense.

@subagonsouth subagonsouth merged commit 9b1c351 into IMAP-Science-Operations-Center:dev Jun 17, 2024
17 checks passed
@subagonsouth subagonsouth deleted the 632-add-hi-sensor-name-to-imap_hi_l1b_hk-products branch June 17, 2024 17:20
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: Hi Related to the IMAP-Hi instrument
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Add Hi sensor name to imap_hi_l1b_hk products
2 participants