A plugin for pynxtools to convert XRD into NeXus application definitions.
Project description
XRD Reader
With the XRD reader, data from X-ray diffraction experiment can be read and written into a NeXus file (h5 type file with extension .nxs) according to NXxrd_pan application definition in NeXus. There are a few different methods of measuring XRD: 1. θ:2θ instruments (e.g. Rigaku H3R), and 2. θ:θ instrument (e.g. PANalytical X’Pert Pro). The goal with this reader is to support both of these methods.
NOTE: This reader is still under development. As of now, the reader can only handle files with the extension .xrdml
, obtained with PANalytical X’Pert Pro version 1.5 (method 2 described above). Currently we are wtoking to include more file types and file versions.
Installation
It is recommended to use python 3.11 with a dedicated virtual environment for this package. Learn how to manage python versions and virtual environments.
This package is a reader plugin for pynxtools
and thus should be installed together with pynxtools
:
pip install pynxtools[xrd]
for the latest development version.
Parsers
Though, in computer science, parser is a process that reads code into smaller parts (called tocken) with relations among tockens in a tree diagram. The process helps compiler to understand the tocken relationship of the source code.
The XRD reader calls a program or class (called parser) that reads the experimenal input file and re-organises the different physical/experiment concepts or properties in a certain structure which is defined by developer.
class pynxtools.dataconverter.readers.xrd.xrd_parser.XRDMLParser
**inputs:**
file_path: Full path of the input file.
**Important method:**
get_slash_separated_xrd_dict() -> dict
This method can be used to check if all the data from the input file have been read or not, it returns the slash separated dict as described.
Other Parsers
**Coming Soon!!**
How To
The reader can be run from Jupyter-notebook or Jupyter-lab with the following command:
! dataconverter \
--reader xrd \
--nxdl NXxrd_pan \
$<xrd-file location> \
$<eln-file location> \
--output <output-file location>.nxs
An example file can be found here in GitLab in nomad-remote-tools-hub feel free to vist and try out the reader.
Contributing
Development install
Install the package with its dependencies:
git clone https://github.com/FAIRmat-NFDI/pynxtools-xrd.git \\
--branch master \\
--recursive pynxtools_xrd
cd pynxtools_xrd
python -m pip install --upgrade pip
python -m pip install -e .
python -m pip install -e ".[dev]"
There is also a pre-commit hook available which formats the code and checks the linting before actually commiting. It can be installed with
pre-commit install
from the root of this repository.
Contact Person in FAIRmat
In principle, you can reach out to any member of Area B of the FAIRmat consortium, but Rubel Mozumder could be more reasonable for the early response.
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
Built Distribution
File details
Details for the file pynxtools_xrd-0.0.3.tar.gz
.
File metadata
- Download URL: pynxtools_xrd-0.0.3.tar.gz
- Upload date:
- Size: 118.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 92907de81383992179be1f64470e850ccc898c9615def5ecf3e9eae4552df84b |
|
MD5 | 3a9e72b4b83474c05dca0d48f3369fdb |
|
BLAKE2b-256 | 2ad4530004e1ddf25f03cd4d8a8bddb7a863bcdfa7cda4e97a2b87aa16da7af9 |
File details
Details for the file pynxtools_xrd-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: pynxtools_xrd-0.0.3-py3-none-any.whl
- Upload date:
- Size: 14.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13c9997a9f295f70389ae2af1f5e0ec577677d79abbcc4a15d81328d6db1f69d |
|
MD5 | a513b829bca51c29ce591c51042582df |
|
BLAKE2b-256 | ca109d900e44a5679dbdef094bb52c2a81a769427529145afa7c8509289c1f05 |