Skip to content

Commit c10c49d

Browse files
committed
go on with next spectra in same file in case of bad format
1 parent eeb3479 commit c10c49d

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

stixcore/products/CAL/energy.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,11 @@ def from_level1(cls, l1product, parent="", idlprocessor=None, ecc_manager=None):
121121

122122
for spec_idx, spec in enumerate(l2.data["counts"]):
123123
if spec.shape != (32, 12, 1024):
124-
raise ValueError(f"Unexpected shape {spec.shape} for counts in {l1product.name}")
124+
logger.warning(f"Unexpected shape {spec.shape} for counts in {l1product.name}")
125+
# skip this spectrum and continue with the next one
126+
# this can happen if the tm is not fully transmitted
127+
# if more TM is coming in this spectrum will be completed and processed in the next iteration
128+
continue
125129

126130
data = l2.data[:][[spec_idx]]
127131
control_index = l2.data["control_index"][spec_idx]

0 commit comments

Comments
 (0)