Skip to content

Conversation

@subagonsouth
Copy link
Contributor

Change Summary

Overview

Add the Lo L2 star product.
Add epoch_to_fractional_doy function to time.py

Closes: #2576

Copy link
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 support for Lo L2 star sensor product processing by implementing star sensor L1B data product generation and adding a utility function for converting epochs to fractional day-of-year.

Changes:

  • Added epoch_to_fractional_doy() function to convert TTJ2000ns epochs to floating-point day-of-year values
  • Implemented star sensor L1B processing pipeline including filtering, grouping, and profile averaging
  • Added comprehensive test coverage for both the new time conversion function and star sensor processing

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
imap_processing/spice/time.py Added epoch_to_fractional_doy function for fractional DOY calculations using SPICE timout
imap_processing/tests/spice/test_time.py Comprehensive test suite for epoch_to_fractional_doy including edge cases and array inputs
imap_processing/lo/l1b/lo_l1b.py Implemented star sensor L1B processing functions: filtering, profile calculation, grouping, and dataset creation
imap_processing/tests/lo/test_lo_l1b.py Extensive test coverage for all star sensor processing functions and integration test
imap_processing/cdf/config/imap_lo_l1b_variable_attrs.yaml Added CDF variable attributes for star sensor data products (met, spin_angle, avg_amplitude, count_per_bin)
imap_processing/cdf/config/imap_lo_global_cdf_attrs.yaml Added global CDF attributes for imap_lo_l1b_star data product

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Collaborator

@greglucas greglucas left a comment

Choose a reason for hiding this comment

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

Overall looks great to me! A few minor comments that can be ignored as you see fit.

Comment on lines +1957 to +1964
repoint_df = interpolate_repoint_data(shcoarse_sec)
# Exclude times where repoint_in_progress is True
repoint_mask = ~repoint_df["repoint_in_progress"].values
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is a cool use of this function! If I'm understanding right, the repoint_df will grow to the size of whatever shcoarse values you have and do linear interpolation between items and you are then taking advantage of the fact that anything other than 0 will evaluate to True and thus give you repoint_in_progress during transitions. Is that the right interpretation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Mostly right. The "interpolation" method is to find the repoint row for each input MET time such that repoint_start_time[i] <= MET < repoint_start_time[i+1]. Maybe a misnomer, but it is sort of nearest neighbor interpolation? Then repoint_in_progress is computed and is already a boolean.

imap_lo_l1b_star:
<<: *instrument_base
Data_type: L1B_star>Level-1B Star Sensor Spin-Averaged Profile
Logical_source: imap_lo_l1b_star

Choose a reason for hiding this comment

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

This should be imap_lo_l1b_prostar for pipeline processing. ~by Greg and Mitchell

@greglucas greglucas changed the title 2576 lo star snesor l1b 2576 lo star sensor l1b Jan 27, 2026
@subagonsouth subagonsouth force-pushed the 2576-lo-star-snesor-l1b branch from 18031ec to e558d37 Compare January 28, 2026 00:33
@greglucas greglucas merged commit a43fede into IMAP-Science-Operations-Center:dev Jan 28, 2026
14 checks passed
@github-project-automation github-project-automation bot moved this to Done in IMAP Jan 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Lo star snesor L1B

3 participants