Skip to content

Commit 703b16a

Browse files
fix: fix wavelength values
1 parent c5c2da9 commit 703b16a

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

src/diffpy/labpdfproc/tools.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,20 @@
44
from diffpy.utils.diffraction_objects import ANGLEQUANTITIES, QQUANTITIES, XQUANTITIES
55
from diffpy.utils.tools import check_and_build_global_config, compute_mud, get_package_info, get_user_info
66

7-
WAVELENGTHS = {"Mo": 0.71073, "Ag": 0.59, "Cu": 1.5406}
7+
# Reference values are taken from https://x-server.gmca.aps.anl.gov/cgi/www_dbli.exe?x0hdb=waves
8+
# Ka1Ka2 values are calculated as: (Ka1 * 2 + Ka2) / 3
9+
# For CuKa1Ka2: (1.54056 * 2 + 1.544398) / 3 = 1.54184
10+
WAVELENGTHS = {
11+
"Mo": 0.71073,
12+
"MoKa1": 0.70930,
13+
"MoKa1Ka2": 0.71073,
14+
"Ag": 0.56087,
15+
"AgKa1": 0.55941,
16+
"AgKa1Ka2": 0.56087,
17+
"Cu": 1.54184,
18+
"CuKa1": 1.54056,
19+
"CuKa1Ka2": 1.54184,
20+
}
821
known_sources = [key for key in WAVELENGTHS.keys()]
922

1023
# Exclude wavelength from metadata to prevent duplication,

tests/test_tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def test_set_output_directory_bad(user_filesystem):
168168
"inputs, expected",
169169
[
170170
([], {"wavelength": 0.71073, "anode_type": "Mo"}),
171-
(["--anode-type", "Ag"], {"wavelength": 0.59, "anode_type": "Ag"}),
171+
(["--anode-type", "Ag"], {"wavelength": 0.56087, "anode_type": "Ag"}),
172172
(["--wavelength", "0.25"], {"wavelength": 0.25, "anode_type": None}),
173173
(["--wavelength", "0.25", "--anode-type", "Ag"], {"wavelength": 0.25, "anode_type": None}),
174174
],

0 commit comments

Comments
 (0)