Glows L2 - Apply calibration#2918
Open
vmartinez-cu wants to merge 8 commits intoIMAP-Science-Operations-Center:devfrom
Open
Glows L2 - Apply calibration#2918vmartinez-cu wants to merge 8 commits intoIMAP-Science-Operations-Center:devfrom
vmartinez-cu wants to merge 8 commits intoIMAP-Science-Operations-Center:devfrom
Conversation
…r calibration factors and sort data by time. Update corresponding unit test to reflect changes
…t for the calibration factor needed for flux calculations. Update existing tests where needed to fix broken tests
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds support for applying a time-dependent GLOWS L2 calibration factor (counts/s per Rayleigh) when converting daily lightcurve histogram rates and uncertainties into physical units (Rayleighs), using an ancillary “l2-calibration” dataset.
Changes:
- Plumbs a calibration dataset through
glows_l2()→HistogramL2→DailyLightcurveand applies it in flux/uncertainty calculations. - Adds
HistogramL2.get_calibration_factor()to select an appropriate factor based on the mid-epoch of the observation day. - Refactors the GLOWS ancillary calibration
.datreader to store calibration times as coordinates and sort by time; updates/extends tests and fixtures accordingly.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| imap_processing/glows/l2/glows_l2.py | Passes calibration dataset into HistogramL2 during L2 generation. |
| imap_processing/glows/l2/glows_l2_data.py | Adds calibration-factor selection and applies calibration in DailyLightcurve flux math. |
| imap_processing/ancillary/ancillary_dataset_combiner.py | Refactors l2-calibration .dat ingestion to use start_time_utc as a coordinate and sorts by it. |
| imap_processing/tests/glows/conftest.py | Adds a mock calibration dataset fixture. |
| imap_processing/tests/glows/test_glows_l2.py | Updates tests to provide calibration dataset to glows_l2()/HistogramL2. |
| imap_processing/tests/glows/test_glows_l2_data.py | Adds coverage for calibration-factor selection; updates flux/uncertainty expectations with calibration. |
| imap_processing/tests/ancillary/test_ancillary_dataset_combiner.py | Extends calibration combiner test and asserts coordinate usage/sorting. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…-epoch is extracted from numpy array
…afer comparison with l1b dataset epoch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request implements the use of a time-dependent calibration factor for GLOWS L2 data processing, ensuring that photon flux and uncertainties are correctly converted to physical units (Rayleighs) using ancillary calibration data. The changes include updating data structures, processing logic, and tests to support calibration lookup and application.
Key changes:
GLOWS L2 Data Processing and Calibration
The
HistogramL2andDailyLightcurveclasses were updated to accept and use a calibration factor (counts per second per Rayleigh), which is required for correct photon flux and uncertainty calculations. The calibration factor is selected based on the mid-epoch of the observational day using a new static method,get_calibration_factor.The main
glows_l2processing function passes a calibration dataset through to theHistogramL2data class.Ancillary Calibration Data Handling
convert_file_to_dataset) was refactored to store calibration times as coordinates and ensure the dataset is sorted by time, improving reliability when selecting calibration factors.Testing Enhancements
Closes #2886