Commit 13b338ce authored by Tobias Hangleiter's avatar Tobias Hangleiter
Browse files

Merge branch 'tobias' of https://git.rwth-aachen.de/qutech/qutil into tobias

parents 2094bdc1 aba1cec3
"""
This module defines constants, mostly wrapped from scipy. Many constants are in
the top-level namespace. Many more are in the dictionary ``physical_constants``
that can be searched using :meth:`find` and accessed using :meth:`value`.
On top of the scipy constants, the following shorthands are defined:
``e2`` : :math:`e^2`
``pi2`` : :math:`\pi/2`
``pi4`` : :math:`\pi/4`
``tpi`` : :math:`2\pi`
``fpi`` : :math:`4\pi`
Functions
---------
:meth:`convert_temperature` :
Convert temperature between different scales
:meth:`find` :
Find constants in the ``physical_constants`` dictionary matching a string
:meth:`lambda2nu` :
Convert wavelength to frequency
:meth:`nu2lambda` :
Convert frequency to wavelength
:meth:`unit` :
Get the unit of a constant in the ``physical_constants`` dictionary.
:meth:`value` :
Get the value of a constant in the ``physical_constants`` dictionary.
:meth:`precision` :
Get the precision of a constant in the ``physical_constants`` dictionary.
"""
from scipy.constants import (
Avogadro,
Boltzmann,
Btu,
Btu_IT,
Btu_th,
G,
Julian_year,
N_A,
Planck,
R,
Rydberg,
Stefan_Boltzmann,
Wien,
acre,
alpha,
angstrom,
arcmin,
arcminute,
arcsec,
arcsecond,
astronomical_unit,
atm,
atmosphere,
atomic_mass,
atto,
au,
bar,
barrel,
bbl,
blob,
c,
calorie,
calorie_IT,
calorie_th,
carat,
centi,
convert_temperature,
day,
deci,
degree,
degree_Fahrenheit,
deka,
dyn,
dyne,
e,
eV,
electron_mass,
electron_volt,
elementary_charge,
epsilon_0,
erg,
exa,
exbi,
femto,
fermi,
find,
fine_structure,
fluid_ounce,
fluid_ounce_US,
fluid_ounce_imp,
foot,
g,
gallon,
gallon_US,
gallon_imp,
gas_constant,
gibi,
giga,
golden,
golden_ratio,
grain,
gram,
gravitational_constant,
h,
hbar,
hectare,
hecto,
horsepower,
hour,
hp,
inch,
k,
kgf,
kibi,
kilo,
kilogram_force,
kmh,
knot,
lambda2nu,
lb,
lbf,
light_year,
liter,
litre,
long_ton,
m_e,
m_n,
m_p,
m_u,
mach,
mebi,
mega,
metric_ton,
micro,
micron,
mil,
mile,
milli,
minute,
mmHg,
mph,
mu_0,
nano,
nautical_mile,
neutron_mass,
nu2lambda,
ounce,
oz,
parsec,
pebi,
peta,
physical_constants,
pi,
pico,
point,
pound,
pound_force,
precision,
proton_mass,
psi,
pt,
short_ton,
sigma,
slinch,
slug,
speed_of_light,
speed_of_sound,
stone,
survey_foot,
survey_mile,
tebi,
tera,
ton_TNT,
torr,
troy_ounce,
troy_pound,
u,
unit,
value,
week,
yard,
year,
yobi,
yotta,
zebi,
zepto,
zero_Celsius,
zetta
)
e2 = e**2
pi2 = pi/2
pi4 = pi/4
tpi = pi*2
fpi = pi*4
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment