Revision 0053b41c73cdae20cc685478db7a5a1abcdf4d4b authored by Arthur Tolley on 30 March 2021, 10:56:14 UTC, committed by GitHub on 30 March 2021, 10:56:14 UTC
* multi-ifo options for fake-strain and fake-strain-seed

* Removed the dependence of fake-strain on injection files, can now be injected into data. Changed argument names, added to the main function

* Removing opt. from these variables within the main function

* removing print, extra space, and nargs to allow rebasing

* Updating branch to rebase to main

* removing a lot of spaces

* Restoring the new line at the end of the file

* Replace if not fake_strain with an else

* Changing the action & type for fake-strain-seed

* Removing nargs='+' and cleaning up if statements
1 parent 72d8944
Raw File
overlap.py
from pycbc.waveform import get_td_waveform
from pycbc.filter import match, overlap
from pycbc.psd import aLIGOZeroDetHighPower

# Buffer size in seconds. This is presumed to be
# longer than the longest waveform.
time_buffer = 4

f_low = 30
sample_rate = 4096

# Length of corresponding time series and frequency series
tlen = sample_rate * time_buffer
flen = tlen // 2 + 1

delta_t = 1.0 / sample_rate
delta_f = 1.0 / time_buffer

print("Generating waveform 1")
hp, hc = get_td_waveform(approximant="EOBNRv2",
                         mass1=10,
                         mass2=10,
                         f_lower=f_low,
                         delta_t=1.0/4096)
print("waveform is %s seconds long" % hp.duration)

print("Generating waveform 2")
sp, sc = get_td_waveform(approximant="TaylorT4",
                         mass1=10,
                         mass2=10,
                         f_lower=f_low,
                         delta_t=1.0/4096)

print("waveform is %s seconds long" % sp.duration)

# Ensure that the waveforms are resized to the same length
sp.resize(tlen)
hp.resize(tlen)

print("Calculating analytic PSD")
psd = aLIGOZeroDetHighPower(flen, delta_f, f_low)

print("Calculating match and overlap")
# Note: This takes a while the first time as an FFT plan is generated
# subsequent calls within the same program will be faster
m, i = match(hp, sp, psd=psd, low_frequency_cutoff=f_low)
o = overlap(hp, sp, psd=psd, low_frequency_cutoff=f_low)
print("Overlap %s" % o)
print("Maximized Overlap %s" % m)

back to top