Converting research data to NeXus¶
Who is this tutorial for?¶
The document is for people who want to standardize their research data by converting their research data into a NeXus standardized format. We cover the basic principles and common principles of NeXus, here. For a more detailed description on the general principles of NeXus we recommend reading our learning page for NeXus or the official NeXus user manual.
What should you should know before this tutorial?¶
- You should have a basic understanding of NeXus - A primer on NeXus
- You should have a basic understanding of FAIR data
What you will know at the end of this tutorial?¶
You will have
- a basic understanding how to use the NeXus data converter from the pynxtools package
Setup¶
We use a Python tool to make converting our research data easier. This has a number of readers that support multiple file formats. You can browse the separate folders to find the reader that might work for you. A generic reader is the JSON Map Reader. In addition, we provide multiple reader plugins for different experimental techniques.
We will use the XPS reader plugin with a SpecsLabProdigy file (file extension: .sle) as an example.
Steps¶
- Download the example files from here: Example files
- Extract the zip and copy the files in your current working directory. You can find the working directory by typing the following in your terminal:
- Install pynxtools with the XPS reader plugin:
- Verify you can run the
dataconverter
in a terminal window. Open a terminal with the Python environment where you installedpynxtools
. Then type the following:
Converting the example files¶
Once you have your files copied into the working directory, your directory structure should look like this:
The eln_data_sle.yaml
YAML file is another data file containing additional information (e.g., information about the experimentator) that is not provided in the main data file.
Next, you will run the conversion routine from your Python environment:
Here we use a params.yaml
parameter file to configure the converter. This will create a file called Au_25_mbar_O2_no_align.nxs
in your current directory.
Congrats! You now have a FAIR NeXus file!
You can try out other examples from pynxtools.