diff --git a/bin/pycbc_inspiral b/bin/pycbc_inspiral index dc71bd367d0..4d5e6e9a585 100644 --- a/bin/pycbc_inspiral +++ b/bin/pycbc_inspiral @@ -295,7 +295,7 @@ def template_triggers(t_num): out_vals['time_index'], opt.gps_start_time, opt.sample_rate) #print(idx, out_vals['time_index']) - + out_vals_all.append(copy.deepcopy(out_vals)) #print(out_vals_all) return out_vals_all, tparam @@ -358,10 +358,11 @@ with ctx: if opt.psdvar_segment is not None: logging.info("Calculating PSD variation") psd_var = pycbc.psd.calc_filt_psd_variation(gwstrain, opt.psdvar_segment, - opt.psdvar_short_segment, opt.psdvar_long_segment, + opt.psdvar_short_segment, opt.psdvar_long_segment, opt.psdvar_psd_duration, opt.psdvar_psd_stride, opt.psd_estimation, opt.psdvar_low_freq, opt.psdvar_high_freq) + if opt.enable_q_transform: logging.info("Performing q-transform on analysis segments") q_trans = qtransform.inspiral_qtransform_generator(segments) @@ -453,16 +454,16 @@ with ctx: tsetup = time.time() - tstart tcheckpoint = time.time() - + tanalyze = list(range(tnum_start, len(bank))) n = opt.finalize_events_template_rate n = 1 if n is None else n - tchunks = [tanalyze[i:i + n] for i in range(0, len(tanalyze), n)] - + tchunks = [tanalyze[i:i + n] for i in range(0, len(tanalyze), n)] + mmap = map if opt.multiprocessing_nprocesses: mmap = Pool(opt.multiprocessing_nprocesses).map - + for tchunk in tchunks: data = list(mmap(template_triggers, tchunk)) @@ -472,11 +473,11 @@ with ctx: event_mgr.new_template(tmplt=tparam) for edata in out_vals_all: - event_mgr.add_template_events(names, [edata[n] for n in names]) - + event_mgr.add_template_events(names, [edata[n] for n in names]) + event_mgr.cluster_template_events("time_index", "snr", cluster_window) event_mgr.finalize_template_events() - + if opt.finalize_events_template_rate is not None: event_mgr.consolidate_events(opt, gwstrain=gwstrain) @@ -488,7 +489,7 @@ with ctx: if opt.checkpoint_exit_maxtime and \ (time.time() - tstart > opt.checkpoint_exit_maxtime): event_mgr.save_state(max(tchunk), opt.output + '.checkpoint') - sys.exit(opt.checkpoint_exit_code) + sys.exit(opt.checkpoint_exit_code) event_mgr.consolidate_events(opt, gwstrain=gwstrain) event_mgr.finalize_events() diff --git a/pycbc/psd/variation.py b/pycbc/psd/variation.py index 50a006faf99..6e4b8de5483 100644 --- a/pycbc/psd/variation.py +++ b/pycbc/psd/variation.py @@ -7,7 +7,6 @@ import pycbc.psd from pycbc.types import TimeSeries -from pycbc.filter import resample_to_delta_t def mean_square(data, delta_t, srate, short_stride, stride): @@ -113,9 +112,6 @@ def calc_filt_psd_variation(strain, segment, short_segment, psd_long_segment, # Convert start and end times immediately to floats start_time = float(strain.start_time) end_time = float(strain.end_time) - - # Resample the data - strain = resample_to_delta_t(strain, 1.0 / 2048) srate = int(strain.sample_rate) # Fix the step for the PSD estimation and the time to remove at the