Skip to content

Commit

Permalink
Add PairingExists
Browse files Browse the repository at this point in the history
  • Loading branch information
dachengx committed Apr 27, 2024
1 parent 3f9a319 commit 1214b9c
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
2 changes: 2 additions & 0 deletions axidence/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
PeakProximityPaired,
PeakPositionsPaired,
EventInfosPaired,
PairingExists,
)

export, __all__ = strax.exporter()
Expand Down Expand Up @@ -172,6 +173,7 @@ def _pair_to_context(self):
PeakProximityPaired,
PeakPositionsPaired,
EventInfosPaired,
PairingExists,
)
)

Expand Down
3 changes: 3 additions & 0 deletions axidence/plugins/cuts/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@

from . import cut_isolated_s2
from .cut_isolated_s2 import *

from . import cut_pairing_exists
from .cut_pairing_exists import *
18 changes: 18 additions & 0 deletions axidence/plugins/cuts/cut_pairing_exists.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import numpy as np
from strax import CutPlugin


class PairingExists(CutPlugin):
"""Cut of successfully paired AC with AC-type(`event_type`)"""

__version__ = "0.0.0"
depends_on = "event_infos_paired"
provides = "cut_pairing_exists"
cut_name = "cut_pairing_exists"
data_kind = "event_paired"
cut_description = (
"Whether isolated S2 influenced by pairing, and whether the event is considered as AC event"
)

def cut_by(self, events_paired):
return np.isin(events_paired["event_type"], [1, 3])

0 comments on commit 1214b9c

Please sign in to comment.