Skip to content

Commit

Permalink
hard cut on pe
Browse files Browse the repository at this point in the history
  • Loading branch information
clara-escanuela committed Sep 30, 2023
1 parent ee225d1 commit 0db4a31
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 20 deletions.
20 changes: 2 additions & 18 deletions ctapipe/image/cleaning.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,11 @@ def time_clustering(
geom,
image,
time,
noise=1.6,
minimum_signal_sigma=2.5,
minpts=5,
eps=1.0,
time_scale_ns=4.0,
space_scale_m=0.25,
hard_cut_pe=0,
hard_cut_pe=4,
):
"""
Expand All @@ -147,10 +145,6 @@ def time_clustering(
pixel charge information
time: array
pixel timing information
noise: array
Noise fluctuations for each pixel. This is just one number for now.
minimum_signal_sigma: float
Cut in the minimum significance of the signal
hard_cut_pe: float
Hard cut in the number of signal pe
minpts: int
Expand All @@ -166,7 +160,7 @@ def time_clustering(
-------
A boolean mask of *clean* pixels.
"""
precut_mask = (image > minimum_signal_sigma * noise) & (image > hard_cut_pe)
precut_mask = image > hard_cut_pe

arr = np.zeros(len(image), dtype=float)
arr[~precut_mask] = -1
Expand Down Expand Up @@ -613,11 +607,6 @@ class TimeCleaner(ImageCleaner):
Clean images using the time clustering cleaning method
"""

noise = FloatTelescopeParameter(
default_value=1.6, help="Noise width of each pixel"
).tag(
config=True
) # we should get this from a container once available
space_scale_m = FloatTelescopeParameter(
default_value=0.25, help="Pixel space scaling parameter in m"
).tag(config=True)
Expand All @@ -630,9 +619,6 @@ class TimeCleaner(ImageCleaner):
eps = FloatTelescopeParameter(
default_value=1.0, help="minimum distance in DBSCAN"
).tag(config=True)
minimum_signal_sigma = FloatTelescopeParameter(
default_value=2.5, help="Significance cut in the image"
).tag(config=True)
hard_cut_pe = FloatTelescopeParameter(
default_value=2.5, help="Hard cut in the number of pe"
).tag(config=True)
Expand All @@ -646,10 +632,8 @@ def __call__(
image=image,
time=arrival_times,
eps=self.eps.tel[tel_id],
minimum_signal_sigma=self.minimum_signal_sigma.tel[tel_id],
space_scale_m=self.space_scale_m.tel[tel_id],
time_scale_ns=self.time_scale_ns.tel[tel_id],
noise=self.noise.tel[tel_id],
minpts=self.minpts.tel[tel_id],
hard_cut_pe=self.hard_cut_pe.tel[tel_id],
)
Expand Down
3 changes: 1 addition & 2 deletions ctapipe/image/tests/test_cleaning.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,7 @@ def test_time_cleaning():
eps=1.0,
space_scale_m=0.25,
time_scale_ns=4.0,
minimum_signal_sigma=10,
noise=1,
hard_cut_pe=10,
minpts=5,
)

Expand Down

0 comments on commit 0db4a31

Please sign in to comment.