Commit ff03ed17 authored by moritz's avatar moritz
Browse files

Moritz Huebner: Made it work with new changes

parent 058a0a0e
# coding: utf-8
# # GW150914 analysis
......@@ -15,12 +14,12 @@ import peyote
import corner
import logging
logging.getLogger().addHandler(logging.StreamHandler())
logging.getLogger().setLevel('DEBUG')
import matplotlib.mlab as mlab
data_file = 'tutorial_data/GW150914_strain_data.npy'
time_series, strain_H1, strain_L1 = np.load(data_file)
time_duration = time_series[-1] - time_series[0]
......@@ -29,9 +28,8 @@ time_of_event = 1126259462.44
sampling_frequency = np.int(peyote.utils.sampling_frequency(time_series))
NFFT = 4 * sampling_frequency
power_spectral_density_H1, frequency_series = mlab.psd(strain_H1, Fs = sampling_frequency, NFFT = NFFT)
power_spectral_density_L1, frequency_series = mlab.psd(strain_L1, Fs = sampling_frequency, NFFT = NFFT)
power_spectral_density_H1, frequency_series = mlab.psd(strain_H1, Fs=sampling_frequency, NFFT=NFFT)
power_spectral_density_L1, frequency_series = mlab.psd(strain_L1, Fs=sampling_frequency, NFFT=NFFT)
with open('150914_PSD_H1.txt', 'w+') as file:
for f, p in zip(frequency_series, power_spectral_density_H1):
......@@ -40,7 +38,6 @@ with open('150914_PSD_L1.txt', 'w+') as file:
for f, p in zip(frequency_series, power_spectral_density_L1):
file.write('{} {}\n'.format(f, p))
search_idxs = (time_series > time_of_event - 0.5) * (time_series < time_of_event + 0.5)
time_series = time_series[search_idxs]
strain_H1 = strain_H1[search_idxs]
......@@ -58,27 +55,18 @@ L1.set_data(sampling_frequency, time_duration,
IFOs = [H1, L1]
source = peyote.source.BinaryBlackHole('BBH', sampling_frequency, time_duration)
source = peyote.source.BinaryBlackHole('BBH', sampling_frequency, time_duration, spin_1=[0, 0, 0], spin_2=[0, 0, 0],
luminosity_distance=410., iota=2.97305, phase=1.145,
waveform_approximant='IMRPhenomPv2', reference_frequency=50., ra=1.375,
dec=-1.2108, geocent_time=1126259642.413, psi=2.659, mass_1=36, mass_2=28)
likelihood = peyote.likelihood.Likelihood(IFOs, source)
prior = dict(
spin_1 = [0, 0, 0],
spin_2 = [0, 0, 0],
luminosity_distance = 410.,
iota = 2.97305,
phase = 1.145,
waveform_approximant = 'IMRPhenomPv2',
reference_frequency = 50.,
ra = 1.375,
dec = -1.2108,
geocent_time = 1126259642.413,
psi=2.659
)
prior['mass_1'] = peyote.parameter.Parameter(
prior = source.copy()
prior.mass_1 = peyote.parameter.Parameter(
'mass_1', prior=peyote.prior.Uniform(lower=32, upper=41),
latex_label='$m_1$')
prior['mass_2'] = peyote.parameter.Parameter(
prior.mass_2 = peyote.parameter.Parameter(
'mass_2', prior=peyote.prior.Uniform(lower=25, upper=33),
latex_label='$m_2$')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment