Skip to content

Fix Hi L2 naming of bg variables#2677

Open
subagonsouth wants to merge 1 commit intoIMAP-Science-Operations-Center:devfrom
subagonsouth:2676-hi-l2---fix-bg_rate-variable-names
Open

Fix Hi L2 naming of bg variables#2677
subagonsouth wants to merge 1 commit intoIMAP-Science-Operations-Center:devfrom
subagonsouth:2676-hi-l2---fix-bg_rate-variable-names

Conversation

@subagonsouth
Copy link
Contributor

Change Summary

Overview

This just renames the Hi L2 variables:

  • bg_rates -> bg_rate
  • bg_rates_unc -> bg_rate_sys_err

Closes: #2676

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 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_ratesbg_rate, bg_rates_uncbg_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.

Comment on lines 442 to 446
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
)
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Hi L2 - fix bg_rate variable names

1 participant