Getting started

Installation

To install afmformats, use one of the following methods (the package dependencies will be installed automatically):

  • from PyPI:

    pip install afmformats

  • from sources:

    pip install -e .

Basic Usage

In [1]: import afmformats

In [2]: dslist = afmformats.load_data("data/force-save-example.jpk-force")

# dslist is a list of force-distance curves
In [3]: dslist
Out[3]: [<AFMForceDistance 'data/force-save-example.jpk-force'[0] at 0x7fa1b31c4640>]

# available data columns of the first curve
In [4]: dslist[0].columns
Out[4]: ['force', 'height (measured)', 'height (piezo)', 'segment', 'time']

In [5]: dslist[0]["force"]
Out[5]: 
array([-6.56678981e-10, -6.64172230e-10, -6.79510911e-10, ...,
       -7.61449435e-10, -7.68909858e-10, -7.58163174e-10])

Supported file formats

All supported file formats are listed in the table below. If you are interested in other file formats, please create a new issue.

Format introduced by

Description

Extension

Loader

AFM workshop

comma-separated values

.csv

formats.fmt_workshop.ws_single.load_csv

afmformats

HDF5-based

.h5

formats.fmt_hdf5.load_hdf5

Asylum Research

binarywave

.ibw

formats.fmt_igor.load_igor

JPK Instruments

binary FD data

.jpk-force

formats.fmt_jpk.load_jpk

JPK Instruments

binary QMap data

.jpk-force-map

formats.fmt_jpk.load_jpk

JPK Instruments

binary QMap data

.jpk-qi-data

formats.fmt_jpk.load_jpk

JPK Instruments

binary QMap data

.jpk-qi-series

formats.fmt_jpk.load_jpk

afmformats

tab-separated values

.tab

formats.fmt_tab.load_tab

NT-MDT Spectrum Instruments

exported by NT-MDT Nova

.txt

formats.fmt_ntmdt_txt.load_txt

AFM workshop

QMAP as zipped comma-separated values

.zip

formats.fmt_workshop.ws_map.load_map

Notes

Afmformats is a base module for loading experimental data. You might want to use nanite or PyJibe for higher-level functionalities.