aboutsummaryrefslogtreecommitdiffstats
path: root/Commons/Loaders.py
diff options
context:
space:
mode:
Diffstat (limited to 'Commons/Loaders.py')
-rw-r--r--Commons/Loaders.py43
1 files changed, 25 insertions, 18 deletions
diff --git a/Commons/Loaders.py b/Commons/Loaders.py
index f9bec67..1aa422e 100644
--- a/Commons/Loaders.py
+++ b/Commons/Loaders.py
@@ -1,3 +1,10 @@
+"""
+Loading Routines.
+
+NB: For G=M=1, 1 Yr = 2 Pi.
+ Hence the velocity (1 Day = 2 pi / 365.25 ~ 0.0172020989)
+"""
+
from Structs import Snapshot, Particle
import numpy as np
@@ -29,15 +36,15 @@ class GengaOut(Loader):
self.snapshot.tout = float(line[0]) # yr
first = False
particle = Particle()
- particle.id = float(line[1]) # -
- particle.m = float(line[2]) # Msun
- particle.r = float(line[3]) #
- particle.x = float(line[4])
- particle.y = float(line[5])
- particle.z = float(line[6])
- particle.vx = float(line[7])
- particle.vy = float(line[8])
- particle.vz = float(line[9])
+ particle.id = float(line[1]) # -
+ particle.m = float(line[2]) # Msun
+ particle.r = float(line[3]) # AU
+ particle.x = float(line[4]) # AU
+ particle.y = float(line[5]) # AU
+ particle.z = float(line[6]) # AU
+ particle.vx = float(line[7]) # AU/day/0.0172020989 = AU/yr
+ particle.vy = float(line[8]) # AU/day/0.0172020989 = AU/yr
+ particle.vz = float(line[9]) # AU/day/0.0172020989 = AU/yr
particle.cart2kep()
if self.snapshot.ellipses:
particle.compute_ellipse()
@@ -61,15 +68,15 @@ class SSAscii(Loader):
self.snapshot.tout = float(line[0]) / 2. / np.pi # TU -> yr
first = False
particle = Particle()
- particle.id = float(line[1])
- particle.m = float(line[2])
- particle.r = float(line[3])
- particle.x = float(line[4])
- particle.y = float(line[5])
- particle.z = float(line[6])
- particle.vx = float(line[7])
- particle.vy = float(line[8])
- particle.vz = float(line[9])
+ particle.id = float(line[1]) # -
+ particle.m = float(line[2]) # Msun
+ particle.r = float(line[3]) # AU
+ particle.x = float(line[4]) # AU
+ particle.y = float(line[5]) # AU
+ particle.z = float(line[6]) # AU
+ particle.vx = float(line[7]) # AU/day/0.0172020989 = AU/yr
+ particle.vy = float(line[8]) # AU/day/0.0172020989 = AU/yr
+ particle.vz = float(line[9]) # AU/day/0.0172020989 = AU/yr
particle.cart2kep()
if self.snapshot.ellipses:
particle.compute_ellipse()