Skip to main content

A reader for transferring XPS data from vendor formats to NeXus and NOMAD.

Project description

Ruff

A reader for XPS data

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.

Install this package with

pip install git+https://github.com/FAIRmat-NFDI/pynxtools-xps.git

for the latest development version.

Purpose

This reader plugin for pynxtools is used to translate diverse file formats from the scientific community and technology partners within the field of X-ray photoelectron spectroscopy into a standardized representation using the NeXus application definition NXmpes.

Supported file formats

The reader decides which parser to use based on the file extension of the files provided. For the main XPS files, the following file extensions are supported:

  • .sle: SpecsLabProdigy files, propietary format of SPECS GmbH (1 and v4)
  • .xml: SpecsLab 2files, XML format from SPECS GmbH (v1.6)
  • .vms: VAMAS files, ISO standard data transfer format (ISO 14976), both in regular and irregular format
  • .xy: SpecsLabProdigy export format in XY format (including all export settings)
  • .txt:

We are continously working on adding parsers for other data formats and technology partners. If you would like to implement a parser for your data, feel free to get in contact.

Getting started

An example script to run the XPS reader in pynxtools:

 ! dataconverter \
--reader xps \
--nxdl NXmpes \
--input-file $<xps-file path> \
--input-file $<eln-file path> \
--output <output-file path>.nxs

Note that none of the supported file format have data/values for all required and recommended fields and attributes in NXmpes. In order for the validation step of the XPS reader to pass, you need to provide an ELN file that contains the missing values. Example raw and converted data can be found in pynxtools_xps/examples.

Contributing

Development install

Install the package with its dependencies:

git clone https://github.com/FAIRmat-NFDI/pynxtools-xps.git \\
    --branch master \\
    --recursive pynxtools_xps
cd pynxtools_xps
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.

Development Notes

The development process is modular so that new parsers can be added. The design logic is the following:

  1. First, XpsDataFileParser selects the proper parser based on the file extensions of the provided files. It then calls a sub-parser that can read files with such extensions and calls the parse_file function of that reader. In addition, it selects a proper config file from the config subfolder.
  2. Afterwards, the NXmpes nxdl template is filled with the data in XpsDataFileParser using the config file. Data that is not in the given main files can be added through the ELN file (and must be added for required fields in NXmpes).

Test this software

Especially relevant for developers, there exists a basic test framework written in pytest which can be used as follows:

python -m pytest -sv tests

Contact person in FAIRmat for this reader

Lukas Pielsticker

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pynxtools-xps-0.0.2.tar.gz (11.3 MB view hashes)

Uploaded Source

Built Distribution

pynxtools_xps-0.0.2-py3-none-any.whl (81.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page