Skip to content

Commit 60eab28

Browse files
author
Kyle Beyer
committed
fix units
1 parent f34ab8e commit 60eab28

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/exfor_tools/exfor_tools.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import periodictable
33
from functools import reduce
44
import jitr.utils.mass as mass
5+
from matplotlib import pyplot as plt
56

67
from x4i3 import exfor_manager
78
from x4i3.exfor_reactions import X4Reaction
@@ -64,6 +65,9 @@ def get_db():
6465
)
6566

6667

68+
unit_symbols = {"no-dim": "unitless", "barns/ster": "b/Sr"}
69+
70+
6771
energyExParserList = [
6872
X4MissingErrorColumnPair(
6973
X4ColumnParser(
@@ -1087,8 +1091,8 @@ def plot_angular_distributions(
10871091
x_units = measurements[0][0].x_units
10881092
y_units = measurements[0][0].y_units
10891093
else:
1090-
x_units = measurements[0].x_units
1091-
y_units = measurements[0].y_units
1094+
x_units = unit_symbols.get(measurements[0].x_units, measurements[0].x_units)
1095+
y_units = unit_symbols.get(measurements[0].y_units, measurements[0].y_units)
10921096

10931097
ax.set_xlabel(r"$\theta$ [{}]".format(x_units))
10941098
ax.set_ylabel(r"{} [{}]".format(data_symbol, y_units))

0 commit comments

Comments
 (0)