diff --git a/tests/test_processor.py b/tests/test_processor.py index d7609895..35e8f014 100644 --- a/tests/test_processor.py +++ b/tests/test_processor.py @@ -15,6 +15,7 @@ import dask.dataframe as ddf import numpy as np import pytest +import xarray as xr from sed import SedProcessor from sed.core.config import parse_config @@ -479,8 +480,17 @@ def test_energy_calibration_workflow(energy_scale: str, calibration_method: str) bias_key="@KTOF:Lens:Sample:V", ) assert len(processor.ec.biases) == 2 - # load test data into class - processor.ec.load_data(biases=biases, traces=traces, tof=tof) + # load data as tuple + processor.load_bias_series(binned_data=(tof, biases, traces)) + assert processor.ec.traces.shape == traces.shape + assert len(processor.ec.biases) == processor.ec.traces.shape[0] + assert len(processor.ec.tof) == processor.ec.traces.shape[1] + # load data as xarray + bias_series = xr.DataArray(data=traces, coords={"sampleBias": biases, "t": tof}) + processor.load_bias_series(binned_data=bias_series) + assert processor.ec.traces.shape == traces.shape + assert len(processor.ec.biases) == processor.ec.traces.shape[0] + assert len(processor.ec.tof) == processor.ec.traces.shape[1] processor.ec.normalize() ref_id = 5 rng = (66100, 67000)