I am having a problem while running this cell:
''''from pycbc.waveform import get_td_waveform
apx = 'IMRPhenomD'
hp1, _ = get_td_waveform(approximant=apx,
mass1=10,
mass2=10,
delta_t=1.0/sample_rate,
f_lower=25)
The amplitude of gravitational-wave signals is normally of order 1E-20. To demonstrate our method
on white noise with amplitude O(1) we normalize our signal so the cross-correlation of the signal with
itself will give a value of 1. In this case we can interpret the cross-correlation of the signal with white
noise as a signal-to-noise ratio.
hp1 = hp1 / max(numpy.correlate(hp1,hp1, mode='full'))**0.5
pylab.figure()
pylab.title("The waveform hp1")
pylab.plot(hp1.sample_times, hp1)
pylab.xlabel('Time (s)')
pylab.ylabel('Normalized amplitude')
waveform_start = numpy.random.randint(0, len(data) - len(hp1))
data[waveform_start:waveform_start+len(hp1)] += 10 * hp1.numpy()
pylab.figure()
pylab.title("Looks like random noise, right?")
pylab.plot(hp1.sample_times, data[waveform_start:waveform_start+len(hp1)])
pylab.xlabel('Time (s)')
pylab.ylabel('Normalized amplitude')
pylab.figure()
pylab.title("Signal in the data")
pylab.plot(hp1.sample_times, data[waveform_start:waveform_start+len(hp1)])
pylab.plot(hp1.sample_times, 10 * hp1)
pylab.xlabel('Time (s)')
pylab.ylabel('Normalized amplitude') ''''
The error is this one: TypeError: slice indices must be integers or None or have an index method
I have also tired to run the "new version" - that I took from here: https://github.com/gw-odw/odw-2019/blob/38c7bc75a8aca9117471ccc7e373fdc201a7e89a/Day_2/Tuto_2.1_Matched_filtering_introduction.ipynb
The strange thing is, if I change the value of sample_rate for 4096 (as indicated in 2018's version) it works.
After making it work using the new value for sample_rate, I get another error in another cell - # 11 - Generate a PSD for whitening the data.
In this cell the error is this one: ValueError: different delta_f