diff --git a/src/ctapipe/io/interpolation.py b/src/ctapipe/io/interpolation.py index b68adbf6bf4..5870e71a91b 100644 --- a/src/ctapipe/io/interpolation.py +++ b/src/ctapipe/io/interpolation.py @@ -11,6 +11,8 @@ from .astropy_helpers import read_table +dimensionless_unit = u.Unit() + class StepFunction: @@ -236,6 +238,8 @@ class FlatFieldInterpolator(Interpolator): """ telescope_data_group = "dl1/calibration/gain" # TBD + required_columns = frozenset(["time", "gain"]) # TBD + expected_units = {"gain": dimensionless_unit} def __call__(self, tel_id, time): """ @@ -273,8 +277,6 @@ def add_table(self, tel_id, input_table): for the flatfield data """ - self.required_columns = frozenset(["time", "gain"]) # TBD - self._check_tables(input_table) input_table.sort("time") @@ -292,6 +294,8 @@ class PedestalInterpolator(Interpolator): """ telescope_data_group = "dl1/calibration/pedestal" # TBD + required_columns = frozenset(["time", "pedestal"]) # TBD + expected_units = {"pedestal": dimensionless_unit} def __call__(self, tel_id, time): """ @@ -329,8 +333,6 @@ def add_table(self, tel_id, input_table): for the pedestal data """ - self.required_columns = frozenset(["time", "pedestal"]) # TBD - self._check_tables(input_table) input_table.sort("time") diff --git a/src/ctapipe/io/tests/test_interpolator.py b/src/ctapipe/io/tests/test_interpolator.py index 4d41ceeff0b..930e1e7d73c 100644 --- a/src/ctapipe/io/tests/test_interpolator.py +++ b/src/ctapipe/io/tests/test_interpolator.py @@ -104,14 +104,16 @@ def test_bounds(): table_pedestal = Table( { "time": np.arange(0.0, 10.1, 2.0), - "pedestal": np.reshape(np.random.normal(4.0, 1.0, 1850 * 6), (6, 1850)), + "pedestal": np.reshape(np.random.normal(4.0, 1.0, 1850 * 6), (6, 1850)) + * u.Unit(), }, ) table_flatfield = Table( { "time": np.arange(0.0, 10.1, 2.0), - "gain": np.reshape(np.random.normal(1.0, 1.0, 1850 * 6), (6, 1850)), + "gain": np.reshape(np.random.normal(1.0, 1.0, 1850 * 6), (6, 1850)) + * u.Unit(), }, )