Commit 2a741153 authored by Marc Arene's avatar Marc Arene
Browse files

Using `maximum_frequency_search_waveform`

parent c5156b6d
......@@ -211,7 +211,7 @@ if __name__=='__main__':
start_time=start_time)
# WAVEFORM GENERATION
injection_parameters['meta']['maximum_frequency_of_generated_waveform'] = injection_parameters['meta']['maximum_frequency_injected_waveform']
injection_parameters['meta']['maximum_frequency_generated_waveform'] = injection_parameters['meta']['maximum_frequency_injected_waveform']
template_ifos_injected = bilby_wv.WaveForm_ThreeDetectors(injection_parameters, minimum_frequency, interferometers)
# INJECT TEMPLATE INTO NOISE STRAIN DATA
......@@ -221,7 +221,7 @@ if __name__=='__main__':
interferometers[i].fd_strain = interferometers[i].strain_data.frequency_domain_strain
# COMPUTE AND PRINT SNR
injection_parameters['meta']['maximum_frequency_of_generated_waveform'] = injection_parameters['meta']['maximum_frequency_ifo']
injection_parameters['meta']['maximum_frequency_generated_waveform'] = injection_parameters['meta']['maximum_frequency_search_waveform']
template_ifos = bilby_wv.WaveForm_ThreeDetectors(injection_parameters, minimum_frequency, interferometers)
logL, Snr, opt_snr_Best = logL_snr.main(template_ifos, interferometers, True)
......
......@@ -106,16 +106,17 @@ if __name__=='__main__':
start_time=start_time)
# WAVEFORM GENERATION
template_ifos = bilby_wv.WaveForm_ThreeDetectors(injection_parameters, minimum_frequency, interferometers)
injection_parameters['meta']['maximum_frequency_generated_waveform'] = injection_parameters['meta']['maximum_frequency_injected_waveform']
template_ifos_injected = bilby_wv.WaveForm_ThreeDetectors(injection_parameters, minimum_frequency, interferometers)
# INJECT TEMPLATE INTO NOISE STRAIN DATA
# Add the template signal to each detector's strain data
for i in range(len(interferometers)):
interferometers[i].strain_data.frequency_domain_strain += template_ifos[i]
interferometers[i].strain_data.frequency_domain_strain += template_ifos_injected[i]
interferometers[i].fd_strain = interferometers[i].strain_data.frequency_domain_strain
# COMPUTE AND PRINT SNR
logLBest, mf_snr_best, opt_snr_Best = logL_snr.main(template_ifos, interferometers, True)
# COMPUTE dlogL
dlogL = main(injection_parameters, start_time, minimum_frequency, interferometers, True)
# Generate a template up to frequency of analysis
injection_parameters['meta']['maximum_frequency_generated_waveform'] = injection_parameters['meta']['maximum_frequency_search_waveform']
template_ifos = bilby_wv.WaveForm_ThreeDetectors(injection_parameters, minimum_frequency, interferometers)
logLBest, mf_snr_best, opt_snr_Best = main(template_ifos, interferometers, True)
......@@ -83,7 +83,7 @@ if __name__=='__main__':
start_time=start_time)
# WAVEFORM GENERATION
injection_parameters['meta']['maximum_frequency_of_generated_waveform'] = injection_parameters['meta']['maximum_frequency_injected_waveform']
injection_parameters['meta']['maximum_frequency_generated_waveform'] = injection_parameters['meta']['maximum_frequency_injected_waveform']
template_ifos_injected = bilby_wv.WaveForm_ThreeDetectors(injection_parameters, minimum_frequency, interferometers)
# INJECT TEMPLATE INTO NOISE STRAIN DATA
......@@ -94,6 +94,6 @@ if __name__=='__main__':
# COMPUTE AND PRINT SNR
# Generate a template up to frequency of analysis
injection_parameters['meta']['maximum_frequency_of_generated_waveform'] = injection_parameters['meta']['maximum_frequency_ifo']
injection_parameters['meta']['maximum_frequency_generated_waveform'] = injection_parameters['meta']['maximum_frequency_search_waveform']
template_ifos = bilby_wv.WaveForm_ThreeDetectors(injection_parameters, minimum_frequency, interferometers)
logLBest, mf_snr_best, opt_snr_Best = main(template_ifos, interferometers, True)
......@@ -129,9 +129,9 @@ def ini_file_to_dict(file_path='../examples/GW170817.ini'):
f_high = f_ISCO
f_high_run = f_ISCO_run
maximum_frequency_injected_waveform = 0
maximum_frequency_search_waveform = 0
# maximum_frequency_ifo = min(4096 * 4, f_high_run)
maximum_frequency_ifo = f_high_run
maximum_frequency_of_generated_waveform = 0
sampling_frequency = 2 * f_high_run
duration = tc_3p5PN + 2
reference_frequency = 0
......@@ -153,7 +153,8 @@ def ini_file_to_dict(file_path='../examples/GW170817.ini'):
# maximum_frequency_injected_waveform = rescaled_params['fhigh']
maximum_frequency_injected_waveform = min(2048, rescaled_params['fhigh'])
maximum_frequency_ifo = min(2048, rescaled_params['fhigh'])
maximum_frequency_of_generated_waveform = None
maximum_frequency_search_waveform = maximum_frequency_ifo
# maximum_frequency_ifo = rescaled_params['fhigh']
sampling_frequency = 2 * max(2048, rescaled_params['fhigh'])
duration = rescaled_params['seglen']
......@@ -182,10 +183,11 @@ def ini_file_to_dict(file_path='../examples/GW170817.ini'):
M_min_sec = (m1_min + m2_min) * LAL_MTSUN_SI
f_high = f_CUT / M_sec
f_high_run = f_CUT / M_min_sec
maximum_frequency_ifo = min(2048, f_high_run)
# maximum_frequency_ifo = min(4 * 4096, f_high_run)
maximum_frequency_injected_waveform = maximum_frequency_ifo
maximum_frequency_of_generated_waveform = None
maximum_frequency_search_waveform = maximum_frequency_ifo
sampling_frequency = 2 * maximum_frequency_ifo
duration = 64
reference_frequency = 20
......@@ -199,8 +201,9 @@ def ini_file_to_dict(file_path='../examples/GW170817.ini'):
meta_params = dict(
minimum_frequency = minimum_frequency,
maximum_frequency_injected_waveform = maximum_frequency_injected_waveform,
maximum_frequency_search_waveform = maximum_frequency_search_waveform,
maximum_frequency_ifo = maximum_frequency_ifo,
maximum_frequency_of_generated_waveform = maximum_frequency_of_generated_waveform,
maximum_frequency_generated_waveform = None,
sampling_frequency = sampling_frequency,
duration = duration,
tc_3p5PN = tc_3p5PN,
......
......@@ -15,7 +15,7 @@ def get_source_frame_polarizations(parameters, minimum_frequency, interferometer
# Fixed arguments passed into the source model. The analysis starts at 40 Hz.
if 'meta' in parameters.keys():
# waveform_arguments = dict(waveform_approximant=parameters['meta']['approximant'], reference_frequency=parameters['meta']['reference_frequency'], minimum_frequency=minimum_frequency, maximum_frequency=0)
waveform_arguments = dict(waveform_approximant=parameters['meta']['approximant'], reference_frequency=parameters['meta']['reference_frequency'], minimum_frequency=minimum_frequency, maximum_frequency=parameters['meta']['maximum_frequency_of_generated_waveform'])
waveform_arguments = dict(waveform_approximant=parameters['meta']['approximant'], reference_frequency=parameters['meta']['reference_frequency'], minimum_frequency=minimum_frequency, maximum_frequency=parameters['meta']['maximum_frequency_generated_waveform'])
else:
waveform_arguments = dict(waveform_approximant=conf.approximant, reference_frequency=conf.reference_frequency, minimum_frequency=conf.minimum_frequency, maximum_frequency=conf.maximum_frequency_ifo)
......
......@@ -103,7 +103,7 @@ if __name__=='__main__':
start_time=start_time)
# WAVEFORM GENERATION
injection_parameters['meta']['maximum_frequency_of_generated_waveform'] = injection_parameters['meta']['maximum_frequency_injected_waveform']
injection_parameters['meta']['maximum_frequency_generated_waveform'] = injection_parameters['meta']['maximum_frequency_injected_waveform']
template_ifos = bilby_wv.WaveForm_ThreeDetectors(injection_parameters, minimum_frequency, interferometers)
# INJECT TEMPLATE INTO NOISE STRAIN DATA
......
......@@ -146,16 +146,20 @@ if __name__=='__main__':
GW170817_set_strain_data_from_psd.main(interferometers, injection_parameters, sampling_frequency, duration, start_time, opts.psd, opts.new_noise_realisation_from_psd)
# WAVEFORM GENERATION
template_ifos = GW170817_waveform_three_detectors.main(injection_parameters, start_time, minimum_frequency, interferometers, opts.generate_from_bilby)
injection_parameters['meta']['maximum_frequency_generated_waveform'] = injection_parameters['meta']['maximum_frequency_injected_waveform']
template_ifos_injected = bilby_wv.WaveForm_ThreeDetectors(injection_parameters, minimum_frequency, interferometers)
# INJECT TEMPLATE INTO NOISE STRAIN DATA
# Add the template signal to each detector's strain data
for i in range(len(interferometers)):
interferometers[i].strain_data.frequency_domain_strain += template_ifos[i]
interferometers[i].strain_data.frequency_domain_strain += template_ifos_injected[i]
interferometers[i].fd_strain = interferometers[i].strain_data.frequency_domain_strain
# COMPUTE AND PRINT SNR
logLBest, mf_snr_best, opt_snr_Best = GW170817_logL_snr.main(template_ifos, interferometers, True)
# Generate a template up to frequency of analysis
injection_parameters['meta']['maximum_frequency_generated_waveform'] = injection_parameters['meta']['maximum_frequency_search_waveform']
template_ifos = bilby_wv.WaveForm_ThreeDetectors(injection_parameters, minimum_frequency, interferometers)
logLBest, mf_snr_best, opt_snr_Best = main(template_ifos, interferometers, True)
# This copy is here just because for the moment I will keep manipulating 3 separate variables as originally done in the hmc
signal1 = interferometers[0].strain_data.frequency_domain_strain.copy()
......
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