PYME.Acquire.frameWrangler module

Implementation of the FrameWrangler class (previously PreviewAcquisator) which manages the flow of information from a camera into the rest of the program, letting dependant parts of the program know when new data arrives via signals.

As hardware control in PYMEAcquire is largely driven by and synchronized with camera frames, this also encompasses the ‘heart’ or core of the program which everything else responds to.

class PYME.Acquire.frameWrangler.FrameWrangler(_cam, _ds=None, event_loop=None)

Bases: object

Grabs frames from the camera buffers

Notes

dispatch Signals are used to allow other files to listen to key events happinging within the acquisition.

Attributes
onFramedispatch.Signal

Called once per new-frame appearing in our buffer; used to pass frame data to e.g. spoolers. Note that while onFrame gets called once per new frame, the new frames are only checked for once per polling cycle, meaning that this event will be fired N-times for each onFrameGroup event.

onFrameGroupdispatch.Signal

Called on each new frame group (once per polling interval) - use for updateing GUIs etc.

onStopdispatch.Signal

Called when acquisition stops.

Notify(event=None)

Callback which is called regularly by a system timer to poll the camera

Prepare(keepds=True)

Prepare for acquisition by allocating the buffer which will store the data we recieve. The buffer stores a single frame, and all frames pass through this buffer. The current state of the buffer is accessible via the currentFrame variable.

Parameters
keepds: Whether or not to keep the previously allocated array
checkHardware()

Check to see if our hardware is ready for us to take the next frame

NB: This is largely legacy code, as the camera is usually used in free-running mode.

destroy()
property dsa

Whatever frame is currently passing through the acquisition queue

NB: this new code should use the more informatively named currentFrame property instead

getFPS()
getFrame(colours=None)

Ask the camera to put a frame into our buffer

getReqMemChans(colours)

Use this function to calc how may channels to allocate when creating a new data stack

isRunning()
onExpReady()

There is an exposure waiting in the Camera, pull it down into our local storage and notify any listeners

purge()

purge (and discard) all remaining frames in the camera buffer

start(tiint=100)

Start aquisition

stop()

Stop sequence aquisition