Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix return value of NullDataVolumeReducer #2340

Merged
merged 3 commits into from
Jun 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ctapipe/image/reducer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
3 changes: 2 additions & 1 deletion ctapipe/io/tests/test_hdf5.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions docs/changes/2340.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix shape of mask returned by ``NullDataVolumeReducer``.