Skip to content

MNT: Change the definition of H/O that goes into a Lo pset#2617

Merged
greglucas merged 1 commit intoIMAP-Science-Operations-Center:devfrom
greglucas:lo-pset-filters
Jan 27, 2026
Merged

MNT: Change the definition of H/O that goes into a Lo pset#2617
greglucas merged 1 commit intoIMAP-Science-Operations-Center:devfrom
greglucas:lo-pset-filters

Conversation

@greglucas
Copy link
Collaborator

Even though something may be identified as an H species, we want to be a little bit more strict in the pointing set H/O counts and require a golden triple with specific ranges for H and O TOFs to identify the species.

Refactor out the logic for filtering species into helper functions rather than inlining this more complex logic.

NOTE: I need to verify the coincidence types and range values with the Lo team still to verify those are what they want in the pointing set. The "species" identifier is still OK to be "H" in the l1b file, this is just more strict for the l1c pset values apparently.

closes #2613

@greglucas greglucas added this to the January 2026 milestone Jan 27, 2026
@greglucas greglucas self-assigned this Jan 27, 2026
@greglucas greglucas added Ins: Lo Related to the IMAP-Lo instrument Level: L1 Level 1 processing labels Jan 27, 2026
L1B Direct Event dataset with only triple coincidence events.
"""
triple_types = ["111111", "111100", "111000"]
triple_idx = np.where(np.isin(de["coincidence_type"], triple_types))[0]
Copy link
Contributor

Choose a reason for hiding this comment

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

For a while now, I always try to comment that np.nonzero should be used instead of where... That's according to numpy documentation, but where is so ubiquitous that I'm not sure anymore.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, I agree with you here. I was mostly copying what was here before and moving it around. Surprisingly the nonzero() doesn't work with xarray arrays and I had to explicitly get the .values() out of it. Maybe there is a better way to use xarray.where or something like that instead even...

"001101",
"001000",
]
double_idx = np.where(np.isin(de["coincidence_type"], double_types))[0]
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment about using np.nonzero()

Comment on lines +374 to +375
h_peak_low = [20, 10, 10]
h_peak_high = [70, 50, 40]
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems like these may change. Should we write a ticket to put them in an ancillary file?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, good idea.

#2622

Copy link
Contributor

@subagonsouth subagonsouth 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 other than minor nits

Even though something may be identified as an H species, we
want to be a little bit more strict in the pointing set H/O counts
and require a golden triple with specific ranges for H and O TOFs
to identify the species.

Refactor out the logic for filtering species into helper functions
rather than inlining this more complex logic.
@greglucas greglucas merged commit 3b6f99d into IMAP-Science-Operations-Center:dev Jan 27, 2026
14 checks passed
@greglucas greglucas deleted the lo-pset-filters branch January 27, 2026 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ins: Lo Related to the IMAP-Lo instrument Level: L1 Level 1 processing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hydrogen updates for IMAP Lo

2 participants