Skip to content

Commit

Permalink
style changes
Browse files Browse the repository at this point in the history
  • Loading branch information
clara-escanuela committed Sep 20, 2023
1 parent 0df1ba5 commit be9949d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ctapipe/image/cleaning.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,10 @@ def time_clustering(
d_scale=0.25,
):
"""
Clean an image by selecting pixels which pass a time clustering algorithm using DBSCAN.
Previously used for HESS [timecleaning]_.
Parameters
----------
geom: `ctapipe.instrument.CameraGeometry`
Expand Down Expand Up @@ -162,8 +164,7 @@ def time_clustering(

X = np.column_stack((time[precut_mask] / t_scale, pix_x, pix_y))

db = DBSCAN(eps=eps, min_samples=minpts).fit(X)
labels = db.labels_
labels = DBSCAN(eps=eps, min_samples=minpts).fit_predict(X)

# no_clusters = len(np.unique(labels))-1 # Could be used for gh separation

Expand Down Expand Up @@ -624,7 +625,7 @@ class TimeCleaner(ImageCleaner):
def __call__(
self, tel_id: int, image: np.ndarray, arrival_times=None
) -> np.ndarray:
"""Apply FACT-style image cleaning. see ImageCleaner.__call__()"""
"""Apply HESS image cleaning. see ImageCleaner.__call__()"""
return time_clustering(
geom=self.subarray.tel[tel_id].camera.geometry,
image=image,
Expand Down

0 comments on commit be9949d

Please sign in to comment.