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

State-of-the-art of timeslides development in pycbc_multi_inspiral #4177

Merged
merged 6 commits into from
Jan 3, 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
Update to comments
Removed whitespace and made small edits to comments.
  • Loading branch information
ETVincent committed Dec 16, 2022
commit 4adca73e2a58a55793437db5cb7ee4e157286195
30 changes: 13 additions & 17 deletions pycbc/events/eventmgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -616,23 +616,19 @@ def cluster_template_network_events(self, tcolumn, column, window_size,
""" Cluster the internal events over the named column
Parameters
----------------
self

tcolumn

column

window_size
The size of the window
slide
tcolumn
Indicates which column contains the time.
column
The named column to cluster.
window_size
The size of the window.
slide
Default is 0.

"""
slide_indices = (self.template_event_dict['network']['slide_id'] == slide)
cvec = self.template_event_dict['network'][column][slide_indices]
tvec = self.template_event_dict['network'][tcolumn][slide_indices]
if not window_size == 0:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function could definitely do with some comments ... We don't want to rewrite the code and end up with something as opaque as coh_PTF is :-)

slide_indices = (
self.template_event_dict['network']['slide_id'] == slide)
cvec = self.template_event_dict['network'][column][slide_indices]
tvec = self.template_event_dict['network'][tcolumn][slide_indices]
# cluster events over the window
indices = findchirp_cluster_over_window(tvec, cvec, window_size)
# if a slide_indices = 0
Expand All @@ -641,12 +637,12 @@ def cluster_template_network_events(self, tcolumn, column, window_size,
numpy.flatnonzero(~slide_indices),
numpy.flatnonzero(slide_indices)[indices]))
indices.sort()
#
# get value of key for where you have indicies
for key in self.template_event_dict:
self.template_event_dict[key] = \
self.template_event_dict[key][indices]
# FIXME: else...?
# Previously, if window_size == 0: indices = numpy.arange(len(tvec))
else:
indices = numpy.arange(len(tvec))

def add_template_network_events(self, columns, vectors):
""" Add a vector indexed """
Expand Down