PYME.IO.DataSources.ElectronsPerSecondDataSource module

class PYME.IO.DataSources.ElectronsPerSecondDataSource.DataSource(parentSource, mdh, flatfield=None, dark=None)

Bases: DataSource

Create a datasource which wraps a series in units of ADU and returns frames in units of photoelectrons per second (e/s). parentSource should not be camera map corrected (dark- or flatfield-corrected).

Warning

A lot of PYME assumes that image units are in ADUs. This means that it would be easy to end up doing this correction in downstream modules as well as here and ending up with erroneous data as a result. Safe usage of this module in complex workflows will require building enhanced unit awareness into other parts of PYME.

This is discussed in more detail in PYME.recipes.processing.RawADUToElectronsPerCount

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()

moduleName = 'ElectronsPerSecondDataSource'