Skip to content

Commit 958b970

Browse files
committed
fix soop startup and add check for elut same at the end
1 parent a23eb33 commit 958b970

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

stixcore/products/CAL/energy.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,12 @@ def from_level1(cls, l1product, parent="", idlprocessor=None):
112112

113113
date = l2.utc_timerange.start.datetime
114114
ob_elut, sci_channels = ELUTManager.instance.get_elut(date)
115+
ob_elut_end, sci_channels = ELUTManager.instance.get_elut(l2.utc_timerange.end.datetime)
116+
# ensure that the same ELUT is used for the whole time range
117+
if ob_elut.file != ob_elut_end.file:
118+
raise ValueError(
119+
f"ELUT change within energy calibration data time range: {ob_elut.file} to {ob_elut_end.file}"
120+
)
115121

116122
for spec_idx, spec in enumerate(l2.data["counts"]):
117123
if spec.shape != (32, 12, 1024):

stixcore/soop/manager.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,8 @@ def add_soop_file_to_index(self, path, *, rebuild_index=True, **args):
529529
all_soop_file = Path(CONFIG.get("SOOP", "soop_files_download")) / f"{plan}.{version}.all.json"
530530

531531
if not all_soop_file.exists():
532+
# TODO reactivate when API is back
533+
return
532534
self.download_all_soops_from_api(plan, version, all_soop_file)
533535

534536
with open(all_soop_file) as f_all:

0 commit comments

Comments
 (0)