|
4 | 4 |
|
5 | 5 | import numpy |
6 | 6 | from . import constants |
| 7 | +from . import astronomical_constants |
7 | 8 | from . import quantities |
8 | 9 |
|
9 | 10 | # The two imports below are to explicitly expose everything directly used in |
|
43 | 44 |
|
44 | 45 | # astronomical units |
45 | 46 | angstrom = named("angstrom", "angstrom", 1e-10 * m) |
46 | | -au = named("astronomical unit", "au", 149597870691.0 * m) |
47 | | -aud = named("au per day", "aud", 149597870691.0 * m / day) |
48 | | -parsec = named("parsec", "parsec", au / numpy.tan(numpy.pi / (180 * 60 * 60))) |
| 47 | +au = named("astronomical unit", "au", astronomical_constants.au.as_unit()) |
| 48 | +aud = named("au per day", "aud", astronomical_constants.au.as_unit() / day) |
| 49 | +parsec = named("parsec", "parsec", astronomical_constants.parsec.as_unit()) |
49 | 50 | kpc = named("kilo parsec", "kpc", 10**3 * parsec) |
50 | 51 | Mpc = named("mega parsec", "Mpc", 10**6 * parsec) |
51 | 52 | Gpc = named("giga parsec", "Gpc", 10**9 * parsec) |
52 | | -lightyear = named("light year", "ly", 9460730472580.8 * km) |
53 | | -LSun = named("solar luminosity", "LSun", 3.839e26 * W) |
54 | | -MSun = named("solar mass", "MSun", 1.98892e30 * kg) |
55 | | -RSun = named("solar radius", "RSun", 6.955e8 * m) |
56 | | -MJupiter = named("jupiter mass", "MJupiter", 1.8987e27 * kg) |
57 | | -RJupiter = named("jupiter radius", "RJupiter", 71492.0 * km) |
58 | | -MEarth = named("earth mass", "MEarth", 5.9722e24 * kg) |
59 | | -REarth = named("earth radius", "REarth", 6371.0088 * km) # IUGG mean radius |
| 53 | +lightyear = named("light year", "ly", astronomical_constants.lightyear.as_unit()) |
| 54 | +LSun = named("solar luminosity", "LSun", astronomical_constants.Lsun.as_unit()) |
| 55 | +MSun = named("solar mass", "MSun", astronomical_constants.Msun.as_unit()) |
| 56 | +RSun = named("solar radius", "RSun", astronomical_constants.Rsun.as_unit()) |
| 57 | +MJupiter = named("jupiter mass", "MJupiter", astronomical_constants.Mjupiter.as_unit()) |
| 58 | +RJupiter = named("jupiter radius", "RJupiter", astronomical_constants.Rjupiter.as_unit()) |
| 59 | +MEarth = named("earth mass", "MEarth", astronomical_constants.Mearth.as_unit()) |
| 60 | +REarth = named("earth radius", "REarth", astronomical_constants.Rearth.as_unit()) |
60 | 61 | kyr = named("kilo year", "kyr", 1000 * yr) |
61 | 62 | myr = named("million year", "Myr", 1000000 * yr) |
62 | 63 | gyr = named("giga (billion) year", "Gyr", 1000000000 * yr) |
|
0 commit comments