Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update coincident event search using large shower events #143

Merged
merged 13 commits into from
Jun 25, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
apply MAGIC time window cut to find coincident events efficiently
  • Loading branch information
SeiyaNozaki committed May 20, 2023
commit 2f2a630644f53428664d4b50865077a1e5959544
21 changes: 15 additions & 6 deletions magicctapipe/scripts/lst1_magic/lst1_magic_event_coincidence.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,18 +267,27 @@ def event_coincidence(input_file_lst, input_dir_magic, output_dir, config):
# of coincident events within a defined window after shifting all possible
# combination (N x N) of time offsets.
elif search_method == "all_combination":
mask_large_intensity_lst = np.argsort(event_data_lst["intensity"])[::-1][
index_large_intensity_magic = np.argsort(df_magic["intensity"])[::-1][
:n_search_coincident_events
]

mask_large_intensity_magic = np.argsort(df_magic["intensity"])[::-1][
:n_search_coincident_events
]
# If LST/MAGIC observations are not completely overlapped, only small
# numbers of MAGIC events are left for the coincidence search.
# To find large-intensity showers within the same time window,
# time cut between MAGIC observations is applied to the LST data set.
cond_lolim = timestamps_lst >= timestamps_magic[0]
cond_uplim = timestamps_lst <= timestamps_magic[-1]
mask_magic_obs_window = np.logical_and(cond_lolim, cond_uplim)

index_large_intensity_lst = np.argsort(
event_data_lst["intensity"][mask_magic_obs_window]
)[::-1][:n_search_coincident_events]

# crate an array of all combinations of (MAGIC timestamp, LST timestamp)
timestamps_magic_lst_combination = np.array(
np.meshgrid(
timestamps_magic[mask_large_intensity_magic].value,
timestamps_lst[mask_large_intensity_lst],
timestamps_magic[index_large_intensity_magic].value,
timestamps_lst[mask_magic_obs_window][index_large_intensity_lst],
)
).reshape(2, -1)

Expand Down