DataFile

Documentation for the attributes and methods in the DataFile class.

slap2_utils.datafile.DataFile(datfile)

A class used to load a SLAP2 binary datafile for data processing.

slap2_utils.datafile.MAGIC_NUMBER

A constant used to validate the data file.

Type:

np.uint32

slap2_utils.datafile.filename

The name of the data file.

Type:

str

slap2_utils.datafile.metaDataFileName

The name of the metadata file.

Type:

str

slap2_utils.datafile.datFileName

The name of the data file with the ‘.dat’ extension.

Type:

str

slap2_utils.datafile.rawData

A list to store the raw data from the file.

Type:

list

slap2_utils.datafile.metaData

An instance of the MetaData class to handle metadata.

Type:

MetaData

slap2_utils.datafile.StreamId

A placeholder for stream ID.

Type:

None

slap2_utils.datafile.header

A placeholder for the file header.

Type:

None

slap2_utils.datafile.lineHeaderIdxs

A placeholder for the line header indices.

Type:

None

slap2_utils.datafile.fastZs

A list to store fast Z values.

Type:

list

slap2_utils.datafile.zPixelReplacementMaps

A placeholder for the Z pixel replacement maps.

Type:

None

slap2_utils.datafile.lineNumSuperPixels

A placeholder for the number of super pixels per line.

Type:

None

slap2_utils.datafile.lineSuperPixelIDs

A list to store super pixel IDs for each line.

Type:

list

slap2_utils.datafile.lineSuperPixelZIdxs

A list to store Z indices for each line’s super pixels.

Type:

list

slap2_utils.datafile.lineDataNumElements

A list to store the number of elements in each line of data.

Type:

list

slap2_utils.datafile.lineDataStartIdxs

A list to store the start indices of each line of data.

Type:

list

slap2_utils.datafile.numCycles

The number of cycles in the data file.

Type:

int

Descriptions for methods:

__init__() :

Initialize the fields with values and call the _load_file() metbod.

rtype:

Self with populated fields.

_load_file() :

Loads the data and metadata files, and populates the attributes. Has no input besides the self object.

rtype:

Self with populated fields. This includes filename, metadataFileName, datFileName, fastZs, lineSuperPixelZIdxs, lineSuperPixelIDS, zPixelReplacementMap2, lineNumSuperPixels, lineSuperPixelIDs, lineFastZIdxs, rawData and header.

load_file_header(rawData) :

Loads the file header and validates the data format. Needs rawData as input with the self object.

rtype:

Return header and edited self with populated fields, including lineDataStartIdxs, lineDataNumElements, lineDataNumElements