Data Structures and Inputs

Enums

Command Types

Set of all available low-level commands

enum obi.commands.structs.CmdType(value)[source]
Member Type:

int

Valid values are as follows:

Synchronize = <CmdType.Synchronize: 0>[source]
Abort = <CmdType.Abort: 1>[source]
Flush = <CmdType.Flush: 2>[source]
ExternalCtrl = <CmdType.ExternalCtrl: 3>[source]
BeamSelect = <CmdType.BeamSelect: 4>[source]
Blank = <CmdType.Blank: 5>[source]
Delay = <CmdType.Delay: 6>[source]
Array = <CmdType.Array: 8>[source]
RasterPixelFill = <CmdType.RasterPixelFill: 9>[source]
RasterRegion = <CmdType.RasterRegion: 10>[source]
RasterPixel = <CmdType.RasterPixel: 11>[source]
RasterPixelRun = <CmdType.RasterPixelRun: 12>[source]
RasterPixelFreeRun = <CmdType.RasterPixelFreeRun: 13>[source]
VectorPixel = <CmdType.VectorPixel: 14>[source]
VectorPixelMinDwell = <CmdType.VectorPixelMinDwell: 15>[source]

Output Modes

enum obi.commands.structs.OutputMode(value)[source]
Member Type:

int

Valid values are as follows:

SixteenBit = <OutputMode.SixteenBit: 0>[source]
EightBit = <OutputMode.EightBit: 1>[source]
NoOutput = <OutputMode.NoOutput: 2>[source]

Beam Types

enum obi.commands.structs.BeamType(value)[source]
Member Type:

int

Valid values are as follows:

NoBeam = <BeamType.NoBeam: 0>[source]
Electron = <BeamType.Electron: 1>[source]
Ion = <BeamType.Ion: 2>[source]

Numeric types

These classes are provided as convenient wrappers to validate command inputs. When used as type hints, they are only annotations and are not enforced.

Numeric base types

14 bit integers

class obi.commands.structs.u14(val)[source]

An integer value in the range(0,16384), representable by a 14 bit register. Valid input value for a 14 bit DAC. Counters are 0-indexed so 0 = 1 count and 16383 = 16384 counts.

Parameters:

val (int)

16 bit integers

class obi.commands.structs.u16(val)[source]

An integer value in the range(0,65536), representable by a 16 bit register. Counters are 0-indexed so 0 = 1 count and 65535 = 65536 counts.

Parameters:

val (int)

8,8 fractional fixed point values

{'reg': [{'bits': 1, 'name': '2^-8', 'type': 2}, {'bits': 1, 'name': '2^-7', 'type': 2}, {'bits': 1, 'name': '2^-6', 'type': 2}, {'bits': 1, 'name': '2^-5', 'type': 2}, {'bits': 1, 'name': '2^-4', 'type': 2}, {'bits': 1, 'name': '2^-3', 'type': 2}, {'bits': 1, 'name': '2^-2', 'type': 2}, {'bits': 1, 'name': '2^-1', 'type': 2}, {'bits': 1, 'name': '2^0'}, {'bits': 1, 'name': '2^1'}, {'bits': 1, 'name': '2^2'}, {'bits': 1, 'name': '2^3'}, {'bits': 1, 'name': '2^4'}, {'bits': 1, 'name': '2^5'}, {'bits': 1, 'name': '2^6'}, {'bits': 1, 'name': '2^7'}], 'config': {}}
class obi.commands.structs.fp8_8(val)[source]

A binary representation of a fractional value with 8 integer bits and 8 fractional bits.

Parameters:

val (float)

Scan Parameters

Dwell Time

class obi.commands.structs.DwellTime(val)[source]

DwellTime is a descriptive subclass of u16 used for type annotations. Dwell time is measured in units of ADC cycles.

Important

One DwellTime = 125 ns

Parameters:

val (int)

DAC Code Ranges

class obi.commands.structs.DACCodeRange(start, count, step)[source]

A range of DAC codes to be stepped through by internal FPGA counters. DAC step sizes are encoded with fractional bits.

Parameters:
  • start (u14) – The first DAC code to start on.

  • count (u14) – The number of steps to count up from the starting code.

  • step (fp8_8) – The step size to increment by each step.

classmethod from_resolution(resolution)[source]
Parameters:

resolution (u14) – Number of pixels to fill entire DAC range

Returns:

DACCodeRange

As executed, the range of DAC codes will be equivalent to np.linspace(0,16383,resolution).astype(np.uint16)

Example

>>> DACCodeRange.from_resolution(2048)
classmethod from_roi(resolution, start, count)[source]
Parameters:
  • resolution (u14) – Number of pixels to fill entire DAC range

  • start (u14) – Starting position for ROI

  • count (u14) – Length of ROI, in pixels

Returns:

DACCodeRange