PYME.IO.DataSources.BGSDataSource module

PYME.IO.DataSources.BGSDataSource.DataSource

alias of XYZTCBgsSource

class PYME.IO.DataSources.BGSDataSource.XTZCBackgroundSource(datasource, bgRange=None)

Bases: XYTCDataSource

property additionalDims

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.

getEvents()

Return any events which are ascociated with this DataSource

getNumSlices()

Return the number of 2D slices. This is the product of the dimensions > 2

getSlice(ind)

Return the nth 2D slice of the DataSource where the higher dimensions have been flattened.

equivalent to indexing contiguous 4D data with data[:,:,ind%data.shape[2], ind/data.shape[3]]

e.g. for a 100x100x50x2 DataSource, getSlice(20) would return data[:,:,20,0].squeeze() whereas getSlice(75) would return data[:,:,25, 1].squeeze()

getSliceShape()

Return the 2D shape of a slice

moduleName = 'BGSDataSource'
release()
reloadData()
setBackgroundBufferPCT(pctile=0)
property sizeC

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-‘ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

class PYME.IO.DataSources.BGSDataSource.XYZTCBgsSource(datasource, bgRange=None)

Bases: XYZTCDataSource

getEvents()

Return any events which are ascociated with this DataSource

getNumSlices()

Return the number of 2D slices. This is the product of the dimensions > 2

getSlice(ind)

Return the nth 2D slice of the DataSource where the higher dimensions have been flattened.

equivalent to indexing contiguous 4D data with data[:,:,ind%data.shape[2], ind/data.shape[3]]

e.g. for a 100x100x50x2 DataSource, getSlice(20) would return data[:,:,20,0].squeeze() whereas getSlice(75) would return data[:,:,25, 1].squeeze()

getSliceShape()

Return the 2D shape of a slice

property is_complete

For datasources which may be opened before spooling is finished.

Over-ridden in derived classes (currently only ClusterPZFDataSource)

Returns
is_completebool

has spooling of this series finished

moduleName = 'BGSDataSource'
reloadData()
setBackgroundBufferPCT(pctile=0)
class PYME.IO.DataSources.BGSDataSource.backgroundBuffer(dataBuffer)

Bases: object

getBackground(bgindices)
class PYME.IO.DataSources.BGSDataSource.backgroundBufferM(dataBuffer, percentile=0.5, offset=0)

Bases: object

getBackground(bgindices)
class PYME.IO.DataSources.BGSDataSource.bgFrameBuffer(initialSize=30, percentile=0.25)

Bases: object

MAXIDX = 10000
MAXSHORT = 65535
addFrame(frameNo, data)
getPercentile(pctile)
removeFrame(frameNo)
class PYME.IO.DataSources.BGSDataSource.dataBuffer(dataSource, bLen=12)

Bases: object

getSlice(ind)