diff --git a/pyproject.toml b/pyproject.toml index eaed25b..b64f60c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,11 +17,11 @@ authors = [ ] dynamic = ["version"] -requires-python = ">=3.9" +requires-python = ">=3.10" dependencies = [ "numpy", - "protozfits~=2.4", - "ctapipe~=0.20.0", + "protozfits~=2.6", + "ctapipe~=0.23.0", ] [project.optional-dependencies] diff --git a/src/ctapipe_io_zfits/dl0.py b/src/ctapipe_io_zfits/dl0.py index 639cafd..97ee745 100644 --- a/src/ctapipe_io_zfits/dl0.py +++ b/src/ctapipe_io_zfits/dl0.py @@ -102,12 +102,8 @@ def _fill_dl0_container( n_pixels_nominal = camera_geometry.n_pixels # fill not readout pixels with 0, reorder pixels, use 2d array when gain reduced - if n_channels == 2: - waveform = np.zeros((n_channels, n_pixels_nominal, n_samples), dtype=np.float32) - waveform[:, camera_config.pixel_id_map[pixel_stored]] = zfits_waveform - else: - waveform = np.zeros((n_pixels_nominal, n_samples), dtype=np.float32) - waveform[camera_config.pixel_id_map[pixel_stored]] = zfits_waveform[0] + waveform = np.zeros((n_channels, n_pixels_nominal, n_samples), dtype=np.float32) + waveform[:, camera_config.pixel_id_map[pixel_stored]] = zfits_waveform if ignore_samples_start != 0 or ignore_samples_end != 0: start = ignore_samples_start diff --git a/src/ctapipe_io_zfits/tests/test_dl0.py b/src/ctapipe_io_zfits/tests/test_dl0.py index ca3d984..e83c169 100644 --- a/src/ctapipe_io_zfits/tests/test_dl0.py +++ b/src/ctapipe_io_zfits/tests/test_dl0.py @@ -1,6 +1,5 @@ import astropy.units as u import numpy as np -import pytest from astropy.time import Time from ctapipe.core.tool import run_tool from ctapipe.instrument import SubarrayDescription @@ -53,18 +52,17 @@ def test_subarray_events(dummy_dl0): def test_process(dummy_dl0, tmp_path): path = tmp_path / "dummy.dl1.h5" - with pytest.warns(UserWarning, match="Encountered an event with no R1 data"): - run_tool( - ProcessorTool(), - [ - f"--input={dummy_dl0}", - f"--output={path}", - "--write-images", - "--write-parameters", - "--EventTypeFilter.allowed_types=SUBARRAY", - ], - raises=True, - ) + run_tool( + ProcessorTool(), + [ + f"--input={dummy_dl0}", + f"--output={path}", + "--write-images", + "--write-parameters", + "--EventTypeFilter.allowed_types=SUBARRAY", + ], + raises=True, + ) def test_telescope_event_source(dummy_tel_file): @@ -83,18 +81,17 @@ def test_telescope_event_source(dummy_tel_file): def test_process_tel_events(dummy_tel_file, tmp_path): path = tmp_path / "dummy.dl1.h5" - with pytest.warns(UserWarning, match="Encountered an event with no R1 data"): - run_tool( - ProcessorTool(), - [ - f"--input={dummy_tel_file}", - f"--output={path}", - "--write-images", - "--write-parameters", - "--MultiFiles.all_chunks=True", - ], - raises=True, - ) + run_tool( + ProcessorTool(), + [ + f"--input={dummy_tel_file}", + f"--output={path}", + "--write-images", + "--write-parameters", + "--MultiFiles.all_chunks=True", + ], + raises=True, + ) with TableLoader(path) as loader: events = loader.read_telescope_events()