Fix hi goodtimes CDF to txt convertor#2888
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates IMAP-Hi goodtimes interval extraction and TXT export so the generated TXT represents good time/bin regions (rather than writing out culled regions), matching the requested downstream “IBEX-style” goodtimes text format conversion workflow.
Changes:
- Reworked
GoodtimesAccessor.get_good_intervals()to group by ESA sweeps and emit intervals only for good bin regions. - Updated
write_txt()output formatting and updated unit tests to reflect sweep-based grouping and “good-only” intervals. - Adjusted tests to use
xarray.Dataset.sizeswhere appropriate.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
imap_processing/hi/hi_goodtimes.py |
Changes interval extraction to sweep-grouping and updates TXT writer formatting to output good-only intervals. |
imap_processing/tests/hi/test_hi_goodtimes.py |
Updates expectations for the new sweep-based grouping and good-only interval output, plus minor xarray API usage tweaks. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
lacoak21
left a comment
There was a problem hiding this comment.
Looks good to me! I just had one clarifying question.
| # Find transitions: +1 = start of group, -1 = end of group | ||
| diff = np.diff(padded.astype(int)) | ||
| starts = np.flatnonzero(diff == 1) | ||
| # We need to adjust ends for the shortening from diffs performed. |
8681161
into
IMAP-Science-Operations-Center:dev
Change Summary
This PR only changes logic used to write CDF files to txt. This is not used in producing goodtimes products. It is only used by the IT to convert the CDF to a txt format used on IBEX so that Paul's tools will work with the goodtimes txt file.
The previous logic was not what Paul wanted. He wants the list to indicate the goodtimes only. I was previously writing out the culled times.
Closes: #2879