Skip to content

Commit 3f661af

Browse files
committed
Lightyear is a physical constant (julianyr * lightspeed), not astronomical
1 parent 54e26e9 commit 3f661af

4 files changed

Lines changed: 4 additions & 2 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# constants as originally defined/used in AMUSE

src/amuse/units/astronomical_constants.py renamed to src/amuse/units/amuse_2010/astronomical_constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
from amuse.units.si import m, kg
88
from amuse.units.derivedsi import W, km
99

10+
1011
au = 149597870691.0 | m
1112
parsec = au / np.tan(np.pi / (180 * 60 * 60))
12-
lightyear = 9460730472580.8 | km
1313
Lsun = 3.839e26 | W
1414
Msun = 1.98892e30 | kg
1515
Rsun = 6.955e8 | m

src/amuse/units/units.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import numpy
66
from . import constants
7+
from . import physical_constants
78
from . import astronomical_constants
89
from . import quantities
910

@@ -50,7 +51,7 @@
5051
kpc = named("kilo parsec", "kpc", 10**3 * parsec)
5152
Mpc = named("mega parsec", "Mpc", 10**6 * parsec)
5253
Gpc = named("giga parsec", "Gpc", 10**9 * parsec)
53-
lightyear = named("light year", "ly", astronomical_constants.lightyear.as_unit())
54+
lightyear = named("light year", "ly", (physical_constants.c * julianyr).as_unit())
5455
LSun = named("solar luminosity", "LSun", astronomical_constants.Lsun.as_unit())
5556
MSun = named("solar mass", "MSun", astronomical_constants.Msun.as_unit())
5657
RSun = named("solar radius", "RSun", astronomical_constants.Rsun.as_unit())

0 commit comments

Comments
 (0)