Skip to content

Commit

Permalink
Save more fields into isolated peaks
Browse files Browse the repository at this point in the history
  • Loading branch information
dachengx committed Apr 27, 2024
1 parent d0fa9b7 commit 302a26d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 18 deletions.
2 changes: 2 additions & 0 deletions axidence/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ def replication_tree(st, suffixes=["Paired", "Salted"], assign_attributes=None,
provides and data_kind as the plugins in original tree.
"""
if assign_attributes is None:
# this is due to some features are assigned in `infer_dtype` of the original plugins:
# https://github.com/XENONnT/straxen/blob/e555c7dcada2743d2ea627ea49df783e9dba40e3/straxen/plugins/events/event_basics.py#L69
assign_attributes = {"EventBasics": ["peak_properties", "posrec_save"]}

snakes = ["_" + strax.camel_to_snake(suffix) for suffix in suffixes]
Expand Down
4 changes: 2 additions & 2 deletions axidence/plugins/isolated/isolated_s1.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import straxen

from ...utils import needed_dtype, copy_dtype
from ...dtypes import positioned_peak_dtype
from ...dtypes import positioned_peak_dtype, correlation_fields


class IsolatedS1(Plugin):
Expand All @@ -24,7 +24,7 @@ class IsolatedS1(Plugin):
data_kind = "isolated_s1"

isolated_peaks_fields = straxen.URLConfig(
default=np.dtype(positioned_peak_dtype()).names,
default=list(np.dtype(positioned_peak_dtype()).names) + correlation_fields,
type=(list, tuple),
help="Needed fields in isolated peaks",
)
Expand Down
6 changes: 3 additions & 3 deletions axidence/plugins/isolated/isolated_s2.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import straxen

from ...utils import needed_dtype, copy_dtype
from ...dtypes import positioned_peak_dtype
from ...dtypes import positioned_peak_dtype, correlation_fields, event_level_fields


class IsolatedS2(Plugin):
Expand All @@ -29,13 +29,13 @@ class IsolatedS2(Plugin):
data_kind = "isolated_s2"

isolated_peaks_fields = straxen.URLConfig(
default=np.dtype(positioned_peak_dtype()).names,
default=list(np.dtype(positioned_peak_dtype()).names) + correlation_fields,
type=(list, tuple),
help="Needed fields in isolated peaks",
)

isolated_events_fields = straxen.URLConfig(
default=[],
default=event_level_fields,
type=(list, tuple),
help="Needed fields in isolated events",
)
Expand Down
14 changes: 1 addition & 13 deletions axidence/plugins/pairing/peaks_paired.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from straxen import PeakProximity

from ...utils import copy_dtype
from ...dtypes import peak_positions_dtype, positioned_peak_dtype
from ...dtypes import peak_positions_dtype
from ...plugin import ExhaustPlugin, RunMetaPlugin


Expand All @@ -25,18 +25,6 @@ class PeaksPaired(ExhaustPlugin, RunMetaPlugin):
help="Seed for pairing",
)

isolated_peaks_fields = straxen.URLConfig(
default=np.dtype(positioned_peak_dtype()).names,
type=(list, tuple),
help="Needed fields in isolated peaks",
)

isolated_events_fields = straxen.URLConfig(
default=[],
type=(list, tuple),
help="Needed fields in isolated events",
)

real_run_start = straxen.URLConfig(
default=None,
type=(int, None),
Expand Down

0 comments on commit 302a26d

Please sign in to comment.