Skip to content

Commit

Permalink
Switching to MonitoringCameraContainer
Browse files Browse the repository at this point in the history
  • Loading branch information
Hckjs committed Mar 12, 2024
1 parent 4317c30 commit 8a05e27
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions docs/changes/2511.api.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Adding event as keyword argument to the ``ImageCleaner`` API
so cleaning algorithms can now access relevant information for methods
that e.g. require monitoring information.
Adding monitoring: MonitoringCameraContainer as keyword argument to
the ``ImageCleaner`` API so cleaning algorithms can now access
relevant information for methods that e.g. require monitoring information.
18 changes: 9 additions & 9 deletions src/ctapipe/image/cleaning.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

import numpy as np

from ctapipe.containers import ArrayEventContainer
from ctapipe.containers import MonitoringCameraContainer

from ..core import TelescopeComponent
from ..core.traits import (
Expand Down Expand Up @@ -473,7 +473,7 @@ def __call__(
image: np.ndarray,
arrival_times: np.ndarray = None,
*,
event: ArrayEventContainer = None,
monitoring: MonitoringCameraContainer = None,
) -> np.ndarray:
"""
Identify pixels with signal, and reject those with pure noise.
Expand All @@ -487,9 +487,9 @@ def __call__(
image pixel data corresponding to the camera geometry
arrival_times: np.ndarray
image of arrival time (not used in this method)
event: `ctapipe.containers.ArrayEventContainer`
ArrayEventContainer to make use of additional parameters
e.g. monitoring data.
monitoring: `ctapipe.containers.MonitoringCameraContainer`
MonitoringCameraContainer to make use of additional parameters
from monitoring data e.g. pedestal std.
Returns
-------
Expand Down Expand Up @@ -529,7 +529,7 @@ def __call__(
image: np.ndarray,
arrival_times: np.ndarray = None,
*,
event: ArrayEventContainer = None,
monitoring: MonitoringCameraContainer = None,
) -> np.ndarray:
"""
Apply standard picture-boundary cleaning. See `ImageCleaner.__call__()`
Expand All @@ -556,7 +556,7 @@ def __call__(
image: np.ndarray,
arrival_times: np.ndarray = None,
*,
event: ArrayEventContainer = None,
monitoring: MonitoringCameraContainer = None,
) -> np.ndarray:
"""
Apply MARS-style image cleaning. See `ImageCleaner.__call__()`
Expand Down Expand Up @@ -588,7 +588,7 @@ def __call__(
image: np.ndarray,
arrival_times: np.ndarray = None,
*,
event: ArrayEventContainer = None,
monitoring: MonitoringCameraContainer = None,
) -> np.ndarray:
"""Apply FACT-style image cleaning. see ImageCleaner.__call__()"""

Expand Down Expand Up @@ -623,7 +623,7 @@ def __call__(
image: np.ndarray,
arrival_times: np.ndarray = None,
*,
event: ArrayEventContainer = None,
monitoring: MonitoringCameraContainer = None,
) -> np.ndarray:
"""
Apply MAGIC-like image cleaning with timing information. See `ImageCleaner.__call__()`
Expand Down
2 changes: 1 addition & 1 deletion src/ctapipe/image/image_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def _process_telescope_event(self, event):
tel_id=tel_id,
image=dl1_camera.image,
arrival_times=dl1_camera.peak_time,
event=event,
monitoring=event.mon.tel[tel_id],
)

dl1_camera.parameters = self._parameterize_image(
Expand Down

0 comments on commit 8a05e27

Please sign in to comment.