From 195aac95b959827446c85aa1a848a938bfbb66f1 Mon Sep 17 00:00:00 2001 From: Colm Talbot <colm.talbot@ligo.org> Date: Thu, 4 Oct 2018 22:34:51 +1000 Subject: [PATCH] pep --- .../injection_examples/australian_detector.py | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/examples/injection_examples/australian_detector.py b/examples/injection_examples/australian_detector.py index 29ad908bd..cbc4a76dd 100644 --- a/examples/injection_examples/australian_detector.py +++ b/examples/injection_examples/australian_detector.py @@ -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, -- GitLab