Skip to content
Merged
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
15 changes: 10 additions & 5 deletions imap_processing/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ def do_processing(

# Load conversion table (needed for both hist and DE)
conversion_table_file = dependencies.get_processing_inputs(
descriptor="conversion-table-for-anc-data"
descriptor="l1b-conversion-table-for-anc-data"
)[0]

with open(conversion_table_file.imap_file_paths[0].construct_path()) as f:
Expand All @@ -691,16 +691,16 @@ def do_processing(
if "hist" in self.descriptor:
# Create file lists for each ancillary type
excluded_regions_files = dependencies.get_processing_inputs(
descriptor="map-of-excluded-regions"
descriptor="l1b-map-of-excluded-regions"
)[0]
uv_sources_files = dependencies.get_processing_inputs(
descriptor="map-of-uv-sources"
descriptor="l1b-map-of-uv-sources"
)[0]
suspected_transients_files = dependencies.get_processing_inputs(
descriptor="suspected-transients"
descriptor="l1b-suspected-transients"
)[0]
exclusions_by_instr_team_files = dependencies.get_processing_inputs(
descriptor="exclusions-by-instr-team"
descriptor="l1b-exclusions-by-instr-team"
)[0]
pipeline_settings = dependencies.get_processing_inputs(
descriptor="pipeline-settings"
Expand Down Expand Up @@ -758,10 +758,15 @@ def do_processing(
pipeline_settings_combiner = GlowsAncillaryCombiner(
pipeline_settings_input, day_buffer
)
calibration_input = dependencies.get_processing_inputs(
descriptor="l2-calibration"
)[0]
calibration_combiner = GlowsAncillaryCombiner(calibration_input, day_buffer)

datasets = glows_l2(
input_dataset,
pipeline_settings_combiner.combined_dataset,
calibration_combiner.combined_dataset,
)

return datasets
Expand Down
4 changes: 4 additions & 0 deletions imap_processing/glows/l2/glows_l2.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
def glows_l2(
input_dataset: xr.Dataset,
pipeline_settings_dataset: xr.Dataset,
calibration_dataset: xr.Dataset,
) -> list[xr.Dataset]:
"""
Will process GLOWS L2 data from L1 data.
Expand All @@ -37,6 +38,9 @@ def glows_l2(
pipeline_settings_dataset : xarray.Dataset
Dataset containing pipeline settings from
GlowsAncillaryCombiner.
calibration_dataset : xarray.Dataset
Dataset containing calibration data from
GlowsAncillaryCombiner.

Returns
-------
Expand Down
4 changes: 2 additions & 2 deletions imap_processing/tests/glows/test_glows_l2.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@ def test_glows_l2(
)

# Test case 1: L1B dataset has good times
l2 = glows_l2(l1b_hist_dataset, mock_pipeline_settings)[0]
l2 = glows_l2(l1b_hist_dataset, mock_pipeline_settings, None)[0]
assert l2.attrs["Logical_source"] == "imap_glows_l2_hist"
assert np.allclose(l2["filter_temperature_average"].values, [57.6], rtol=0.1)

# Test case 2: L1B dataset has no good times (all flags 0)
l1b_hist_dataset["flags"].values = np.zeros(l1b_hist_dataset.flags.shape)
caplog.set_level("WARNING")
result = glows_l2(l1b_hist_dataset, mock_pipeline_settings)
result = glows_l2(l1b_hist_dataset, mock_pipeline_settings, None)
assert result == []
assert any(record.levelname == "WARNING" for record in caplog.records)

Expand Down
Loading