Skip to content
Snippets Groups Projects
Commit 195aac95 authored by Colm Talbot's avatar Colm Talbot
Browse files

pep

parent 7a033493
No related branches found
No related tags found
1 merge request!228Update examples
Pipeline #33256 failed
......@@ -9,9 +9,11 @@ from __future__ import division, print_function
import numpy as np
import bilby, gwinc
import bilby
import gwinc
# Set the duration and sampling frequency of the data segment that we're going to inject the signal into
# Set the duration and sampling frequency of the data segment that we're going
# to inject the signal into
duration = 4.
sampling_frequency = 2048.
......@@ -44,8 +46,9 @@ AusIFO = bilby.gw.detector.Interferometer(
# Set up two other detectors at Hanford and Livingston
interferometers = bilby.gw.detector.InterferometerList(['H1', 'L1'])
for interferometer in interferometers:
interferometer.power_spectral_density = bilby.gw.detector.PowerSpectralDensity(
frequency_array=frequencies, psd_array=Aplus_psd)
interferometer.power_spectral_density =\
bilby.gw.detector.PowerSpectralDensity(
frequency_array=frequencies, psd_array=Aplus_psd)
# append the Australian detector to the list of other detectors
interferometers.append(AusIFO)
......@@ -54,9 +57,10 @@ interferometers.append(AusIFO)
# Inject a gravitational-wave signal into the network
# as we're using a three-detector network of A+, we inject a GW150914-like
# signal at 4 Gpc
injection_parameters = dict(mass_1=36., mass_2=29., a_1=0.4, a_2=0.3, tilt_1=0.5, tilt_2=1.0, phi_12=1.7, phi_jl=0.3,
luminosity_distance=4000., iota=0.4, psi=2.659, phase=1.3, geocent_time=1126259642.413,
ra=1.375, dec=0.2108)
injection_parameters = dict(
mass_1=36., mass_2=29., a_1=0.4, a_2=0.3, tilt_1=0.5, tilt_2=1.0,
phi_12=1.7, phi_jl=0.3, luminosity_distance=4000., iota=0.4, psi=2.659,
phase=1.3, geocent_time=1126259642.413, ra=1.375, dec=0.2108)
# Fixed arguments passed into the source model
......@@ -86,10 +90,12 @@ for interferometer in interferometers:
# set up priors
priors = bilby.gw.prior.BBHPriorSet()
for key in ['a_1', 'a_2', 'tilt_1', 'tilt_2', 'phi_12', 'phi_jl', 'psi', 'geocent_time', 'phase']:
for key in ['a_1', 'a_2', 'tilt_1', 'tilt_2', 'phi_12', 'phi_jl', 'psi',
'geocent_time', 'phase']:
priors[key] = injection_parameters[key]
# Initialise the likelihood by passing in the interferometer data (IFOs) and the waveoform generator
# Initialise the likelihood by passing in the interferometer data (IFOs)
# and the waveoform generator
likelihood = bilby.gw.GravitationalWaveTransient(
interferometers=interferometers, waveform_generator=waveform_generator,
time_marginalization=False, phase_marginalization=False,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment