diff --git a/examples/injection_examples/basic_tutorial.py b/examples/injection_examples/basic_tutorial.py index 1dccdf7585bcda4658caa499ced866ec72a98b48..f2cf31e6b3bc1817356295da8f2a2423b43cc8ba 100644 --- a/examples/injection_examples/basic_tutorial.py +++ b/examples/injection_examples/basic_tutorial.py @@ -32,15 +32,15 @@ injection_parameters = dict(mass_1=36., mass_2=29., a_1=0.4, a_2=0.3, tilt_1=0.5 ra=1.375, dec=-1.2108) # Fixed arguments passed into the source model -fixed_arguments = dict(waveform_approximant='IMRPhenomPv2', - reference_frequency=50.) +waveform_arguments = dict(waveform_approximant='IMRPhenomPv2', + reference_frequency=50.) # Create the waveform_generator using a LAL BinaryBlackHole source function waveform_generator = tupak.WaveformGenerator(time_duration=time_duration, sampling_frequency=sampling_frequency, frequency_domain_source_model=tupak.gw.source.lal_binary_black_hole, parameters=injection_parameters, - fixed_arguments=fixed_arguments) + waveform_arguments=waveform_arguments) hf_signal = waveform_generator.frequency_domain_strain() # Set up interferometers. In this case we'll use three interferometers (LIGO-Hanford (H1), LIGO-Livingston (L1), diff --git a/examples/injection_examples/basic_tutorial_dist_time_phase_marg.py b/examples/injection_examples/basic_tutorial_dist_time_phase_marg.py index 2110202583e7cca7dce80cf01a780854a38f28a6..f28e35d1017a0c35b46695e3656ab23728b73168 100644 --- a/examples/injection_examples/basic_tutorial_dist_time_phase_marg.py +++ b/examples/injection_examples/basic_tutorial_dist_time_phase_marg.py @@ -27,13 +27,18 @@ np.random.seed(88170235) # spins of both black holes (a, tilt, phi), etc. 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=2000., iota=0.4, psi=2.659, phase=1.3, geocent_time=1126259642.413, - waveform_approximant='IMRPhenomPv2', reference_frequency=50., ra=1.375, dec=-1.2108) + ra=1.375, dec=-1.2108) + +# Fixed arguments passed into the source model +waveform_arguments = dict(waveform_approximant='IMRPhenomPv2', + reference_frequency=50.) # Create the waveform_generator using a LAL BinaryBlackHole source function waveform_generator = tupak.WaveformGenerator(time_duration=time_duration, sampling_frequency=sampling_frequency, frequency_domain_source_model=tupak.gw.source.lal_binary_black_hole, - parameters=injection_parameters) + parameters=injection_parameters, + waveform_arguments=waveform_arguments) hf_signal = waveform_generator.frequency_domain_strain() # Set up interferometers. In this case we'll use three interferometers (LIGO-Hanford (H1), LIGO-Livingston (L1), diff --git a/examples/injection_examples/basic_tutorial_time_phase_marg.py b/examples/injection_examples/basic_tutorial_time_phase_marg.py index cfa4c692e327702f3c5e53e7e5af8821010023b7..47768d1a682d6c9e094e6047673fcf748c66382d 100644 --- a/examples/injection_examples/basic_tutorial_time_phase_marg.py +++ b/examples/injection_examples/basic_tutorial_time_phase_marg.py @@ -27,13 +27,17 @@ np.random.seed(88170235) # spins of both black holes (a, tilt, phi), etc. 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=2000., iota=0.4, psi=2.659, phase=1.3, geocent_time=1126259642.413, - waveform_approximant='IMRPhenomPv2', reference_frequency=50., ra=1.375, dec=-1.2108) + ra=1.375, dec=-1.2108) + +waveform_arguments = dict(waveform_approximant='IMRPhenomPv2', + reference_frequency=50.) # Create the waveform_generator using a LAL BinaryBlackHole source function waveform_generator = tupak.WaveformGenerator(time_duration=time_duration, sampling_frequency=sampling_frequency, frequency_domain_source_model=tupak.gw.source.lal_binary_black_hole, - parameters=injection_parameters) + parameters=injection_parameters, + waveform_arguments=waveform_arguments) hf_signal = waveform_generator.frequency_domain_strain() # Set up interferometers. In this case we'll use three interferometers (LIGO-Hanford (H1), LIGO-Livingston (L1), diff --git a/examples/injection_examples/change_sampled_parameters.py b/examples/injection_examples/change_sampled_parameters.py index 711e195c097f3b54d613fb49e8d82b88cae1a0c7..1b774774c1d51a62518ecae6d3f9f0be15f7e9fe 100644 --- a/examples/injection_examples/change_sampled_parameters.py +++ b/examples/injection_examples/change_sampled_parameters.py @@ -20,7 +20,10 @@ np.random.seed(151226) 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=3000., iota=0.4, psi=2.659, phase=1.3, geocent_time=1126259642.413, - waveform_approximant='IMRPhenomPv2', reference_frequency=50., ra=1.375, dec=-1.2108) + ra=1.375, dec=-1.2108) + +waveform_arguments = dict(waveform_approximant='IMRPhenomPv2', + reference_frequency=50.) # Create the waveform_generator using a LAL BinaryBlackHole source function waveform_generator = tupak.gw.waveform_generator.WaveformGenerator( @@ -28,7 +31,7 @@ waveform_generator = tupak.gw.waveform_generator.WaveformGenerator( frequency_domain_source_model=tupak.gw.source.lal_binary_black_hole, parameter_conversion=tupak.gw.conversion.convert_to_lal_binary_black_hole_parameters, non_standard_sampling_parameter_keys=['chirp_mass', 'mass_ratio'], - parameters=injection_parameters) + parameters=injection_parameters, waveform_arguments=waveform_arguments) hf_signal = waveform_generator.frequency_domain_strain() # Set up interferometers. diff --git a/examples/injection_examples/how_to_specify_the_prior.py b/examples/injection_examples/how_to_specify_the_prior.py index 67e3e209bc6e90ec47be3e9602bf98eda0c163fe..5554f18e21e5b7bb54c9652fb02532fa16f23499 100644 --- a/examples/injection_examples/how_to_specify_the_prior.py +++ b/examples/injection_examples/how_to_specify_the_prior.py @@ -18,13 +18,17 @@ np.random.seed(151012) 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, - waveform_approximant='IMRPhenomPv2', reference_frequency=50., ra=1.375, dec=-1.2108) + ra=1.375, dec=-1.2108) + +waveform_arguments = dict(waveform_approximant='IMRPhenomPv2', + reference_frequency=50.) # Create the waveform_generator using a LAL BinaryBlackHole source function waveform_generator = tupak.WaveformGenerator(time_duration=time_duration, sampling_frequency=sampling_frequency, frequency_domain_source_model=tupak.gw.source.lal_binary_black_hole, - parameters=injection_parameters) + parameters=injection_parameters, + waveform_arguments=waveform_arguments) hf_signal = waveform_generator.frequency_domain_strain() # Set up interferometers. diff --git a/examples/injection_examples/marginalized_likelihood.py b/examples/injection_examples/marginalized_likelihood.py index 5ca2ed1b8834c6b190015bb7a6fa237784f03441..e819e8d5bb66e37fa7c79cdbf9faf7663ab140b7 100644 --- a/examples/injection_examples/marginalized_likelihood.py +++ b/examples/injection_examples/marginalized_likelihood.py @@ -17,12 +17,16 @@ np.random.seed(170608) 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, - waveform_approximant='IMRPhenomPv2', reference_frequency=50., ra=1.375, dec=-1.2108) + ra=1.375, dec=-1.2108) + +waveform_arguments = dict(waveform_approximant='IMRPhenomPv2', + reference_frequency=50.) # Create the waveform_generator using a LAL BinaryBlackHole source function waveform_generator = tupak.WaveformGenerator( time_duration=time_duration, sampling_frequency=sampling_frequency, - frequency_domain_source_model=tupak.gw.source.lal_binary_black_hole, parameters=injection_parameters) + frequency_domain_source_model=tupak.gw.source.lal_binary_black_hole, parameters=injection_parameters, + waveform_arguments=waveform_arguments) hf_signal = waveform_generator.frequency_domain_strain() # Set up interferometers. diff --git a/examples/open_data_examples/GW150914.py b/examples/open_data_examples/GW150914.py index d873df323e0025c82067f6142d08900c0457926b..6ccb8a00f23d24c1f966e8813925b654fee54176 100644 --- a/examples/open_data_examples/GW150914.py +++ b/examples/open_data_examples/GW150914.py @@ -39,8 +39,8 @@ prior = tupak.gw.prior.BBHPriorSet(filename='GW150914.prior') waveform_generator = tupak.WaveformGenerator(time_duration=interferometers[0].duration, sampling_frequency=interferometers[0].sampling_frequency, frequency_domain_source_model=tupak.gw.source.lal_binary_black_hole, - parameters={'waveform_approximant': 'IMRPhenomPv2', - 'reference_frequency': 50}) + waveform_arguments={'waveform_approximant': 'IMRPhenomPv2', + 'reference_frequency': 50}) # In this step, we define the likelihood. Here we use the standard likelihood # function, passing it the data and the waveform generator.