SciFiReaders.readers.microscopy.spm.stm.nanonis_base.Scan#
- class SciFiReaders.readers.microscopy.spm.stm.nanonis_base.Scan(fname, data_format=None)[source]#
Bases:
NanonisFileNanonis scan file class.
Contains data loading methods specific to Nanonis sxm files. The header is terminated by a ‘SCANIT_END’ tag followed by the A code. The NanonisFile header parse method doesn’t account for this so the Scan __init__ method just adds 4 bytes to the byte_offset attribute so as to not include this as a datapoint.
Data is structured a little differently from grid files, obviously. For each pixel in the scan, each channel is recorded forwards and backwards one after the other.
Currently cannot take scans that do not have both directions recorded for each channel, nor incomplete scans.
- Parameters:
fname (str) – Filename for scan file.
- header#
Parsed sxm header. Some fields are converted to float, otherwise most are string values.
- Type:
- signals#
Dict keys correspond to channel name, values correspond to another dict whose keys are simply forward and backward arrays for the scan image.
- Type:
- Raises:
UnhandledFileError – If fname does not have a ‘.sxm’ extension.
Methods
Return header as a raw string.
set_data_formatFind 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.
- 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: