Commit fde82a97 authored by Marc Arene's avatar Marc Arene
Browse files

iota => theta_jn

parent ad26282f
......@@ -77,9 +77,9 @@ def h_dh_Generation_ThreeDetectors(parameters, start_time, minimum_frequency, in
offset_cosi = conf.param_offsets[0]
# Deriving w.r.t. np.cos(inc) where inc = parameters[0]
# If we are at the boundary where iota = +/- pi, we only do a forward difference in cos(iota)
if np.cos(parameters['iota']) - offset_cosi < -1:
if np.cos(parameters['theta_jn']) - offset_cosi < -1:
parameters_plus = parameters.copy()
parameters_plus['iota'] = np.arccos(np.cos(parameters['iota']) + offset_cosi)
parameters_plus['theta_jn'] = np.arccos(np.cos(parameters['theta_jn']) + offset_cosi)
h_wave_1_plus, h_wave_2_plus, h_wave_3_plus = WaveForm_ThreeDetectors(parameters_plus, start_time, minimum_frequency, interferometers)
......@@ -87,9 +87,9 @@ def h_dh_Generation_ThreeDetectors(parameters, start_time, minimum_frequency, in
dh_Wave_2[0] = (h_wave_2_plus-h_wave_2)/offset_cosi
dh_Wave_3[0] = (h_wave_3_plus-h_wave_3)/offset_cosi
# If we are at the boundary where iota = 0, we only do a backward difference in cos(iota)
elif np.cos(parameters['iota']) + offset_cosi > 1:
elif np.cos(parameters['theta_jn']) + offset_cosi > 1:
parameters_minus = parameters.copy()
parameters_minus['iota'] = np.arccos(np.cos(parameters['iota'])-offset_cosi)
parameters_minus['theta_jn'] = np.arccos(np.cos(parameters['theta_jn'])-offset_cosi)
h_wave_1_minus, h_wave_2_minus, h_wave_3_minus = WaveForm_ThreeDetectors(parameters_minus, start_time, minimum_frequency, interferometers)
......@@ -99,10 +99,10 @@ def h_dh_Generation_ThreeDetectors(parameters, start_time, minimum_frequency, in
# Otherwise we keep the central difference
else:
parameters_minus = parameters.copy()
parameters_minus['iota'] = np.arccos(np.cos(parameters['iota'])-offset_cosi)
parameters_minus['theta_jn'] = np.arccos(np.cos(parameters['theta_jn'])-offset_cosi)
parameters_plus = parameters.copy()
parameters_plus['iota'] = np.arccos(np.cos(parameters['iota'])+offset_cosi)
parameters_plus['theta_jn'] = np.arccos(np.cos(parameters['theta_jn'])+offset_cosi)
h_wave_1_minus, h_wave_2_minus, h_wave_3_minus = WaveForm_ThreeDetectors(parameters_minus, start_time, minimum_frequency, interferometers)
h_wave_1_plus, h_wave_2_plus, h_wave_3_plus = WaveForm_ThreeDetectors(parameters_plus, start_time, minimum_frequency, interferometers)
......@@ -407,9 +407,9 @@ def dlogL_ThreeDetectors2(signal1, signal2, signal3, parameters, start_time, min
offset_cosi = conf.param_offsets[0]
# Deriving w.r.t. np.cos(inc) where inc = parameters[0]
# If we are at the boundary where iota = +/- pi, we only do a forward difference in cos(iota)
if np.cos(parameters['iota']) - offset_cosi < -1:
if np.cos(parameters['theta_jn']) - offset_cosi < -1:
parameters_plus = parameters.copy()
parameters_plus['iota'] = np.arccos(np.cos(parameters['iota']) + offset_cosi)
parameters_plus['theta_jn'] = np.arccos(np.cos(parameters['theta_jn']) + offset_cosi)
h_wave_1_plus, h_wave_2_plus, h_wave_3_plus = WaveForm_ThreeDetectors(parameters_plus, start_time, minimum_frequency, interferometers)
......@@ -417,9 +417,9 @@ def dlogL_ThreeDetectors2(signal1, signal2, signal3, parameters, start_time, min
dlogL[0] = (logL_plus - logL)/offset_cosi
# If we are at the boundary where iota = 0, we only do a backward difference in cos(iota)
elif np.cos(parameters['iota']) + offset_cosi > 1:
elif np.cos(parameters['theta_jn']) + offset_cosi > 1:
parameters_minus = parameters.copy()
parameters_minus['iota'] = np.arccos(np.cos(parameters['iota'])-offset_cosi)
parameters_minus['theta_jn'] = np.arccos(np.cos(parameters['theta_jn'])-offset_cosi)
h_wave_1_minus, h_wave_2_minus, h_wave_3_minus = WaveForm_ThreeDetectors(parameters_minus, start_time, minimum_frequency, interferometers)
......@@ -429,10 +429,10 @@ def dlogL_ThreeDetectors2(signal1, signal2, signal3, parameters, start_time, min
# Otherwise we keep the central difference
else:
parameters_minus = parameters.copy()
parameters_minus['iota'] = np.arccos(np.cos(parameters['iota'])-offset_cosi)
parameters_minus['theta_jn'] = np.arccos(np.cos(parameters['theta_jn'])-offset_cosi)
parameters_plus = parameters.copy()
parameters_plus['iota'] = np.arccos(np.cos(parameters['iota'])+offset_cosi)
parameters_plus['theta_jn'] = np.arccos(np.cos(parameters['theta_jn'])+offset_cosi)
h_wave_1_minus, h_wave_2_minus, h_wave_3_minus = WaveForm_ThreeDetectors(parameters_minus, start_time, minimum_frequency, interferometers)
h_wave_1_plus, h_wave_2_plus, h_wave_3_plus = WaveForm_ThreeDetectors(parameters_plus, start_time, minimum_frequency, interferometers)
......
......@@ -61,7 +61,7 @@ injection_parameters = dict(
chi_2=0.0,
luminosity_distance=40,
# iota=146*np.pi/180,
# iota=2.81,
iota=2.81,
theta_jn=2.81,
psi=2.21,
phase=5.497787143782138,
......
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