Coverage for src/susi/utils/header_checks.py: 100%
9 statements
« prev ^ index » next coverage.py v7.5.0, created at 2025-08-22 09:20 +0000
« prev ^ index » next coverage.py v7.5.0, created at 2025-08-22 09:20 +0000
2from ..io import FitsBatch
3from ..base import IllegalStateException, Logging
4from ..base.header_keys import SPATIAL_BIN
6log = Logging.get_logger()
9def check_same_binning(batch: FitsBatch) -> None:
10 bins = set([e['header'][SPATIAL_BIN] if SPATIAL_BIN in e['header'] else None for e in batch.batch])
11 if len(bins) > 1:
12 log.critical("Different spacial binning applied to the frames loaded. Cannot continue. \n%s", bins)
13 raise IllegalStateException('Data was spatially binned differently, see log for details')