Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions imap_processing/lo/l2/lo_l2.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ def lo_l2(

logger.info("Step 3: Converting to dataset and adding geometric factors")
dataset = sky_map.to_dataset()

if cg_correction:
dataset["energy_sc"] /= dataset["exposure_factor"]

dataset = add_geometric_factors(dataset, map_descriptor.species)

logger.info("Step 4: Calculating rates and intensities")
Expand Down Expand Up @@ -394,6 +398,8 @@ def process_single_pset(
pset_processed, energy_values_ev
)

pset_processed["energy_sc"] *= pset_processed["exposure_factor"]

# Always calculate ram-mask to identify ram/anti-ram bins
pset_processed = calculate_ram_mask(pset_processed)

Expand Down Expand Up @@ -869,8 +875,8 @@ def calculate_all_rates_and_intensities(
logger.info("Interpolating map intensities to helio-frame energies")
dataset = interpolate_map_flux_to_helio_frame(
dataset,
dataset["energy"],
dataset["energy"],
dataset["energy"] * 1000,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that the documentation for interpolate_map_flux_to_helio_frame is wrong when it says that input energies must be in units of eV. It really just matters that the two inputs (esa_energy and hf_energy) are in the same units. This is because all the equations use ratios of energies so as long as the units are the same, it should produce the same results.

dataset["energy"] * 1000,
["ena_intensity", "bg_intensity"],
)

Expand Down
Loading