PYME.localization.remFitBuf module

class PYME.localization.remFitBuf.BufferManager

Bases: object

Keeps track of data sources and buffering over individual fitTask instances

updateBuffers(md, dataSourceModule, bufferLen)

Update the various buffers.

class PYME.localization.remFitBuf.CameraInfoManager

Bases: object

Manages camera information such as dark frames, variance maps, and flatfielding

correctImage(md, img)
Parameters
md: PYME.IO.MetaDataHandler.MDHandlerBase

metadata

img: ndarray

uncorrected data [ADU]

Returns
corrected: ndarray

ADOffset and flatfield corrected image [ADU]

getDarkMap(md)

Returns the dark map specified in the supplied metadata, from cache if possible. The dark map is in units of camera counts

getFlatfieldMap(md)

Returns the flatfield map specified in the supplied metadata, from cache if possible The flatfield is a (floating point) value which is multiplied with the image to correct variations in response. It should (usually) have a mean value of 1.

getVarianceMap(md)

Returns the pixel variance map specified in the supplied metadata, from cache if possible. The variance map should be in units of photoelectrons^2.

PYME.localization.remFitBuf.createFitTaskFromTaskDef(task)

Creates a fit task from a new-style json task definition Parameters ———- task : dict

The parsed task definition. As the task definition will need to be parsed by the worker before we get here, we expect this to take the form of a python dictionary.

Returns
a fitTask instance
class PYME.localization.remFitBuf.fitResult(task, results, driftResults)

Bases: TaskResult

class PYME.localization.remFitBuf.fitTask(dataSourceID, frameIndex, metadata, dataSourceModule=None, resultsURI=None)

Bases: Task

Create a new fit task for performing single molecule localization tasks.

Parameters
dataSourceIDstr

A filename or URI which identifies the data source

frameIndexint

The frame to fit

metadataPYME.IO.MetaDataHandler object

The image metadata. This defines most of the analysis parameters.

dataSourceModulestr

The name of the data source module to use. If None, the dataSourceModule is inferred from the dataSourceID.

resultsURIstr

A URI dictating where to store the analysis results.

classmethod calcSigma(md, data)

Estimate a per-pixel noise standard deviation. Parameters ———- md: PYME.IO.MetaDataHandler.MDHandlerBase

metadata

data: ndarray

data, having been dark-map and flatfield corrected. [ADU]

Returns
sigma: ndarray

estimated per-pixel noise as a standard deviation. [ADU]

Notes

TrueEMGain: float

conversion factor between electrons post-electron-multiplication and raw photoelectrons. [e-/pe-]

NoiseFactor: float

typically 1.4 for EMCCD when gain is > 10, 1 for CCD and CMOS. [pe-^(-1/2)] see doi: 10.1109/TED.2003.813462

var: ndarray

(per-pixel) variance, readout noise [e-^2]

calcThreshold()
property fitMod
property is_splitter_fit
PYME.localization.remFitBuf.tqPopFcn(workerN, NWorkers, NTasks)