aboutsummaryrefslogtreecommitdiffstats
path: root/Commons
diff options
context:
space:
mode:
authorVolker Hoffmann <volker@cheleb.net>2014-05-26 11:40:21 +0200
committerVolker Hoffmann <volker@cheleb.net>2014-05-26 11:40:21 +0200
commit4e663c569a3d1e462e5ad80fdd0505291af5274a (patch)
tree0865f8439b1788062ffce1958605fe43c326feac /Commons
parent6f773aca6f80dfde68eec91bd4ca946b6735b60c (diff)
added some comments about velocity unit
Diffstat (limited to 'Commons')
-rw-r--r--Commons/Loaders.py43
-rw-r--r--Commons/Structs.py5
2 files changed, 30 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()
diff --git a/Commons/Structs.py b/Commons/Structs.py
index 5bb93a9..2b33c56 100644
--- a/Commons/Structs.py
+++ b/Commons/Structs.py
@@ -11,8 +11,13 @@ class Particle():
Orbital Phase (Mean Anomaly) - M0 - [rad]
XYZ-Position - x, y, z - [AU]
XYZ-Velocity - vx, vy, vz - [AU/yr]
+ - [AU/day/0.01720209895]
Particle Mass - m - [Msun]
Particle ID - id - []
+
+ To convert velocities to km/s, do *au2km/24.0/3600.0*0.0172020989.
+
+ NB: For G=M=1, 1 Year = 2 Pi (From Kepler's Third Law).
"""
def __init__(self):
# General