Skip to content

Standalone Usages

pynxtools-spm is a tool for converting content from a raw data file and user provided data to the NeXus file according to the NeXus application definitions for SPM techniques.

One can use NOMAD (see how to upload in NOMAD documentation) research data management system (RMD) to upload the raw data files or command in terminal (needs pynxtools-spm installed in your local Python environment, see installation guide) to convert the raw data files into NeXus file.

For the formats, versions, and default config files of each vendor, see the reference pages Nanonis, Omicron, and Bruker.

Convert Data

After installing pynxtools-spm package, one can use the command line interface (CLI) to convert the raw data files into NeXus file. (see all available options by pynx convert --help).

To convert the raw data files from various techniques, use a command similar to the following -

$ pynx convert --nxdl NXstm --reader SPM  --output output_file.nxs  <list of the input files>

1. Command to convert a STS raw data file into NeXus file

$ pynx convert --nxdl NXsts --reader spm --output output.nxs eln_data.yaml nanonis_sts_file.dat config.json
Download and try with STS example files or visit the GitHub folder.

2. Command to convert a STM raw data file into NeXus file

$ pynx convert --nxdl NXstm --reader spm --output output.nxs eln_data.yaml nanonis_stm_file.sxm config.json

Download and try with STM example files or visit the GitHub folder.

3. Command to convert an Omicron STM raw data file (.sm4) into NeXus file

$ pynx convert --nxdl NXstm --reader spm --output output.nxs eln_data.yaml omicron_stm_file.sm4

Download and try with Omicron STM example files or visit the GitHub folder. This example uses the default config shipped with the package; pass your own config.json as a further input file to override it.

4. Command to convert a Nanonis AFM raw data file (.sxm, Nanonis generic version 4) into NeXus file

$ pynx convert --nxdl NXafm --reader spm --output output.nxs eln_data.yaml nanonis_afm_file.sxm config.json

Download and try with AFM example files or visit the GitHub folder.

5. Command to convert a Bruker AFM raw data file (.FLT, written by SPMLab version 1.00) into NeXus file

$ pynx convert --nxdl NXafm --reader spm --output output.nxs eln_data.yaml bruker_afm_file.FLT config.json

Download and try with Bruker AFM example files or visit the GitHub folder.

Note

A Bruker SPMLab FLT file contains one channel of one scan direction (e.g. B3320_13_061726074638.SIG_TOPO_FRW.FLT is the forward height image), so each file is converted into its own NeXus file. The config file may be omitted, in which case the default config configs/bruker/bruker_flt_afm.json shipped with the package is used.

6. Command to convert a Bruker NanoScope AFM raw data file (.spm, written by NanoScope 9.x) into NeXus file

$ pynx convert --nxdl NXafm --reader spm --output output.nxs eln_data.yaml bruker_afm_file.spm

Download the Bruker NanoScope metadata example or visit the GitHub folder. This example uses the default config configs/bruker/bruker_spm_afm.json shipped with the package; pass your own config.json as a further input file to override it.

Note

A .spm file is dominated by its binary image block (16 MB for the reference file), so the download above contains only the human-readable ASCII header (VGEP-15m-.0_00000.spm.header.txt) together with eln_data.yaml, as a preview of the metadata the reader sees. Take the complete .spm file from the GitHub folder to run the command above. One .spm file holds every channel in both scan directions and is therefore converted into a single NeXus file with several NXdata groups.

7. Command to convert a Bruker NanoScope AFM force-curve export (.spm.txt) into NeXus file

$ pynx convert --nxdl NXafm --reader spm --output output.nxs eln_data.yaml bruker_force_curve.spm.txt

Download and try with the Bruker NanoScope force-curve example files or visit the GitHub folder. This example uses the default config configs/bruker/bruker_txt_afm.json shipped with the package; pass your own config.json as a further input file to override it.

Note

The .spm.txt file is the ASCII export of a force ramp, not of an image: the extend (_Ex) and retract (_Rt) halves of the ramp become the NXdata groups deflection_extension, height_sensor_extension, deflection_retrace and height_sensor_retrace. Because the reader dispatches on the file extension, every .txt file passed with experiment_technique: AFM is routed to this handler.