Skip to content
Snippets Groups Projects

Revised CalCat API

Merged Thomas Kluyver requested to merge calcat-api-2 into master
Compare and Show latest version
1 file
+ 20
4
Compare changes
  • Side-by-side
  • Inline
@@ -4,6 +4,7 @@ from cal_tools.calcat_interface2 import (
CalibrationData,
AGIPDConditions,
DSSCConditions,
LPDConditions,
SingleConstantVersion,
)
@@ -67,11 +68,26 @@ def test_DSSC_modules_missing():
)
# DSSC was used with only 3 quadrants at this point
modnos = list(range(4)) + list(range(8, 16))
assert dssc_cd.aggregator_names == ['DSSC{m:02}' for m in modnos]
assert dssc_cd.aggregator_names == [f"DSSC{m:02}" for m in modnos]
assert dssc_cd.module_nums == modnos
assert dssc_cd.qm_names == [
f"Q{(m // 4) + 1}M{(m % 4) + 1}" for m in modnos
]
assert dssc_cd.qm_names == [f"Q{(m // 4) + 1}M{(m % 4) + 1}" for m in modnos]
@pytest.mark.requires_gpfs
def test_LPD_constant_missing():
lpd_cd = CalibrationData.from_condition(
LPDConditions(memory_cells=200, sensor_bias_voltage=250),
"FXE_DET_LPD1M-1",
event_at="2022-05-22T02:00:00",
)
# Constants are missing for 1 module (LPD05), but it was still included in
# the PDUs for the detector, so it should still appear in the lists.
assert lpd_cd.aggregator_names == [f"LPD{m:02}" for m in range(16)]
assert lpd_cd.module_nums == list(range(16))
assert lpd_cd.qm_names == [f"Q{(m // 4) + 1}M{(m % 4) + 1}" for m in range(16)]
assert len(lpd_cd["Offset"].module_nums) == 16
assert len(lpd_cd["Offset"].constants) == 15
@pytest.mark.xfail
Loading