Skip to content

Idex release two updates - #3399

Merged
tmplummer merged 17 commits into
IMAP-Science-Operations-Center:devfrom
aldo9253:idex_release_two_updates
Aug 28, 2026
Merged

Idex release two updates#3399
tmplummer merged 17 commits into
IMAP-Science-Operations-Center:devfrom
aldo9253:idex_release_two_updates

Conversation

@aldo9253

@aldo9253 aldo9253 commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

Change Summary

closes #3336

Overview

Adds IDEX event classification and waveform saturation flags through L1A–L2A, with
saturation- and Science-mode-aware velocity and mass estimates.

File changes

  • Adds event and waveform saturation flag logic.
  • Propagates flags through L1A, L1B, and L2A.
  • Updates L2A velocity/mass calculations and masking behavior.
  • Adds CDF metadata and tests.

Testing

Relevant IDEX tests, formatting, linting, type checks, and pre-commit checks pass.
The local 20260719 processing chain completed successfully through L2A.

…dicate instrument status (science, pulser, noise capture). Added flag to indicate if the event was an actual dust event. Resolved ion grid velocity and mass estimates to use the QI/Qt ratio and Qt respectively. Added logic to NaN fields based on flag states.
@bryan-harter
bryan-harter requested review from lacoak21 and a balanced review from Copilot August 20, 2026 19:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds IDEX release-two event classification and saturation-aware processing across L1A–L2B.

Changes:

  • Adds event and waveform saturation flags through L1A–L2A.
  • Updates velocity, mass, and L2B count selection logic.
  • Adds CDF metadata, tests, and a local processing script.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
run_local_idex_chain.sh Adds local L1A–L2A processing workflow.
imap_processing/idex/idex_event_flags.py Implements event and saturation classification.
imap_processing/idex/idex_l1a.py Generates event flags.
imap_processing/idex/idex_l1b.py Propagates flags to L1B.
imap_processing/idex/idex_l2a.py Adds saturation-aware estimates and masking.
imap_processing/idex/idex_l2b.py Filters events and selects target estimates.
imap_processing/tests/idex/test_idex_event_flags.py Tests flag classification.
imap_processing/tests/idex/test_idex_l0.py Updates expected variable count.
imap_processing/tests/idex/test_idex_l1b.py Tests L1B flag propagation.
imap_processing/tests/idex/test_idex_l2a.py Tests masking and Ion Grid estimates.
imap_processing/tests/idex/test_idex_l2b.py Tests filtering and target selection.
imap_processing/cdf/config/imap_idex_l1a_variable_attrs.yaml Defines L1A flag metadata.
imap_processing/cdf/config/imap_idex_l1b_variable_attrs.yaml Defines L1B flag metadata.
imap_processing/cdf/config/imap_idex_l2a_variable_attrs.yaml Defines L2A flag metadata.
imap_processing/cdf/config/imap_idex_l2b_variable_attrs.yaml Corrects charge units to pC.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread imap_processing/idex/idex_l2b.py Outdated
Comment thread imap_processing/idex/idex_event_flags.py Outdated
Comment thread imap_processing/idex/idex_event_flags.py Outdated
Comment thread run_local_idex_chain.sh Outdated
Comment thread run_local_idex_chain.sh Outdated
VAR_TYPE: data

# <=== Instrument Setting Attributes ===>
science_event_flag:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Have you validated that these new attrs are ISTP compliant?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Alex is going to use SKTeditor to check

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Best I can tell, these values are compliant. The webpage checker doesn't seem to like a fill-value of 255 but it's what we use across other variables so I think we leave it as is.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What was the error? Can you attach a screen shot? 255 may be a valid fill val for other variables but not these if its not configured properly.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

ISTP checker now returning compliance for the flags! Thanks for catching those issues.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

excellent. Super appreciate you checking.

@lacoak21 lacoak21 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

OK I have reviewed part of this and will continue when comments are addressed. In the future this PR could have been broken down into maybe 4 or 5 PRs. We generally try to make PRs as small as possible.

Comment thread imap_processing/idex/idex_l2a.py Outdated
Comment thread imap_processing/idex/idex_l2a.py
Comment thread imap_processing/idex/idex_l2a.py Outdated
Comment thread run_local_idex_chain.sh Outdated
Comment thread imap_processing/tests/idex/test_idex_l0.py
Comment thread imap_processing/idex/idex_l2a.py Outdated
saturation_flag = f"{waveform_name}_saturation_flag"
if saturation_flag not in l2a_dataset:
message = f"Required L2A saturation flag is missing: {saturation_flag}"
logger.error(message)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think you can just choose one. Either log a message and continue with the code and do something OR raise an error.

@lacoak21 lacoak21 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM! Once we know these are ISTP compliant I think this is good to go.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.

CATDESC: Boolean event classification flag.
DEPEND_0: epoch
DICT_KEY: SPASE>Support>SupportQuantity:QualityFlag
FILLVAL: 0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ah this is super important @aldo9253 I would definitely fix this

Comment on lines +436 to +442
right_bracketed = (
right < corrected.size - 1
and np.isfinite(corrected[right - 1])
and corrected[right - 1] >= half_height
and np.isfinite(corrected[right])
and corrected[right] < half_height
)
@aldo9253

aldo9253 commented Aug 25, 2026 via email

Copy link
Copy Markdown
Collaborator Author

@lacoak21

Copy link
Copy Markdown
Contributor

[cid:2fbfdab1-f6a5-4470-85da-a8b21965989e]

Can you try uploading it again?

@aldo9253

Copy link
Copy Markdown
Collaborator Author

Just emailed it to you.

VALIDMIN: 0
VAR_TYPE: support_data

event_flag_base: &event_flag_base

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Oh I see. There are a couple of issues here.

I would not use "trigger_base" as the base because those are for variables that are not quality flags. So I would remove that part.

Second, make sure the array is actually np.unit8 e.g. data.astype(np.uint8)
It thinks the data is np.uint64 as implied by the warning.

@aldo9253

Copy link
Copy Markdown
Collaborator Author

Okay, hopefully this commit addressed it all.

@lacoak21

Copy link
Copy Markdown
Contributor

Okay, hopefully this commit addressed it all.

Nice looks great.

Another thing I thought of. Have you produced a CDF with this code locally?

@aldo9253

aldo9253 commented Aug 25, 2026 via email

Copy link
Copy Markdown
Collaborator Author

@aldo9253

Copy link
Copy Markdown
Collaborator Author

I have some l2b changes here that will conflict with your 10-day refactor. I'm going to revert the ones here so that we have a clean merge. We will tackle all l2b related updates in seperate PRs more cleanly.

@tmplummer
tmplummer merged commit f469be9 into IMAP-Science-Operations-Center:dev Aug 28, 2026
38 of 39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IDEX dust identification algorithm

4 participants