Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pyLIAF
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nicolas Nunez Barreto
pyLIAF
Commits
68124d65
Commit
68124d65
authored
Jun 12, 2021
by
Lucas Giardino
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
agrego valores comunes, unidades, etc
parent
7eacdc4e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
115 additions
and
0 deletions
+115
-0
common_values.py
pyLIAF/common_values.py
+115
-0
No files found.
pyLIAF/common_values.py
View file @
68124d65
"""
Units and constants commonly used in physics, with the numeric value being
expressed in the respective SI base units.
some of this is extracted from:
https://github.com/OxfordIonTrapGroup/oitg/blob/master/oitg/units.py
"""
import
math
# Constants {{{
pi
=
math
.
pi
e
=
1.602176565e-19
;
# 1.602 176 565(35) x 10-19 C : CODATA 2010 : Electron charge
g
=
9.80665
;
# m/s^2
kB
=
1.3806488e-23
;
# 1.380 6488(13) x 10-23 J K-1 : CODATA 2010 : Boltzmann constant
sigma_SB
=
5.670373e-8
;
# 5.670 373(21) x 10-8 W m-2 K-4 : CODATA 2010 : Stefan-Boltzmann constant
h
=
6.62606957e-34
;
# 6.626 069 57(29) x 10-34 J s : CODATA 2010 : Planck constant
hbar
=
h
/
(
2
*
pi
);
mu_B
=
927.400968e-26
;
# 927.400 968(20) x 10-26 J T-1 : CODATA 2010 : Bohr magneton
mu_N
=
5.05078353e-27
;
# 5.050 783 53(11) x 10-27 J T-1 : CODATA 2010 : Nuclear magneton
c
=
299792458.
;
# 299 792 458 m s-1 (exact) : CODATA 2010 : Speed of light in vacuum
mu0
=
4
*
pi
*
1e-7
;
# 4*pi*1e-7 (exact) : Definition of magnetic constant
eps0
=
1
/
(
mu0
*
c
**
2
);
# 1/(mu0*c^2) (exact) : Definition of electric constant
alpha
=
7.2973525698e-3
;
# 7.297 352 5698(24) x 10-3 : CODATA 2010 : Fine structure constant
gS
=
2.00231930436153
;
# 2.002 319 304 361 53(53) : CODATA 2010 : Electron g factor
# }}}
# Lasers {{{
class
_Light
():
def
__init__
(
self
,
long
=
None
,
freq
=
None
):
if
long
:
self
.
wavelength
=
long
self
.
frequency
=
c
/
long
elif
freq
:
self
.
frequency
=
freq
self
.
wavelength
=
c
/
freq
else
:
raise
Exception
(
"Must have wavelength or frequency"
)
repump_laser
=
_Light
(
long
=
866.451
)
doppler_laser
=
_Light
(
long
=
396.959
)
photoion_laser
=
_Light
(
long
=
422.792
)
# }}}
# Length {{{
m
=
1.
;
km
=
1e3
*
m
;
cm
=
1e-2
*
m
;
mm
=
1e-3
*
m
;
um
=
1e-6
*
m
;
nm
=
1e-9
*
m
;
a0
=
5.2917721092e-11
*
m
;
# 5.2917721092(17)×10-11 m : CODATA 2010 : Bohr radius
# }}}
# Time {{{
s
=
1.
;
ms
=
1e-3
*
s
;
us
=
1e-6
*
s
;
ns
=
1e-9
*
s
;
ps
=
1e-12
*
s
;
fs
=
1e-15
*
s
;
minute
=
60
*
s
;
hr
=
60
*
minute
;
day
=
24
*
hr
;
year
=
365.242199
*
day
;
# }}}
# Frequency {{{
Hz
=
1
/
s
;
kHz
=
1e3
*
Hz
;
MHz
=
1e6
*
Hz
;
GHz
=
1e9
*
Hz
;
THz
=
1e12
*
Hz
;
# }}}
# Energy {{{
J
=
1.
;
MJ
=
1e6
*
J
;
kJ
=
1e3
*
J
;
mJ
=
1e-3
*
J
;
uJ
=
1e-6
*
J
;
nJ
=
1e-9
*
J
;
pJ
=
1e-12
*
J
;
eV
=
e
;
BTU
=
1.0550559e3
*
J
;
kWh
=
3.6e6
*
J
;
cal
=
4.1868
*
J
;
kCal
=
1e3
*
cal
;
# }}}
# Power {{{
W
=
1.
;
MW
=
1e6
*
W
;
kW
=
1e3
*
W
;
mW
=
1e-3
*
W
;
uW
=
1e-6
*
W
;
nW
=
1e-9
*
W
;
# }}}
# Voltage {{{
V
=
1.
;
kV
=
1e3
*
V
;
mV
=
1e-3
*
V
;
uV
=
1e-6
*
V
;
nV
=
1e-9
*
V
;
# }}}
# Current {{{
A
=
1.
;
mA
=
1e-3
*
A
;
uA
=
1e-6
*
A
;
nA
=
1e-9
*
A
;
pA
=
1e-12
*
A
;
fA
=
1e-15
*
A
;
# }}}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment