Frame¶
The frame buffer collects data into a Frame:
- class obi.macros.frame_buffer.Frame(x_res, y_res)[source]¶
A Frame represents a 2D array of pixels.
- Properties:
canvas: 2D
numpy.ndarray
ofnp.uint16
representing an image
- classmethod from_DAC_ranges(x_range, y_range)[source]¶
Generate a frame from two instances of :class:DACCodeRange
- Parameters:
x_range (DACCodeRange)
y_range (DACCodeRange)
- Returns:
- fill(pixels)[source]¶
Fill the entire contents of the Frame at once.
- Parameters:
pixels (array) – 1D array of pixel data
- Raises:
ValueError – If the number of pixels isn’t equal to the Frame’s pixels
Frame Buffer¶
- class obi.macros.frame_buffer.FrameBuffer(conn)[source]¶
The Frame Buffer executes raster scan commands and stores the results in a :class:Frame. It is suitable for a live graphical display, or for headless scripted capture.
- Parameters:
conn (
Connection
) – A connection to an OBI device, via a Glasgow device
- property is_aborted[source]¶
True if all of the following are true: - An abort event exists - The abort event has already been set If true, also clears the existing abort event by setting self.abort to None.
- Returns:
True if scan was previously aborted mid-frame
- async capture_frame(*, x_range, y_range, dwell_time, **kwargs)[source]¶
Simplest method to capture a single frame. Unlike frame capture methods that are used with the GUI, no partially filled frames are returned.
- Parameters:
x_range (DACCodeRange) – X range for raster scan
y_range (DACCodeRange) – Y range for raster scan
dwell_time (int) – Pixel dwell time
- Returns: