SciFiReaders.readers.microscopy.spm.stm.nanonis_base.Spec

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

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

Bases: NanonisFile

Nanonis point spectroscopy file class.

These files are a little easier to handle since they are stored in ascii format.

Parameters:

fname (str) – Filename for spec file.

header#

Parsed dat header.

Type:

dict

Raises:

UnhandledFileError – If fname does not have a ‘.dat’ extension.

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)#

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()#

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