This repository is dedicated towards NANONIS raw data file conversion, to enable the usage of image analysis software that is built for one specific raw data file format, for several file formats. Currently the file conversions supported are:
- NANONIS images as .dat -> .sxm
- NANONIS imagesd as .dat -> .png
We have two command line tools that implement the above.
dat-pngconverts image.datfiles into PNG previewsdat-sxmconverts image.datfiles into.sxmfiles
Both commands accept either a single .dat file or a directory of .dat files.
This public repository is derived from a refined lab-internal project hence the few commits.
Co-authorship note: the CLI-oriented workflow was co-authored with Gustavo Campi.
Clone the repository, enter it, and install it in editable mode:
git clone https://github.com/rohanplatts/nanonis-file-conversion.git
cd nanonis-file-conversion
python -m pip install -e .That installs these commands into your active Python environment:
dat-pngdat-sxm
The repository ships with two sample .dat files in data/sample_input. With the defaults unchanged, you can run:
dat-png
dat-sxmDefault paths are defined here:
- nanonis_tools/dats_to_pngs.py
DEFAULT_INPUT_DIR,DEFAULT_OUTPUT_DIR - nanonis_tools/dat_sxm_cli.py
DEFAULT_INPUT_DIR,DEFAULT_OUTPUT_DIR,DEFAULT_CUSHION_DIR
Convert to PNG previews:
dat-png --input-dir path/to/input --output-dir path/to/outputConvert to .sxm:
dat-sxm --input-dir path/to/input --output-dir path/to/outputIf your cushion files are stored somewhere else, provide them explicitly:
dat-sxm --input-dir path/to/input --output-dir path/to/output --cushion-dir path/to/file_cushionsThe cushion paths exist as particular byte sequences that all nanonis .sxm images have. they are provided in \src\file_cushions. The cushion path is inserted default relative to the repo root so you shouldnt need to edit any default file paths with respect to those.
- nanonis_tools: installable converter source code
- scripts: thin wrappers for direct script execution
- src/file_cushions: required layout assets for
.sxmgeneration - data/sample_input: two small example
.datfiles
dat-sxmwrites output files using the input filename stem.- The current
.sxmtimestamp parsing expects filenames of the formAyyMMdd.HHmmss.dat.