photonpacket.file module

class photonpacket.file.file(path, name)[source]

Bases: object

Methods

getattributefromname(attr)

Get value for a given attribute in filename

getframeseries()

Get photonpacket.frameseries from file

getshapefromname()

Get shape of frame

loadMetadata()

try to read params json or xml file

loadPhotonsV21(path, photinfoMask, maxframes)

faster indexing of v2 binary save files

read(path, **kwargs)

Read photon data file

createFromPath

getattribute

parsephotinfoMask

Nframes = 0
static createFromPath(path)[source]
getattribute(attr)[source]
getattributefromname(attr)[source]

Get value for a given attribute in filename

Parameters
attrstring

attribute name

Returns
valint or float

attribute value

getframeseries()[source]

Get photonpacket.frameseries from file

Returns
fsphotonpacket.frameseries
getshapefromname()[source]

Get shape of frame

Returns
shapetuple

shape of frame

loadMetadata()[source]

try to read params json or xml file

loadPhotonsV21(path, photinfoMask, maxframes)[source]

faster indexing of v2 binary save files

mode = 'fit'
name = ''
nameversion = 0
params = {}
parsephotinfoMask(**kwargs)[source]
path = ''
static read(path, **kwargs)[source]

Read photon data file

Parameters
pathstring

path to file, passed to open()

Nframesint

number of frames to read

modestring

‘fit’ to extract photon positions as fitted by photon-finder (default) ‘max’ to extract raw maximal photon positions

Returns
filefile

instance of file class

photonpacket.file.py3_fromfile(f, dtype, num)[source]

Faster than np.fromfile

Parameters
ffile handle
dtypedata type
numnumber of elements to read
Returns
datanumpy.ndarray