2594 lo l2 updates to cg code and bg variable names#2596
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request updates the Compton-Getting (CG) transformation equations to match Nathan's mapping document and renames background rate variables from plural to singular form for consistency.
Changes:
- Updated CG correction equations with sign changes to match the mapping document exactly
- Renamed background rate variables from
bg_ratestobg_rateand similar plural-to-singular changes for related uncertainty variables - Updated CDF configuration files to reflect new variable names
- Added test to verify new background rate variables are present in L2 output
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/ena_maps/utils/corrections.py | Updated CG transformation equations with sign corrections and comment clarifications |
| imap_processing/lo/l2/lo_l2.py | Renamed bg_rates variables to bg_rate (singular) throughout the processing pipeline |
| imap_processing/cdf/config/imap_enamaps_l2-rectangular_variable_attrs.yaml | Added configuration for bg_rate_stat_uncert and bg_rate_sys_err variables |
| imap_processing/cdf/config/imap_enamaps_l2-healpix_variable_attrs.yaml | Added configuration for bg_rate_stat_uncert and bg_rate_sys_err variables |
| imap_processing/cdf/config/imap_enamaps_l2-common_variable_attrs.yaml | Updated variable names and descriptions from bg_rate_uncert to bg_rate_stat_uncert and added bg_rate_sys_err |
| imap_processing/tests/lo/test_lo_l2.py | Added test to verify bg_rate variables are present in integration test output |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # x_k = (-êₛ · û_sc) + sqrt(y² + (êₛ · û_sc)² - 1) | ||
| # dot_product = look_hat dot usc_hat = (-êₛ · û_sc) |
There was a problem hiding this comment.
The comment states that "dot_product = look_hat dot usc_hat = (-êₛ · û_sc)" implying the dot product equals the negative of the look direction dot spacecraft direction. However, the actual calculation at lines 581-588 computes a positive dot product between pset["look_direction"] and sc_direction_vector without any negation. Either the comment or the code needs to be corrected for consistency.
| # x_k = (-êₛ · û_sc) + sqrt(y² + (êₛ · û_sc)² - 1) | |
| # dot_product = look_hat dot usc_hat = (-êₛ · û_sc) | |
| # x_k = (êₛ · û_sc) + sqrt(y² + (êₛ · û_sc)² - 1) | |
| # dot_product = look_hat · û_sc = (êₛ · û_sc) |
| velocity_sc = x * sc_velocity_km_per_sec | ||
|
|
||
| # Calculate the kinetic energy in the spacecraft frame | ||
| # Calculate the kinetic energy of the spacecraft |
There was a problem hiding this comment.
The comment states "Calculate the kinetic energy of the spacecraft" but this should be "Calculate the kinetic energy of the ENA in the spacecraft frame" to accurately reflect what is being calculated. The variable name "energy_sc" correctly indicates it's the ENA energy in spacecraft frame, not the spacecraft's own kinetic energy.
| # Calculate the kinetic energy of the spacecraft | |
| # Calculate the kinetic energy of the ENA in the spacecraft frame |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
54a6895
into
IMAP-Science-Operations-Center:dev
Change Summary
Overview
Updates included:
Closes: #2594