SciFiReaders.readers.microscopy.spm.stm.nanonis_base.NanonisFile#

class SciFiReaders.readers.microscopy.spm.stm.nanonis_base.NanonisFile(fname)[source]#

Bases: object

Base class for Nanonis data files (grid, scan, point spectroscopy).

Handles methods and parsing tasks common to all Nanonis files.

Parameters:

fname (str) – Name of Nanonis file.

datadir#

Directory path for Nanonis file.

Type:

str

basename#

Just the filename, no path.

Type:

str

fname#

Full path of Nanonis file.

Type:

str

filetype#

filetype corresponding to filename extension.

Type:

str

byte_offset#

Size of header in bytes.

Type:

int

header_raw#

Unproccessed header information.

Type:

str

Methods

read_raw_header

Return header as a raw string.

set_data_format

start_byte

Find first byte after end tag signalling end of header info.

read_raw_header(byte_offset)[source]#

Return header as a raw string.

Everything before the end tag is considered to be part of the header. the parsing will be done later by subclass methods.

Parameters:

byte_offset (int) – Size of header in bytes. Read up to this point in file.

Returns:

Contents of filename up to byte_offset as a decoded binary string.

Return type:

str

start_byte()[source]#

Find first byte after end tag signalling end of header info.

Caveat, I believe this is the first byte after the end of the line that the end tag is found on, not strictly the first byte directly after the end tag is found. For example in Scan __init__, byte_offset is incremented by 4 to account for a ‘start’ byte that is not actual data.

Returns:

Size of header in bytes.

Return type:

int