Skip to content
Open
Show file tree
Hide file tree
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
8 changes: 7 additions & 1 deletion imap_processing/cdf/config/imap_lo_global_cdf_attrs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ imap_lo_l1b_bgrates:
imap_lo_l1b_goodtimes:
<<: *instrument_base
Data_type: L1B_goodtimes>Level-1B Goodtimes List
Logical_source: imap_lo_l1b_good-times
Logical_source: imap_lo_l1b_goodtimes
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice. This makes the product consistent with Hi and Ultra.

Logical_source_description: IMAP Mission IMAP-Lo Instrument Level-1B Data

imap_lo_l1c_goodtimes:
Expand All @@ -125,6 +125,12 @@ imap_lo_l1c_pset:
Logical_source: imap_lo_l1c_pset
Logical_source_description: IMAP Mission IMAP-Lo Instrument Level-1C Data

imap_lo_l1c_quickmap:
<<: *instrument_base
Data_type: L1C_quickmap>Level-1C QuickMap (Histogram Sky Map)
Logical_source: imap_lo_l1c_quickmap
Logical_source_description: IMAP Mission IMAP-Lo Instrument Level-1C Sky Map

# Global attributes for different sensors and sky tiling types and durations
imap_lo_l2_enamap:
<<: *instrument_base
Expand Down
46 changes: 37 additions & 9 deletions imap_processing/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1225,15 +1225,43 @@ def do_processing(
datasets = lo_l1b.lo_l1b(data_dict, ancillary_files, self.descriptor)

elif self.data_level == "l1c":
data_dict = {}
anc_dependencies: list = dependencies.get_file_paths(
source="lo", data_type="ancillary"
)
science_files = dependencies.get_file_paths(source="lo", descriptor="de")
for file in science_files:
dataset = load_cdf(file)
data_dict[dataset.attrs["Logical_source"]] = dataset
datasets = lo_l1c.lo_l1c(data_dict, anc_dependencies)
if self.descriptor == "pset":
data_dict = {}
anc_dependencies: list = dependencies.get_file_paths(
source="lo", data_type="ancillary"
)
science_files = dependencies.get_file_paths(
source="lo", descriptor="de"
)
for file in science_files:
dataset = load_cdf(file)
data_dict[dataset.attrs["Logical_source"]] = dataset

datasets = lo_l1c.lo_l1c(data_dict, anc_dependencies)

elif self.descriptor == "quickmap":
data_dict = {}
science_files = (
dependencies.get_file_paths(source="lo", descriptor="de")
+ dependencies.get_file_paths(source="lo", descriptor="nhk")
+ dependencies.get_file_paths(source="lo", descriptor="histrates")
+ dependencies.get_file_paths(source="lo", descriptor="goodtimes")
+ dependencies.get_file_paths(source="lo", descriptor="bgrates")
)

for file in science_files:
dataset = load_cdf(file)
data_dict[dataset.attrs["Logical_source"]] = dataset

quaternion_files = dependencies.get_file_paths(
source="spacecraft", descriptor="quaternions", data_type="l1a"
)
quaternion_dependencies = [
load_cdf(dep) for dep in list(set(quaternion_files))
]
quaternion_dependencies.sort(key=lambda ds: ds["epoch"].values[0])

datasets = lo_l1c.lo_l1c_quickmap(data_dict, quaternion_dependencies)

elif self.data_level == "l2":
data_dict = {}
Expand Down
35 changes: 35 additions & 0 deletions imap_processing/lo/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class LoConstants:
N_CYCLE_AVE: int = 7 # Cycles to average over when estimating background rates
N_ESA_LEVELS: int = 7 # Total number of ESA levels
N_SPINS_PER_ESA_LEVEL: int = 4 # Spins per ESA step within one histogram cycle
N_SPIN_ANGLE_BINS: int = 60 # Number of angular bins within a spin

# Nominal spin period [s]. True spin duration is NOT 15 seconds.
NOMINAL_SPIN_PERIOD_SEC: float = 15.0
Expand Down Expand Up @@ -69,3 +70,37 @@ class LoConstants:
# Padding [s] added to begin/end of each goodtime interval to ensure complete
# cycles are covered at interval edges.
GOODTIME_PADDING: float = 2.0

N_COLAT_BINS: int = 30

# The following are indexed by ESA level (0-indexed, ESA level = index + 1)
ESA_ENERGY: ClassVar[list[float]] = [
0.016,
0.030,
0.056,
0.106,
0.200,
0.405,
0.787,
1.821,
]
GEO_FACTOR: ClassVar[list[float]] = [
7.0e-5,
7.9e-5,
9.7e-5,
11.2e-5,
14.0e-5,
17.7e-5,
22.5e-5,
6.721e-5,
]
GEO_FACTOR_ERR: ClassVar[list[float]] = [
4.9e-5,
5.5e-5,
6.8e-5,
3.0e-5,
4.5e-5,
2.0e-5,
1.4e-5,
6.721e-5,
]
2 changes: 1 addition & 1 deletion imap_processing/lo/l1b/lo_l1b.py
Original file line number Diff line number Diff line change
Expand Up @@ -2696,7 +2696,7 @@ def l1b_bgrates_and_goodtimes( # noqa: PLR0912
for elem in elems:
synthetic_floors[elem] += c.BG_RATES[elem] * exposure
proxy_floors[elem] += np.sum(
elem_anti_ram_counts["H"][window_sum_start:window_sum_end]
elem_anti_ram_counts[elem][window_sum_start:window_sum_end]
)

goodtime_exposure_avg += exposure
Expand Down
Loading
Loading