Skip to content

Commit c559d7b

Browse files
Add erg, dyne units and Boltzmann constant (#28)
* Update copyright statements to 2021 * Add units erg, dyne * Add Boltzmann constant * Doc
1 parent 59fcb24 commit c559d7b

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
BSD 3-Clause License
22

3-
Copyright (c) 2018-2020, Eduardo Rodrigues.
3+
Copyright (c) 2018-2021, Eduardo Rodrigues.
44
All rights reserved.
55

66
Redistribution and use in source and binary forms, with or without

src/hepunits/constants/constants.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
from math import pi
1717

18-
from ..units.units import m, s, eplus, mole, joule
18+
from ..units.units import m, s, eplus, mole, joule, kelvin
1919

2020
# -----------------------------------------------------------------------------
2121
# Mathematical constants
@@ -49,3 +49,6 @@
4949
hbarc = hbar_Planck * c_light
5050

5151
hbarc_sq = hbarc * hbarc
52+
53+
# Boltzmann constant (exact value, taken from PDG 2020)
54+
k_Boltzmann = 1.380649e-23 * joule / kelvin

src/hepunits/units/units.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,12 +194,14 @@
194194

195195
electronvolt = _pre.micro * megaelectronvolt
196196

197+
zettaelectronvolt = _pre.zetta * electronvolt
197198
exaelectronvolt = _pre.exa * electronvolt
198199
petaelectronvolt = _pre.peta * electronvolt
199200
teraelectronvolt = _pre.tera * electronvolt
200201
gigaelectronvolt = _pre.giga * electronvolt
201202
kiloelectronvolt = _pre.kilo * electronvolt
202203

204+
ZeV = zettaelectronvolt
203205
EeV = exaelectronvolt
204206
PeV = petaelectronvolt
205207
TeV = teraelectronvolt
@@ -276,6 +278,8 @@
276278

277279
J = joule
278280

281+
erg = 1.0e-7 * joule
282+
279283
# Power [M][L^2][T^-3]
280284
watt = joule / second
281285

@@ -290,6 +294,8 @@
290294

291295
N = newton
292296

297+
dyne = 1.0e-5 * newton
298+
293299
# Pressure
294300
pascal = newton / meter2
295301

0 commit comments

Comments
 (0)