Skip to content

Commit a9ddfc1

Browse files
parsing: Fixed xray info in csv_parser
1 parent c2ae4c9 commit a9ddfc1

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

xrdpattern/parsing/csv/csv_parser.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@
66
import pandas as pd
77

88
from xrdpattern.parsing.csv.matrix import Matrix, CsvOrientations
9-
from xrdpattern.xrd import XrdData, XrdAnode
9+
from xrdpattern.xrd import XrdData, XrdAnode, XrayInfo
10+
11+
copper_xray_info = XrayInfo.from_anode(element=XrdAnode.Cu)
12+
copper_wavelength = copper_xray_info.primary_wavelength
1013

11-
copper_wavelength, _ = XrdAnode.Cu.get_wavelengths()
1214
# -------------------------------------------
1315

1416

@@ -41,7 +43,7 @@ def extract_multi(self, fpath: str, pattern_dimension : str) -> list[XrdData]:
4143
for intensities in y_axis_rows:
4244
new = XrdData.make_unlabeled(two_theta_values=two_theta_degs, intensities=intensities)
4345
if is_qvalues:
44-
new.powder_experiment.xray_info = XrdAnode.Cu.get_xray_info()
46+
new.powder_experiment.xray_info = copper_xray_info
4547
pattern_infos.append(new)
4648

4749
return pattern_infos

xrdpattern/xrd/xray.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ def default_ratio() -> float:
3434

3535

3636
class XrdAnode:
37-
Cu = "Cu"
38-
Mo = "Mo"
39-
Cr = "Cr"
40-
Fe = "Fe"
41-
Co = "Co"
42-
Ag = "Ag"
37+
Cu : str = "Cu"
38+
Mo : str = "Mo"
39+
Cr : str = "Cr"
40+
Fe : str = "Fe"
41+
Co : str = "Co"
42+
Ag : str = "Ag"

0 commit comments

Comments
 (0)