Revision 3b6f5b3b48fcef90fcf43e18afb66bc9d49b731d authored by Soumi De on 13 August 2018, 14:48:53 UTC, committed by Collin Capano on 13 August 2018, 14:48:53 UTC
* Add low-frequency cutoof option for every detector

* ws

* Make f_lower a dict in test_inference

* fix codacy issues

* fix codeclimate issue
1 parent 404fc18
Raw File
frequency.py
import pycbc.noise
import pycbc.psd
import pylab

# The color of the noise matches a PSD which you provide
flow = 30.0
delta_f = 1.0 / 64
flen = int(2048 / delta_f) + 1
psd = pycbc.psd.aLIGOZeroDetHighPower(flen, delta_f, flow)

# Here the noise is generated directly in the frequency domain so it matches
# the parameters of the PSD you give.
fs = pycbc.noise.frequency_noise_from_psd(psd, seed=127)

pylab.loglog(fs.sample_frequencies, abs(psd), label='Magnitude')
pylab.loglog(fs.sample_frequencies, abs(fs**2.0), label='Magnitude')
pylab.legend()
pylab.ylabel('Strain^2 / Hz')
pylab.xlabel('Frequency (Hz)')
pylab.show()
back to top