Skip to content
Snippets Groups Projects
Commit f8095131 authored by Gregory Ashton's avatar Gregory Ashton
Browse files

Reformatting only

Fixes a few minor syntax errors and reformat the code for readability
parent de2b3831
No related branches found
No related tags found
1 merge request!52Burst
......@@ -51,7 +51,9 @@ def lal_binary_black_hole(
return {'plus': h_plus, 'cross': h_cross}
def sinegaussian(frequency_array, hrss, Q, frequency, ra, dec, geocent_time, psi):
def sinegaussian(
frequency_array, hrss, Q, frequency, ra, dec, geocent_time, psi):
tau = Q / (np.sqrt(2.0)*np.pi*frequency)
temp = Q / (4.0*np.sqrt(np.pi)*frequency)
......@@ -59,38 +61,53 @@ def sinegaussian(frequency_array, hrss, Q, frequency, ra, dec, geocent_time, psi
fm = frequency_array - frequency
fp = frequency_array + frequency
h_plus = (hrss / np.sqrt(temp * (1+np.exp(-Q**2)))) * ((np.sqrt(np.pi)*tau)/2.0) * (np.exp(-fm**2 * np.pi**2 * tau**2) + np.exp(-fp**2 * np.pi**2 * tau**2))
h_cross = -1j*(hrss / np.sqrt(temp * (1-np.exp(-Q**2)))) * ((np.sqrt(np.pi)*tau)/2.0) * (np.exp(-fm**2 * np.pi**2 * tau**2) - np.exp(-fp**2 * np.pi**2 * tau**2))
h_plus = ((hrss / np.sqrt(temp * (1+np.exp(-Q**2))))
* ((np.sqrt(np.pi)*tau)/2.0)
* (np.exp(-fm**2 * np.pi**2 * tau**2)
+ np.exp(-fp**2 * np.pi**2 * tau**2)))
h_cross = (-1j*(hrss / np.sqrt(temp * (1-np.exp(-Q**2))))
* ((np.sqrt(np.pi)*tau)/2.0)
* (np.exp(-fm**2 * np.pi**2 * tau**2)
- np.exp(-fp**2 * np.pi**2 * tau**2)))
return{'plus': h_plus, 'cross': h_cross}
def supernova(frequency_array, realPCs, imagPCs, file_path, luminosity_distance, ra, dec, geocent_time, psi):
def supernova(
frequency_array, realPCs, imagPCs, file_path, luminosity_distance, ra,
dec, geocent_time, psi):
""" A supernova NR simulation for injections """
realhplus, imaghplus, realhcross, imaghcross = np.loadtxt(file_path, usecols = (0,1,2,3), unpack=True)
realhplus, imaghplus, realhcross, imaghcross = np.loadtxt(
file_path, usecols=(0, 1, 2, 3), unpack=True)
# waveform in file at 10kpc
scaling = 1e-3 * (10.0 / luminosity_distance)
scaling = 1e-3 * (10.0 / luminosity_distance)
h_plus = scaling * (realhplus + 1.0j*imaghplus)
h_cross = scaling * (realhcross + 1.0j*imaghcross)
return {'plus': h_plus, 'cross': h_cross}
def supernova_pca_model(frequency_array, realPCs, imagPCs, pc_coeff1, pc_coeff2, pc_coeff3, pc_coeff4, pc_coeff5, luminosity_distance, ra, dec, geocent_time, psi):
def supernova_pca_model(
frequency_array, realPCs, imagPCs, pc_coeff1, pc_coeff2, pc_coeff3,
pc_coeff4, pc_coeff5, luminosity_distance, ra, dec, geocent_time, psi):
""" Supernova signal model """
pc1 = realPCs[:,0] + 1.0j*imagPCs[:,0]
pc2 = realPCs[:,1] + 1.0j*imagPCs[:,1]
pc3 = realPCs[:,2] + 1.0j*imagPCs[:,2]
pc4 = realPCs[:,3] + 1.0j*imagPCs[:,3]
pc5 = realPCs[:,4] + 1.0j*imagPCs[:,5]
pc1 = realPCs[:, 0] + 1.0j*imagPCs[:, 0]
pc2 = realPCs[:, 1] + 1.0j*imagPCs[:, 1]
pc3 = realPCs[:, 2] + 1.0j*imagPCs[:, 2]
pc4 = realPCs[:, 3] + 1.0j*imagPCs[:, 3]
pc5 = realPCs[:, 4] + 1.0j*imagPCs[:, 5]
# file at 10kpc
scaling = 1e-23 * (10.0 / luminosity_distance)
scaling = 1e-23 * (10.0 / luminosity_distance)
h_plus = scaling * (pc_coeff1*pc1 + pc_coeff2*pc2 + pc_coeff3*pc3 + pc_coeff4*pc4 + pc_coeff5*pc5)
h_cross = scaling * (pc_coeff1*pc1 + pc_coeff2*pc2 + pc_coeff3*pc3 + pc_coeff4*pc4 + pc_coeff5*pc5)
h_plus = scaling * (pc_coeff1*pc1 + pc_coeff2*pc2 + pc_coeff3*pc3
+ pc_coeff4*pc4 + pc_coeff5*pc5)
h_cross = scaling * (pc_coeff1*pc1 + pc_coeff2*pc2 + pc_coeff3*pc3
+ pc_coeff4*pc4 + pc_coeff5*pc5)
return {'plus': h_plus, 'cross': h_cross}
......
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