Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update wavelengths #155

Merged
merged 5 commits into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions news/wavelength.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* <news item>

**Changed:**

* Increased the number of significant figures for wavelength and separated values for Ka1 and Ka2.

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* <news item>

**Security:**

* <news item>
15 changes: 14 additions & 1 deletion src/diffpy/labpdfproc/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,20 @@
from diffpy.utils.diffraction_objects import ANGLEQUANTITIES, QQUANTITIES, XQUANTITIES
from diffpy.utils.tools import check_and_build_global_config, compute_mud, get_package_info, get_user_info

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

# Exclude wavelength from metadata to prevent duplication,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def test_set_output_directory_bad(user_filesystem):
"inputs, expected",
[
([], {"wavelength": 0.71073, "anode_type": "Mo"}),
(["--anode-type", "Ag"], {"wavelength": 0.59, "anode_type": "Ag"}),
(["--anode-type", "Ag"], {"wavelength": 0.56087, "anode_type": "Ag"}),
(["--wavelength", "0.25"], {"wavelength": 0.25, "anode_type": None}),
(["--wavelength", "0.25", "--anode-type", "Ag"], {"wavelength": 0.25, "anode_type": None}),
],
Expand Down
Loading