A tool to project X-ray diffraction cones on a detector screen at different geometries (tilt, rotation, offset) and X-ray energies.
Project description
xrdPlanner
A tool to project X-ray diffraction cones on a detector screen at different geometries (tilt, rotation, offset) and X-ray energies
- Main application is to visualize the maximum achievable resolution at a given geometry.
- Is able to project diffraction cones for standard samples or directly from cif files.
- Can turn out valuable when planning beamtimes and deciding on the geometry of the experiment.
- The math used is not meant to bring people to the moon but to provide a quick and simple preview.
- The module building code is designed for Dectris PILATUS3 / EIGER2 and SACLA MPCCD Detectors (central hole geometry) but one-module systems like the Bruker Photon II are possible as well.
- It uses python3, numpy, pyqt6, pyqtgraph, pyFAI and Dans_Diffraction.
Short how-to:
- pip install xrdPlanner.
- Type xrdPlanner in a terminal and hit enter.
- Choose a detector and a model from the Detector menu.
- Pick a reference from the Reference menu to plot its contours (pyFAI).
- Drop a .cif file onto the window to draw its contours (Dans_Diffraction), click a contour to get a hkl tooltip.
- Use the units from the Units menu you are the most comfortable with.
- Hover over the grey line at the top to show the sliders. Click it to make it stay open.
- Drag the sliders to change energy and geometry.
- Edit the settings.json file to suit your needs.
- Add all the missing detectors to the detector_db.json file.
Customisation:
- Edit the settings.json file and the detector_db.json files located in the path/to/python/lib/site-packages/xrdPlanner/ folder.
- "geo" determines the startup defaults.
- "plo" customises the general layout and visuals.
- "lmt" sets the limiting values of the geometry/energy sliders.
- I hope the variable naming is self-explanatory.
Latest updates:
- 2023-06-14 Update: Big speed update.
- 2023-06-01 Update: countourpy was dropped, the conics are now calculated directly instead of being evaluated on a grid.
- 2023-05-25 Update: Dans_Diffraction is used in favour of gemmi as it allows the direct calculation of intensities from the cif.
- 2023-04-26 Update: A hkl tooltip is shown on click on a contour (only for cif contours).
- 2023-04-25 Bugfix: Segmented contours are now drawn properly.
- 2023-04-20 Bugfix: Confined slider window mobility to main window area.
- 2023-04-10 Bugfix: Main window aspect ratio on Windows (menu bar within window).
- 2023-04-10 Bugfix: Label size could not be adjusted.
- 2023-04-10 Bugfix: Large angle (2-Theta > 90) contour label positions.
- 2023-04-09 Update: Drop a cif file onto the window to draw its contours (uses Dans_Diffraction).
- 2023-04-05 Update: Uses pyqt6, pyqtgraph and contourpy, dropped matplotlib backend.
Older updates
- 2023-03-23 Update: Settings are saved to (if doesn't exist) or loaded from (if exists) a 'settings.json' file.
- 2023-03-23 Update: Added horizontal offset support and slider.
- 2022-06-07 Update: Added functionality to plot Standard (LaB6, CeO2, ...) contours (needs pyFAI).
- 2022-04-28 Update: Changed contour line generation to accept a list of 2-theta values as input.
- 2022-04-27 Update: Added support for SACLA MPCCD Detectors (central hole geometry).
- 2022-04-25 Bugfix: Calculation of the beamcenter (rotation and tilt).
- 2022-04-25 Bugfix: Unresponsive radio buttons / redrawing the figure.
I hope this turns out to be useful for someone!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
xrdPlanner-1.0.0.tar.gz
(73.0 kB
view details)
Built Distribution
File details
Details for the file xrdPlanner-1.0.0.tar.gz
.
File metadata
- Download URL: xrdPlanner-1.0.0.tar.gz
- Upload date:
- Size: 73.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c6c66c884bb32a847601023d5648d9353071d87996645c35f50df22c534a7e0 |
|
MD5 | 10813812c8be49915e38378bf29e6322 |
|
BLAKE2b-256 | 5314b5e2533e5297ee626d91fe3ccf63c6c95893d2b0214ce8218abec36424f1 |
File details
Details for the file xrdPlanner-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: xrdPlanner-1.0.0-py3-none-any.whl
- Upload date:
- Size: 72.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 92a8997b3463ab39afdb69cc5f99b7597a2525d88263978f53f592b7b784f156 |
|
MD5 | 07ddc21c32ac16093fa5033647a7a9db |
|
BLAKE2b-256 | db1f6b1222ede84188f0f830b47b6c136a3e04425f3657b56ec701d09c7318fd |