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/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): 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.bugfix.rst b/docs/changes/2340.bugfix.rst new file mode 100644 index 00000000000..2b37cbba9d6 --- /dev/null +++ b/docs/changes/2340.bugfix.rst @@ -0,0 +1 @@ +Fix shape of mask returned by ``NullDataVolumeReducer``.