Fix Hi L2 naming of bg variables#2677
Fix Hi L2 naming of bg variables#2677subagonsouth wants to merge 1 commit intoIMAP-Science-Operations-Center:devfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR aligns IMAP-Hi L2 background variable names with the established ENA maps L2 naming convention (per Issue #2676), renaming the background rate fields to their singular + systematic-error forms.
Changes:
- Renamed Hi L2 background variables:
bg_rates→bg_rate,bg_rates_unc→bg_rate_sys_err. - Updated Hi L2 processing code to reference the new background variable names.
- Updated unit tests and HiPointingSet expectations to match the renamed variables.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| imap_processing/hi/hi_l2.py | Updates projected/processed variable sets and computations to use bg_rate / bg_rate_sys_err. |
| imap_processing/ena_maps/ena_maps.py | Updates Hi L1C→L2 variable rename mapping to output bg_rate / bg_rate_sys_err. |
| imap_processing/tests/hi/test_hi_l2.py | Renames test datasets/assertions to use the new background variable names. |
| imap_processing/tests/ena_maps/test_ena_maps.py | Updates HiPointingSet test expectations to the new variable names. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| map_ds["ena_intensity_sys_err"] = ( | ||
| np.sqrt(map_ds["bg_rates"] * map_ds["exposure_factor"]) | ||
| np.sqrt(map_ds["bg_rate"] * map_ds["exposure_factor"]) | ||
| / map_ds["exposure_factor"] | ||
| / flux_conversion_divisor | ||
| ) |
There was a problem hiding this comment.
ena_intensity_sys_err is currently computed from sqrt(bg_rate * exposure_factor) / exposure_factor, which is a Poisson/statistical uncertainty estimate based on background counts. This (a) doesn’t use the newly carried bg_rate_sys_err variable at all, and (b) conflicts with the CDF metadata describing ena_intensity_sys_err as a non-statistical/systematic error. Consider propagating bg_rate_sys_err into intensity units (and/or combining it with other systematic terms), or rename/reclassify this output so statistical vs systematic uncertainties are not mislabeled.
Change Summary
Overview
This just renames the Hi L2 variables:
Closes: #2676