Skip to content

Commit

Permalink
Support event time window in watcher (#144)
Browse files Browse the repository at this point in the history
* event range

* debug

* debug
  • Loading branch information
FaroutYLq authored Jun 21, 2024
1 parent 92a9f98 commit bc534d7
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions saltax/match/visual.py
Original file line number Diff line number Diff line change
@@ -66,6 +66,14 @@ def plot_event_wf(
int((events_salt["s2_time"][ind] - extended_simu_event_timerange_ns[0]) / 10),
int((events_salt["s2_endtime"][ind] - extended_simu_event_timerange_ns[0]) / 10),
)
simu_event_timerange_i = (
int((events_simu["time"][ind] - extended_simu_event_timerange_ns[0]) / 10),
int((events_simu["endtime"][ind] - extended_simu_event_timerange_ns[0]) / 10),
)
salt_event_timerange_i = (
int((events_salt["time"][ind] - extended_simu_event_timerange_ns[0]) / 10),
int((events_salt["endtime"][ind] - extended_simu_event_timerange_ns[0]) / 10),
)

# Get peaks and lone hits for the event
# Make sure the data is stored before loading
@@ -201,6 +209,13 @@ def plot_event_wf(
alpha=0.2,
label="Simulated S2 Range",
)
ax1.axvspan(
simu_event_timerange_i[0],
simu_event_timerange_i[1],
color="tab:brown",
alpha=0.2,
label="Simulated Event",
)
if events_salt is not None:
ax1.axvspan(
matched_salt_s1_timerange_i[0],
@@ -216,6 +231,13 @@ def plot_event_wf(
alpha=0.2,
label="Sprinkled S2 Range",
)
ax1.axvspan(
salt_event_timerange_i[0],
salt_event_timerange_i[1],
color="grey",
alpha=0.1,
label="Matched Sprinkled Event",
)
ax1.legend()
if events_salt is not None:
ax1.set_title(
@@ -259,6 +281,13 @@ def plot_event_wf(
alpha=0.2,
label="Simulated S2 Range",
)
ax2.axvspan(
simu_event_timerange_i[0],
simu_event_timerange_i[1],
color="tab:brown",
alpha=0.2,
label="Simulated Event",
)
if events_salt is not None:
ax2.axvspan(
matched_salt_s1_timerange_i[0],
@@ -274,6 +303,13 @@ def plot_event_wf(
alpha=0.2,
label="Sprinkled S2 Range",
)
ax2.axvspan(
salt_event_timerange_i[0],
salt_event_timerange_i[1],
color="grey",
alpha=0.1,
label="Matched Sprinkled Event",
)
ax2.legend()
ax2.set_ylim(ylim)
# Set labels for full event waveform plot

0 comments on commit bc534d7

Please sign in to comment.