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
5 changes: 3 additions & 2 deletions imap_processing/glows/l2/glows_l2_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ class HistogramL2:

number_of_good_l1b_inputs: int
total_l1b_inputs: int
identifier: int # TODO: Should be the official pointing number
identifier: int
start_time: np.double
end_time: np.double
daily_lightcurve: DailyLightcurve
Expand Down Expand Up @@ -391,7 +391,8 @@ def __init__(

self.total_l1b_inputs = len(l1b_dataset["epoch"])
self.number_of_good_l1b_inputs = len(good_data["epoch"])
self.identifier = -1 # TODO: retrieve from spin table
repointing = l1b_dataset.attrs.get("Repointing")
self.identifier = int(repointing.replace("repoint", ""))
# TODO fill this in
self.bad_time_flag_occurrences = np.zeros((1, FLAG_LENGTH))

Expand Down
3 changes: 3 additions & 0 deletions imap_processing/tests/glows/test_glows_l2.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,13 @@ def test_glows_l2(
mock_pipeline_settings,
mock_conversion_table_dict,
)
l1b_hist_dataset.attrs["Repointing"] = "repoint00047"

# Test case 1: L1B dataset has good times
l2 = glows_l2(l1b_hist_dataset, mock_pipeline_settings, mock_calibration_dataset)[0]
assert l2.attrs["Logical_source"] == "imap_glows_l2_hist"
assert np.allclose(l2["filter_temperature_average"].values, [57.6], rtol=0.1)
assert l2["identifier"].values[0] == 47
assert "flight_software_version" in l2.attrs
assert "pkts_file_name" in l2.attrs
assert "flight_software_version" not in l2.data_vars
Expand Down Expand Up @@ -130,6 +132,7 @@ def test_generate_l2(
mock_pipeline_settings,
mock_conversion_table_dict,
)
l1b_hist_dataset.attrs["Repointing"] = "repoint00047"
day = et_to_datetime64(ttj2000ns_to_et(l1b_hist_dataset["epoch"].data[0]))
pipeline_settings = PipelineSettings(
mock_pipeline_settings.sel(epoch=day, method="nearest")
Expand Down
1 change: 1 addition & 0 deletions imap_processing/tests/glows/test_glows_l2_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,7 @@ def l1b_dataset_full():
"imap_time_offset": (["epoch"], [60.0, 60.0]),
},
coords={"epoch": xr.DataArray(epoch, dims=["epoch"])},
attrs={"Repointing": "repoint00047"},
)


Expand Down
Loading