From 6fbf67664a9453cc9bfab1af1504b703e51c8a46 Mon Sep 17 00:00:00 2001 From: Maximilian Linhoff Date: Wed, 31 May 2023 16:13:48 +0200 Subject: [PATCH 1/3] Fix return value of NullDataVolumeReducer --- ctapipe/image/reducer.py | 4 ++-- docs/changes/2340.bug.rst | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 docs/changes/2340.bug.rst diff --git a/ctapipe/image/reducer.py b/ctapipe/image/reducer.py index f7e63734d53..30ad1eda574 100644 --- a/ctapipe/image/reducer.py +++ b/ctapipe/image/reducer.py @@ -99,8 +99,8 @@ class NullDataVolumeReducer(DataVolumeReducer): """ def select_pixels(self, waveforms, tel_id=None, selected_gain_channel=None): - mask = waveforms != 0 - return mask + n_pixels = waveforms.shape[-2] + return np.ones(n_pixels, dtype=bool) class TailCutsDataVolumeReducer(DataVolumeReducer): diff --git a/docs/changes/2340.bug.rst b/docs/changes/2340.bug.rst new file mode 100644 index 00000000000..2b37cbba9d6 --- /dev/null +++ b/docs/changes/2340.bug.rst @@ -0,0 +1 @@ +Fix shape of mask returned by ``NullDataVolumeReducer``. From cbfad66b3a50c4044f524196039892068988265a Mon Sep 17 00:00:00 2001 From: Maximilian Linhoff Date: Wed, 31 May 2023 16:24:27 +0200 Subject: [PATCH 2/3] Fix name of changelog files --- docs/changes/{2337.bug.rst => 2337.bugfix.rst} | 0 docs/changes/{2340.bug.rst => 2340.bugfix.rst} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename docs/changes/{2337.bug.rst => 2337.bugfix.rst} (100%) rename docs/changes/{2340.bug.rst => 2340.bugfix.rst} (100%) diff --git a/docs/changes/2337.bug.rst b/docs/changes/2337.bugfix.rst similarity index 100% rename from docs/changes/2337.bug.rst rename to docs/changes/2337.bugfix.rst diff --git a/docs/changes/2340.bug.rst b/docs/changes/2340.bugfix.rst similarity index 100% rename from docs/changes/2340.bug.rst rename to docs/changes/2340.bugfix.rst From b33e4a77bea1d26657a41bcb1a85eabc743ca7c7 Mon Sep 17 00:00:00 2001 From: Maximilian Linhoff Date: Wed, 31 May 2023 16:47:37 +0200 Subject: [PATCH 3/3] Fix hdf5 five unit test for astropy 5.3 --- ctapipe/io/tests/test_hdf5.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ctapipe/io/tests/test_hdf5.py b/ctapipe/io/tests/test_hdf5.py index 1ffa6c97750..75f8a19b206 100644 --- a/ctapipe/io/tests/test_hdf5.py +++ b/ctapipe/io/tests/test_hdf5.py @@ -312,7 +312,8 @@ class WithUnits(Container): with tables.open_file(path, "r") as f: assert f.root.data.units.attrs["CTAFIELD_0_UNIT"] == "m**-1" assert f.root.data.units.attrs["CTAFIELD_1_UNIT"] == "s" - assert f.root.data.units.attrs["CTAFIELD_2_UNIT"] == "cm**-2.g" + # order of the units does not matter + assert f.root.data.units.attrs["CTAFIELD_2_UNIT"] in {"cm**-2.g", "g.cm**-2"} def test_write_containers(tmp_path):