Skip to content

Conversation

@ahotasu
Copy link
Collaborator

@ahotasu ahotasu commented Jan 31, 2026

Worked with Nathan to implement addition of background to intensities per the latest update to the mapping document.

Change Summary

Overview

Added scalar logarithmic stability factor and code to use that factor for adding the background intensities to the ENA intensities for all energies. This, combined with Greg and Tim's work on (BUG - Lo L1c backgrounds not being selected #2651) was used to generate new L1c Pset and L2 CG Corrected Flux products that Nathan validated late last night.

New Dependencies

None

Updated Files

  • lo_l2.py
    • added background factor, summation, and uncertainties/systematic errors to the start of the flux calculation function, which operates on the intensities after the bootstrap and sputtering corrections, but before the logarithmic calculations in the PowerLawFluxCorrector

Testing

Not versed enough yet on pytest to run. :-(

…ns-Center#2647

Worked with Nathan to implement addition of background to intensities
per the latest update to the mapping document.
@ahotasu ahotasu marked this pull request as draft January 31, 2026 16:09
@ahotasu ahotasu changed the title Lo pointing set and map background rates update #2647 Lo pointing set and map background rates update Jan 31, 2026
Comment on lines +1312 to +1313
# Add in the background intensity to ensure that logarithms behave
# properly in the flux corrector when intensities are zero or very low.
Copy link
Contributor

@subagonsouth subagonsouth Jan 31, 2026

Choose a reason for hiding this comment

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

This is really confusing to me. I thought that a critical idea in the Lo algorithm is that the backgrounds do not get subtracted. So coming into this function, ena_intensity = signal_intensity + bg_intensity. Then this factor of the background is added in on top which means ena_intensity = signal_intensity + bg_intensity + stability_factor * bg_intensity. That doesn't make sense to me. I know that this is what Nathan wants but I am really struggling to understand why. To me this seems like it is purely an problem with the crappy intput data being used for validation and this fix actually degrades the output product.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I completely agree with this comment, and that is why I'm hesitant to throw this in there at the last second.

I think this is actually really bad because it adds in 4% uncertainty, but then doesn't remove that later on, so could be very misleading in terms of what is going on, and this is only before flux corrections, but if someone is looking at a sputtering/bootstrap map, then those wouldn't be corrected. It seems like this is a recipe for confusion.

@greglucas greglucas added Ins: Lo Related to the IMAP-Lo instrument Level: L2 Level 2 processing Mapper Tools Work related to common mapper tools labels Jan 31, 2026
Comment on lines +1324 to +1327
dataset["bg_intensity_sys_err"] = np.sqrt(
(dataset["bg_intensity_sys_err"]) ** 2
+ (dataset["bg_intensity"] * bg_logarithmic_stability_factor) ** 2
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

@greglucas
Copy link
Collaborator

I think we should take some time and think about this more (not just us, but the instrument team as well). Are there other ways to approach this, like for instance setting the flux values to the min(flux, bg) so that flux is never lower than bg. Or to set bg to the flux value if you are measuring less than background. i.e. I am wondering if we can somehow make the algorithm more robust rather than changing the data itself that goes into the algorithm.

@ahotasu ahotasu self-assigned this Feb 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ins: Lo Related to the IMAP-Lo instrument Level: L2 Level 2 processing Mapper Tools Work related to common mapper tools

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants