|
3 | 3 | """ |
4 | 4 |
|
5 | 5 | import numpy |
6 | | -from amuse.units.si import ( |
7 | | - named, |
8 | | - s, |
9 | | - m, |
10 | | - kg, |
11 | | - none, |
12 | | - core, |
13 | | -) |
14 | | -from amuse.units.derivedsi import ( |
15 | | - km, |
16 | | - V, |
17 | | - W, |
18 | | - J, |
19 | | - Pa, |
20 | | - rad, |
21 | | -) |
22 | | -from amuse.units.si import * |
23 | | -from amuse.units.derivedsi import * |
24 | | -from amuse.units import constants |
| 6 | +from . import constants |
25 | 7 | from . import quantities |
26 | 8 |
|
| 9 | +# The two imports below are to explicitly expose everything directly used in |
| 10 | +# this module. |
| 11 | +from .si import (named, s, m, kg, none, core, no_unit,) |
| 12 | +from .derivedsi import (km, V, W, J, Pa, rad,) |
| 13 | + |
| 14 | +# importing * from si and derivedsi since we do want all of the units in these |
| 15 | +# modules, and we don't want to repeat everything here. |
| 16 | +from .si import * |
| 17 | +from .derivedsi import * |
| 18 | +from .stellar_types import stellar_type |
| 19 | + |
27 | 20 | # misc every day |
28 | 21 | minute = named("minute", "min", 60.0 * s) |
29 | 22 | hour = named("hour", "hr", 60.0 * minute) |
|
57 | 50 | Mpc = named("mega parsec", "Mpc", 10**6 * parsec) |
58 | 51 | Gpc = named("giga parsec", "Gpc", 10**9 * parsec) |
59 | 52 | lightyear = named("light year", "ly", 9460730472580.8 * km) |
60 | | -# lightyear = named('light year', 'ly', c*julianyr) |
61 | 53 | LSun = named("solar luminosity", "LSun", 3.839e26 * W) |
62 | 54 | MSun = named("solar mass", "MSun", 1.98892e30 * kg) |
63 | 55 | RSun = named("solar radius", "RSun", 6.955e8 * m) |
|
99 | 91 |
|
100 | 92 | string = core.string_unit("string", "string") |
101 | 93 |
|
102 | | -stellar_type = core.enumeration_unit( |
103 | | - "stellar_type", |
104 | | - "stellar_type", |
105 | | - None, |
106 | | - [ |
107 | | - "deeply or fully convective low mass MS star", # 0 |
108 | | - "Main Sequence star", # 1 |
109 | | - "Hertzsprung Gap", # 2 |
110 | | - "First Giant Branch", # 3 |
111 | | - "Core Helium Burning", # 4 |
112 | | - "First Asymptotic Giant Branch", # 5 |
113 | | - "Second Asymptotic Giant Branch", # 6 |
114 | | - "Main Sequence Naked Helium star", # 7 |
115 | | - "Hertzsprung Gap Naked Helium star", # 8 |
116 | | - "Giant Branch Naked Helium star", # 9 |
117 | | - "Helium White Dwarf", # 10 |
118 | | - "Carbon/Oxygen White Dwarf", # 11 |
119 | | - "Oxygen/Neon White Dwarf", # 12 |
120 | | - "Neutron Star", # 13 |
121 | | - "Black Hole", # 14 |
122 | | - "Massless Supernova", # 15 |
123 | | - "Unknown stellar type", # 16 |
124 | | - "Pre-main-sequence Star", # 17 |
125 | | - "Planet", # 18 |
126 | | - "Brown Dwarf", # 19 |
127 | | - ], |
128 | | -) |
129 | | - |
130 | 94 | # special unit for keys of particles |
131 | 95 | object_key = core.key_unit("object_key", "key") |
132 | 96 |
|
133 | 97 | # angles |
134 | | -# rad=named('radian','rad',m/m) (defined in derivedsi.py) |
135 | 98 | pi = numpy.pi | rad |
136 | 99 | rev = named("revolutions", "rev", (2 * numpy.pi) * rad) |
137 | 100 | deg = named("degree", "deg", (numpy.pi / 180) * rad) |
|
0 commit comments