|
14 | 14 | # ============================================================================== |
15 | 15 |
|
16 | 16 | r""" |
17 | | -A module providing some physical units as `Quantity` objects. Note that these |
18 | | -units are not imported by wildcard imports, they |
| 17 | +A module providing some physical constants as `Quantity` objects. Note that these |
| 18 | +constants are not imported by wildcard imports, they |
19 | 19 | have to be imported explicitly. You can use ``import ... as ...`` to import them |
20 | 20 | with shorter names, e.g.:: |
21 | 21 |
|
22 | | - from saiunit.constants import faraday_constant as F |
| 22 | + from saiunit.constants import faraday as F |
23 | 23 |
|
24 | 24 | The available constants are: |
25 | 25 |
|
|
61 | 61 | from ._unit_constants import speed_unit |
62 | 62 |
|
63 | 63 | __all__ = [ |
64 | | - 'arcmin', 'arcminute', 'arcsec', 'arcsecond', 'atomic_mass', 'au', 'astronomical_unit', |
65 | | - 'angstrom', 'atm', 'atmosphere', 'avogadro', 'bar', 'blob', 'boltzmann', 'Btu', 'Btu_IT', |
| 64 | + 'acre', 'arcmin', 'arcminute', 'arcsec', 'arcsecond', 'atomic_mass', 'au', 'astronomical_unit', |
| 65 | + 'angstrom', 'atm', 'atmosphere', 'avogadro', 'bar', 'barrel', 'bbl', 'blob', 'boltzmann', 'Btu', 'Btu_IT', |
66 | 66 | 'Btu_th', 'carat', 'calorie', 'calorie_IT', 'calorie_th', 'day', 'degree', 'degree_Fahrenheit', |
67 | 67 | 'dyn', 'dyne', 'eV', 'electron_mass', 'electric', 'electronvolt', 'elementary_charge', 'erg', |
68 | 68 | 'faraday', 'fermi', 'fluid_ounce', 'fluid_ounce_US', 'fluid_ounce_imp', 'foot', 'gas', 'grain', |
69 | 69 | 'gallon', 'gallon_US', 'gallon_imp', 'gram', 'hectare', 'hour', 'hp', 'horsepower', 'IMF', |
70 | | - 'inch', 'julian_year', 'kelvin', 'kgf', 'kilogram_force', 'knot', 'lb', 'lbf', 'light_year', |
71 | | - 'long_ton', 'mach', 'magnetic', 'meter', 'metric_ton', 'micron', 'mil', 'mile', 'minute', |
| 70 | + 'inch', 'julian_year', 'kelvin', 'kgf', 'kilogram_force', 'kmh', 'knot', 'lb', 'lbf', 'light_year', |
| 71 | + 'long_ton', 'mach', 'magnetic', 'meter', 'metric_ton', 'micron', 'mil', 'mile', 'minute', 'mmHg', |
72 | 72 | 'molar_mass', 'month', 'mph', 'nautical_mile', 'newton', 'ounce', 'oz', 'parsec', 'pica', |
73 | | - 'point', 'pound', 'psi', 'radian', 'second', 'short_ton', 'slug', 'slinch', 'speed_unit', |
| 73 | + 'point', 'pound', 'pound_force', 'psi', 'radian', 'second', 'short_ton', 'slug', 'slinch', 'speed_unit', |
74 | 74 | 'stone', 'survey_foot', 'survey_mile', 'torr', 'troy_ounce', 'troy_pound', 'ton_TNT', 'week', |
75 | | - 'watt', 'year', 'zero_celsius' |
| 75 | + 'watt', 'yard', 'year', 'zero_celsius' |
76 | 76 | ] |
77 | 77 |
|
78 | 78 | #: Avogadro constant (http://physics.nist.gov/cgi-bin/cuu/Value?na) |
|
90 | 90 | #: gas constant (http://physics.nist.gov/cgi-bin/cuu/Value?r) |
91 | 91 | gas = np.asarray(8.3144598) * (joule / mole / kelvin) |
92 | 92 | #: Magnetic constant (http://physics.nist.gov/cgi-bin/cuu/Value?mu0) |
93 | | -magnetic = np.asarray(4 * np.pi * 1e-7) * (newton / amp ** 2) |
| 93 | +magnetic = np.asarray(1.25663706212e-6) * (newton / amp ** 2) |
94 | 94 | #: Molar mass constant (http://physics.nist.gov/cgi-bin/cuu/Value?mu) |
95 | | -molar_mass = np.asarray(1.) * (gram / mole) |
| 95 | +molar_mass = np.asarray(1e-3) * (kilogram / mole) |
96 | 96 | #: zero degree Celsius |
97 | 97 | zero_celsius = np.asarray(273.15) * kelvin |
98 | 98 |
|
|
161 | 161 | bbl = barrel = np.asarray(1.58987294928e2) * meter3 # Barrel (oil) |
162 | 162 |
|
163 | 163 | # ----- Temperature ----- |
164 | | -degree_Fahrenheit = np.asarray(2.55927778e2) * kelvin # Fahrenheit |
| 164 | +# Note: Fahrenheit is a temperature scale, not a unit. Use conversion functions instead. |
| 165 | +# This constant represents the conversion factor from Fahrenheit to Kelvin degrees |
| 166 | +degree_Fahrenheit = np.asarray(5/9) * kelvin # Fahrenheit degree size in Kelvin |
165 | 167 |
|
166 | 168 | # ----- Speed ----- |
167 | 169 | kmh = np.asarray(2.77777778e-1) * speed_unit # Kilometer per hour |
|
0 commit comments