Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
a9f83b9
cluster and threshold first commit, see restrictions list within code
ahnitz Feb 20, 2015
edab7cc
first commit of cuda point chisq, note: result it wrong
ahnitz Feb 22, 2015
b6c168e
fix sign error in cuda point chisq, now gives sane results
ahnitz Feb 22, 2015
174e12d
stub for batch suppport
ahnitz Feb 25, 2015
abbba33
try yielding scheduler for GPU kernels
ahnitz Feb 26, 2015
dcd5c3f
fix bug in point chisq, where more than one point writes to overlappi…
ahnitz Feb 26, 2015
ea8d75f
use preapred fucntionc all for threshold kernels
ahnitz Feb 26, 2015
6e8dc85
use prepared kernel call for cuda point chisq
ahnitz Feb 26, 2015
7418bf4
move fft correlate directly into method of matched_filter_control
ahnitz Mar 3, 2015
5d98e22
add callback module for testing, currently a noop (copy input to outp…
ahnitz Mar 3, 2015
ac0b168
Add SIMD threshold-and-cluster (for CPU)
josh-willis Mar 4, 2015
0400e6a
Fix small bugs in events.simd_threshold.ThreshClusterObject
josh-willis Mar 4, 2015
09d0bdb
Add cpu version of schemed function threshold_and_cluster
josh-willis Mar 4, 2015
7d5a347
First version of SIMD correlate
josh-willis Mar 5, 2015
72637b3
Bugfixes to correlate_simd()
josh-willis Mar 5, 2015
d763177
Add SIMD and parallel correlate to CPU matched filter
josh-willis Mar 5, 2015
994ce3f
fix namespace missing
ahnitz Mar 5, 2015
c43d1a6
Add missing OMP compilation to simd correlate
josh-willis Mar 5, 2015
dfd1fca
delay concatentation of events untill after processing all templates
ahnitz Mar 10, 2015
23567b5
expose callbacks through pycbc inspiral command line switch
ahnitz Mar 11, 2015
325f573
add example output callback settings
ahnitz Mar 12, 2015
fabd540
Add class-based correlation
josh-willis Mar 19, 2015
5053b61
Add class-based threshold and clustering
josh-willis Mar 19, 2015
5ed1332
Bugfixes; add class-based correlate, filter to inspiral
josh-willis Mar 20, 2015
55f7175
Fix wrong class inheritance in ThresholdCluster
josh-willis Mar 20, 2015
fa6513b
Fix wrong class inheritance in _BaseThresholdCluster
josh-willis Mar 20, 2015
323bfd0
Various bugfixes
josh-willis Mar 20, 2015
74d44dd
Add commented out SSE/no SIMD compilations for corr & thresh
josh-willis Mar 20, 2015
688085f
Add top-level infrastructure for class-based FFT
josh-willis Mar 23, 2015
f41abbb
Update cpu schemed file to work with class-based FFT
josh-willis Mar 23, 2015
7f59945
Add class-based FFTW interface
josh-willis Mar 23, 2015
6d8dacf
Add class-based MKL API
josh-willis Mar 23, 2015
1ac1306
Add scaled threshold to correct for unnormalized class IFFT
josh-willis Mar 23, 2015
79bc4dd
Cause class-based FFTW to use temp mem when planning
josh-willis Mar 23, 2015
1439cba
Modify FFT, MatchedFilterControl to use ifft.scale
josh-willis Mar 23, 2015
e829662
Majore reworking to allow class-based system to function
josh-willis Mar 23, 2015
5560703
Remove unneeded files
josh-willis Mar 23, 2015
15f61fe
Major rework to try and solve circular references
josh-willis Mar 23, 2015
38fa9f6
Remove debugging statement
josh-willis Mar 23, 2015
0870a57
Fix missing scale argument
josh-willis Mar 23, 2015
65576a4
Remove debugging comments
josh-willis Mar 23, 2015
8057277
Fix a few mkl bugs
josh-willis Mar 23, 2015
a9a547d
Fix insufficient attempt to comment out template length clustering
josh-willis Mar 23, 2015
96a736b
Fix missing 'self.' identifier in MatchedFilterControl initialization
josh-willis Mar 24, 2015
b250e8e
Fix missing 'k' in 'kmax'
josh-willis Mar 24, 2015
7aba0d7
Fix another missing self
josh-willis Mar 24, 2015
1082599
Remove unneeded scale capability
josh-willis Mar 24, 2015
4229343
Fix broken stilde.delta_f reference
josh-willis Mar 24, 2015
4cb1266
Eliminate loop unrolling in SSE threshold (not enough registers)
josh-willis Apr 27, 2015
6d05431
Add new 'opt' module for optimization related definitions
josh-willis Apr 28, 2015
c86cd25
Update correlate to use new opt module
josh-willis Apr 29, 2015
9110654
Modify threshold/cluster to use new opt module
josh-willis Apr 29, 2015
ed39a02
Added import for log
lppekows May 12, 2015
3b3dab3
Pass segment[0].psd instead of psd module
lppekows May 12, 2015
384cf50
Copied fastest_power_chisq_at_points from current master
lppekows May 12, 2015
144ef1b
Replace reference to all_events with events, do append as in current
lppekows May 13, 2015
964e3b5
Replace call to finalize_events with finalize_template_events
lppekows May 13, 2015
194dd30
Fix off-by-one error when building output arrays
lppekows May 29, 2015
f7ba979
Pass the right psd to matched_filter_and_cluster
lppekows Jun 1, 2015
78eb0e1
Clarify logic of clustered thresholding in comments
josh-willis Jun 8, 2015
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
31 changes: 20 additions & 11 deletions bin/pycbc_inspiral
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ parser.add_argument("--user-tag", type=str, metavar="TAG", help="""
This is used to identify FULL_DATA jobs for
compatibility with pipedown post-processing.
Option will be removed when no longer needed.""")
parser.add_argument("--psd-recalculate-segments", type=int, help="Number of segments to use before recalculating the PSD", default=0)
parser.add_argument("--psd-recalculate-segments", type=int,
help="Number of segments to use before recalculating the PSD", default=0)
parser.add_argument("--gpu-callback-method", default='none')

# Add options groups
psd.insert_psd_option_group(parser)
Expand Down Expand Up @@ -185,11 +187,16 @@ with ctx:
associate_psd(strain_segments, gwstrain, segments,
opt.psd_recalculate_segments, flen, delta_f, flow)

template_mem = zeros(tlen, dtype = complex64)
cluster_window = int(opt.cluster_window * gwstrain.sample_rate)

matched_filter = MatchedFilterControl(opt.low_frequency_cutoff, None,
opt.snr_threshold, tlen, delta_f, complex64,
segments, template_mem, cluster_window,
downsample_factor=opt.downsample_factor,
upsample_threshold=opt.upsample_threshold,
upsample_method=opt.upsample_method)
upsample_method=opt.upsample_method,
gpu_callback_method=opt.gpu_callback_method)

bank_chisq = vetoes.SingleDetBankVeto(opt.bank_veto_bank_file,
flen, delta_f, flow, complex64,
Expand Down Expand Up @@ -233,24 +240,25 @@ with ctx:

logging.info("Read in template bank")
bank = waveform.FilterBank(opt.bank_file, flen, delta_f,
flow, dtype=complex64, phase_order=opt.order,
taper=opt.taper_template, approximant=opt.approximant,
out=zeros(tlen, dtype=complex64))
flow, dtype = complex64, phase_order = opt.order,
taper = opt.taper_template, approximant = opt.approximant,
out = template_mem)

for t_num, template in enumerate(bank):
event_mgr.new_template(tmplt=template.params, sigmasq=template.sigmasq(segments[0].psd))
if opt.cluster_method == "window":
cluster_window = int(opt.cluster_window * gwstrain.sample_rate)
elif opt.cluster_method == "template":
cluster_window = int(template.chirp_length * gwstrain.sample_rate)
#if opt.cluster_method == "window":
# At present, moved above with class-based approach
#cluster_window = int(opt.cluster_window * gwstrain.sample_rate)
if opt.cluster_method == "template":
#cluster_window = int(template.chirp_length * gwstrain.sample_rate)
raise ValueError("FIXME: template clustering not supported yet with optimizations!")

for s_num, stilde in enumerate(segments):
logging.info("Filtering template %d/%d segment %d/%d" %
(t_num + 1, len(bank), s_num + 1, len(segments)))

snr, norm, corr, idx, snrv = \
matched_filter.matched_filter_and_cluster(template,
template.sigmasq(stilde.psd), stilde, cluster_window)
matched_filter.matched_filter_and_cluster(s_num, template.sigmasq(stilde.psd))

if not len(idx):
continue
Expand All @@ -274,6 +282,7 @@ with ctx:
event_mgr.cluster_template_events("time_index", "snr", cluster_window)
event_mgr.finalize_template_events()

event_mgr.finalize_template_events()
logging.info("Found %s triggers" % str(len(event_mgr.events)))

if opt.chisq_threshold and opt.chisq_bins:
Expand Down
57 changes: 55 additions & 2 deletions pycbc/events/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,59 @@ def threshold_and_cluster(series, threshold, window):
"""Return list of values and indices values over threshold in series.
"""

@schemed("pycbc.events.threshold_")
def batched_threshold_and_cluster(series, threshold, window):
"""Return list of values and indices values over threshold in series.
"""
@schemed("pycbc.events.threshold_")
def _threshold_cluster_factory(series, window):
pass

class ThresholdCluster(object):
"""Create a threshold and cluster engine

Parameters
---------
series : complex64
Input pycbc.types.Array (or subclass); it will be searched for
points above threshold that are then clustered
window : int
Size in samples of the window over which to cluster
"""
def __new__(cls, *args, **kwargs):
real_cls = _threshold_cluster_factory(*args, **kwargs)
return real_cls(*args, **kwargs)

# The class below should serve as the parent for all schemed classes.
# The intention is that this class serves simply as the location for
# all documentation of the class and its methods, though that is not
# yet implemented. Perhaps something along the lines of:
#
# http://stackoverflow.com/questions/2025562/inherit-docstrings-in-python-class-inheritance
#
# will work? Is there a better way?
class _BaseThresholdCluster(object):
def threshold_and_cluster(self, threshold):
"""
Threshold and cluster the memory specified at instantiation with the
threshold specified at creation and the window size specified at creation.

Parameters:
-----------
threshold : float32
The minimum absolute value of the series given at object initialization
to return when thresholding and clustering.

Returns:
--------
event_vals : complex64
Numpy array, complex values of the clustered events
event_locs : uint32
Numpy array, indices into series of location of events
"""
pass


def fc_cluster_over_window_fast(times, values, window_length):
""" Reduce the events by clustering over a window using
the FindChirp clustering algorithm
Expand Down Expand Up @@ -933,7 +986,7 @@ def get_weighted_snr(self, fac):
coinc_def_row.search_coinc_type = 0
coinc_def_table.append(coinc_def_row)

__all__ = ['threshold_and_cluster', 'newsnr',
__all__ = ['threshold_and_cluster', 'newsnr', 'batched_threshold_and_cluster',
'findchirp_cluster_over_window', 'fc_cluster_over_window_fast',
'threshold', 'cluster_reduce',
'threshold', 'cluster_reduce', 'ThresholdCluster',
'EventManager', 'EventManagerMultiDet']
Loading