Trace

Documentation for the attributes and methods in the Trace class used to extract traces from the binary file.

slap2_utils.utils.trace.Trace(dataFile, zIdx=0, chIdx=0)

A class used to read raw data and generate traces from a SLAP2 data file.

slap2_utils.utils.trace.dataFile

The data file containing raw data to generate the trace from.

Type:

DataFile

slap2_utils.utils.trace.zIdx

The Z index of the trace.

Type:

int

slap2_utils.utils.trace.chIdx

The channel index of the trace.

Type:

int

slap2_utils.utils.trace.TracePixels

A list of TracePixel objects associated with the trace.

Type:

list

slap2_utils.utils.trace.pixelIdxs

A list of pixel indices for the trace.

Type:

list

Descriptions for methods:

__init__() :

Fill the fields mentioned above and set default value for the fields.

rtype:

Self with initialized fields.

superPixelIds():

The method obtains a list of superpixel IDs for the trace.

rtype:

Returns a list of superpixel IDs for the trace.

setPixelIdxs(rasterPixels=None, integrationPixels=None) :

The method takes an input of rasterPixels and integrationPixels maps and it sets the pixel indices based on the provided raster and integration pixel maps.

rtype:

Self with edited TracePixels and pixelIDxs fields.

checkMapDims(map_) :

The method checks and adjusts the dimensions of a map based on DMD (Digital Micromirror Device) pixel parameters. It takes a map_ as input to check and adjust.

rtype:

It returns a np.ndarray that represent the adjusted map.

process(windowWidth_lines, expectedWindowWidth_lines) :

The method processes the trace by loading the TracePixels and deconvolving the data. It takes windowWidth_lines, which is an integer that represent the width of the convolution window in lines. It also takes expectedWindowWidth_lines as an integer input that represent the expected width of the convolution window in lines.

rtype:

A tuple containing the processed trace, sumDataWeighted, sumExpected, and sumExpectedWeighted.

getRawSuperPixel(superpixel=1) :

The method obtains the raw data for a specific superpixel, which is provided by the superpixel input.

rtype:

A list of raw data for the specified superpixel.

getRawAverageSuperPixel(superpixel=1) :

The method obtains the averaged raw data for a specific superpixel (volumetric trace only), which is again provided by the superpixel input.

rtype:

A list of averaged raw data for the specified superpixel.

orderadjust() :

The method adjusts the order of the TracePixels based on their y-index.

rtype:

Self with adjusted TracePixel list that is correctly ordered.

getTracePixels(pixelIdxs) :

This method sets up the initial TracePixel fields and returns the TracePixels with new and existing TracePixels. It takes pixelIdxs which is a np.ndarray of pixel indices to set up TracePixels for.

rtype:

A list of TracePixel objects (unordered if it is not ran through orderadjust method yet.