...
 
Commits (3)
......@@ -126,7 +126,9 @@ def psi4ToStrain(mp_psi4, f0):
hf = ffi(freq, dhf, f0)
time, h = myFourierTransformInverse(freq, hf, t0[0])
hTable = np.column_stack((time, h))
# we have d^2(h+ -i hx)/dt^2 = psi4 ie the sign of the imaginary part
# needs to be flipped
hTable = np.column_stack((time, h.conj()))
return hTable
#Fixed frequency integration
......@@ -461,11 +463,11 @@ if __name__ == "__main__":
mp_psi4_vars[i][:, 2] *= radii[i]
#Check for psi4 amplitude going to zero
cur_psi4_amp = (mp_psi4_vars[i][0, 1]**2 + mp_psi4_vars[i][0, 2]**2)**(1/2)
cur_psi4_amp = np.sqrt(mp_psi4_vars[i][0, 1]**2 + mp_psi4_vars[i][0, 2]**2)
min_psi4_amp = cur_psi4_amp
# TODO: use array notatino for this since it finds the minimum amplitude
for j in range(0, len(mp_psi4_vars[i][:, 0])):
cur_psi4_amp = (mp_psi4_vars[i][j, 1]**2 + mp_psi4_vars[i][j, 2]**2)**(1/2)
cur_psi4_amp = np.sqrt(mp_psi4_vars[i][j, 1]**2 + mp_psi4_vars[i][j, 2]**2)
if(cur_psi4_amp < min_psi4_amp):
min_psi4_amp = cur_psi4_amp
if(min_psi4_amp < np.finfo(float).eps and l >= 2):
......@@ -485,8 +487,6 @@ if __name__ == "__main__":
#Get phase and amplitude of strain
h_phase = np.unwrap(np.angle(h))
while(h_phase[0] < 0):
h_phase[:] += 2*math.pi
angleTable = np.column_stack((time, h_phase))
angleTable = angleTable.astype(float)
phase.append(angleTable)
......@@ -514,8 +514,10 @@ if __name__ == "__main__":
for i in range(0, radiiUsedForExtrapolation):
interp_function = scipy.interpolate.interp1d(phase[i][:, 0], phase[i][:, 1], kind=interpolation_order)
resampled_phase_vals = interp_function(t)
while(resampled_phase_vals[0] < 0):
resampled_phase_vals[:] += 2*math.pi
# try and keep all initial phases within 2pi of each other
if(i > 0):
phase_shift = round((resampled_phase_vals[0] - phase[0][0,1])/(2.*math.pi))*2.*math.pi
resampled_phase_vals -= phase_shift
phase[i] = np.column_stack((t, resampled_phase_vals))
interp_function = scipy.interpolate.interp1d(amp[i][:, 0], amp[i][:, 1], kind=interpolation_order)
resampled_amp_vals = interp_function(t)
......