Commit 3ac67c5f authored by Roland Haas's avatar Roland Haas
Browse files

Nakona: remove excessive parens from expressions

parent b70c3108
......@@ -577,36 +577,40 @@ def eq_29(sim_path, radii_list, modes):
strain = psi4ToStrain2(news, f0)
if (radius, (l+1,m)) in dsets:
# TODO: throw an error when a physical mode is not present in the file?
modes_a = dsets[(radius, (l+1,m))] # "top" modes
ar_a = loadHDF5Series(simdirs+'mp_psi4.h5' , modes_a)
psi_a = np.column_stack((ar_a[:,0], ar_a[:,1] + 1j * ar_a[:,2]))
dt_psi_a = np.column_stack((psi_a[:,0], np.gradient(psi_a[:,1], psi_a[:,0])))
B = 2.j*a/(l+1.)**2*np.sqrt((l+3.)*(l-1)*(l+m+1.)*(l-m+1.)/((2.*l+1.)*(2.*l+3.)))
b_1 = radius
b_2 = l*(l+3.)
else:
psi_a = np.zeros_like(psi) # ...fill psi_a and impsi_a arrays with zeros (mode is unphysical)
dt_psi_a = np.zeros_like(psi) # ...fill psi_a and impsi_a arrays with zeros (mode is unphysical)
B = 0.
b_1 = 0.
b_2 = 0.
if m > l-1: # if m is greater than the bottom mode...
psi_b = np.zeros_like(psi) # ...fill psi_b and impsi_b arrays with zeros (mode is unphysical)
dt_psi_b = np.zeros_like(psi) # ...fill psi_b and impsi_b arrays with zeros (mode is unphysical)
C = 0.
c_1 = 0.
c_2 = 0.
else:
modes_b = dsets[(radius, (l-1, m))] # "bottom" modes
ar_b = loadHDF5Series(simdirs+'mp_psi4.h5' , modes_b)
psi_b = np.column_stack((ar_b[:,0], ar_b[:,1] + 1j * ar_b[:,2]))
dt_psi_b = np.column_stack((psi_b[:,0], np.gradient(psi_b[:,1], psi_b[:,0])))
r = radius
A = 1-(2*M/r)
a_1 = r
a_2 = ((l-1)*(l+2))/(2*r)
a_3 = ((l-1)*(l+2)*(l**2 + l -4))/(8*r*r)
B = ((0+a*2j)/((l+1)**2))*((((l+3)*(l-1)*(l+m+1)*(l-m+1))/((2*l+1)*(2*l+3)))**(1/2))
b_1 = r
b_2 = l*(l+3)
C = ((0+a*2j)/((l)**2))*((((l+2)*(l-2)*(l+m)*(l-m))/((2*l-1)*(2*l+1)))**(1/2))
c_1 = r
c_2 = (l-2)*(l+1)
C = 2.j*a/l**2*np.sqrt((l+2.)*(l-2.)*(l+m)*(l-m)/((2.*l-1.)*(2.*l+1.)))
c_1 = radius
c_2 = (l-2.)*(l+1.)
A = 1.-(2.*M/radius)
a_1 = radius
a_2 = (l-1.)*(l+2.)/(2.*radius)
a_3 = (l-1.)*(l+2.)*(l**2 + l - 4.)/(8*radius*radius)
extrapolated_psi_data = A*(a_1*psi[:,1] - a_2*news[:,1] + a_3*strain[:,1]) + B*(b_1*dt_psi_a[:,1] - b_2*psi_a[:,1]) - C*(c_1*dt_psi_b[:,1] - c_2*psi_b[:,1])
......
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