Added spins to config file and got rid of more _act arrays
This commit is contained in:
parent
ebec3280f8
commit
75ad0f0e89
4 changed files with 178 additions and 185 deletions
10
init.py
10
init.py
|
|
@ -13,7 +13,7 @@ def gen_plum(N, seed=None, RMAX=10):
|
|||
X = np.sqrt(R**2 - Z**2) * np.cos(2*np.pi*X3)
|
||||
Y = np.sqrt(R**2 - Z**2) * np.sin(2*np.pi*X3)
|
||||
|
||||
Ve = np.sqrt(2)*(1.0 + R**2)**(-0.25);
|
||||
Ve = np.sqrt(2)*(1.0 + R**2)**(-0.25)
|
||||
|
||||
X4, X5 = 0, 0
|
||||
while 0.1*X5 >= X4**2*(1-X4**2)**3.5:
|
||||
|
|
@ -22,9 +22,9 @@ def gen_plum(N, seed=None, RMAX=10):
|
|||
V = Ve*X4
|
||||
X6, X7 = np.random.random(2)
|
||||
|
||||
Vz = (1 - 2*X6)*V;
|
||||
Vx = np.sqrt(V**2 - Vz**2) * np.cos(2*np.pi*X7);
|
||||
Vy = np.sqrt(V**2 - Vz**2) * np.sin(2*np.pi*X7);
|
||||
Vz = (1 - 2*X6)*V
|
||||
Vx = np.sqrt(V**2 - Vz**2) * np.cos(2*np.pi*X7)
|
||||
Vy = np.sqrt(V**2 - Vz**2) * np.sin(2*np.pi*X7)
|
||||
|
||||
X, Y, Z = np.array([X, Y, Z])*3*np.pi/16
|
||||
Vx, Vy, Vz = np.array([Vx, Vy, Vz])/np.sqrt(3*np.pi/16)
|
||||
|
|
@ -38,7 +38,7 @@ def kepler_to_cartesian(a, e, i, Omega, w, nu, G=1.0, M=1.0):
|
|||
result = []
|
||||
for arg in args: result.append(np.atleast_1d(arg))
|
||||
return result
|
||||
a, e, i, Omega, w, nu = to_arrays(a, e, i, Omega, w, nu)
|
||||
a, e, i, Omega, w, nu = to_arrays(a, e, i, Omega, w, nu) # pylint: disable=unbalanced-tuple-unpacking
|
||||
P = [np.cos(w)*np.cos(Omega) - np.sin(w)*np.cos(i)*np.sin(Omega),
|
||||
np.cos(w)*np.sin(Omega) + np.sin(w)*np.cos(i)*np.cos(Omega),
|
||||
np.sin(w)*np.sin(i)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue