ophyd_async.fastcs.panda#

Package Contents#

Classes#

CommonPandaBlocks

Pandablocks device with blocks which are common and required on introspection.

DataBlock

Data block for the PandA. Used for writing data through the IOC.

InencBlock

In encoder block in the PandA.

PandaBitMux

Bit input with configurable delay in the PandA.

PandaCaptureMode

Capture mode for the DataBlock on the PandA.

PcapBlock

Position capture block in the PandA.

PcompBlock

Position compare block in the PandA.

PandaPcompDirection

Direction options for position compare in the PandA.

PandaPosMux

Pos input in the PandA.

PulseBlock

Used for configuring pulses in the PandA.

SeqBlock

Sequencer block in the PandA.

PandaTimeUnits

Options for units of time in the PandA.

HDFPanda

PandA with common blocks for standard HDF writing.

DatasetTable

An abstraction of a Table where each field is a column.

PandaHdf5DatasetType

Dataset options for HDF capture.

SeqTable

Data type for the panda seq table.

SeqTrigger

Trigger options for the SeqTable.

PcompInfo

Info for the PandA PcompBlock for fly scanning.

SeqTableInfo

Info for the PandA SeqTable for fly scanning.

StaticPcompFlyableLogic

For controlling the PandA PcompBlock when fly scanning.

StaticSeqTableFlyableLogic

For controlling the PandA SeqTable when fly scanning.

ScanSpecInfo

A base class confined to explicitly defined fields in the model schema.

ScanSpecSeqTableFlyableLogic

Minimum logic needed for controlling a StandardFlyable.

PosOutScaleOffset

Functions#

apply_panda_settings

Apply given settings to a panda device.

API#

class ophyd_async.fastcs.panda.CommonPandaBlocks(name: str = '', connector: DeviceConnector | None = None)[source]#

Bases: ophyd_async.core.Device

Pandablocks device with blocks which are common and required on introspection.

pulse: DeviceVector[PulseBlock]#

None

seq: DeviceVector[SeqBlock]#

None

pcomp: DeviceVector[PcompBlock]#

None

pcap: PcapBlock#

None

data: DataBlock#

None

class ophyd_async.fastcs.panda.DataBlock(name: str = '', connector: DeviceConnector | None = None)[source]#

Bases: ophyd_async.core.Device

Data block for the PandA. Used for writing data through the IOC.

This mirrors the interface provided by https://github.com/PandABlocks/fastcs-PandABlocks/blob/main/src/fastcs_pandablocks/panda/blocks/data.py

hdf_directory: SignalRW[str]#

None

hdf_file_name: SignalRW[str]#

None

num_capture: SignalRW[int]#

None

num_captured: SignalR[int]#

None

create_directory: SignalRW[int]#

None

directory_exists: SignalR[bool]#

None

capture_mode: SignalRW[PandaCaptureMode]#

None

capture: SignalRW[bool]#

None

flush_period: SignalRW[float]#

None

datasets: SignalR[DatasetTable]#

None

class ophyd_async.fastcs.panda.InencBlock(name: str = '', connector: DeviceConnector | None = None)[source]#

Bases: ophyd_async.core.Device

In encoder block in the PandA.

This mirrors the interface provided by PandABlocks-FPGA/modules/inenc/inenc.block.ini

val_scale: SignalRW[float]#

None

val_offset: SignalRW[float]#

None

class ophyd_async.fastcs.panda.PandaBitMux[source]#

Bases: ophyd_async.core.SubsetEnum

Bit input with configurable delay in the PandA.

ZERO#

‘ZERO’

ONE#

‘ONE’

class ophyd_async.fastcs.panda.PandaCaptureMode[source]#

Bases: ophyd_async.core.StrictEnum

Capture mode for the DataBlock on the PandA.

FIRST_N#

‘FIRST_N’

LAST_N#

‘LAST_N’

FOREVER#

‘FOREVER’

class ophyd_async.fastcs.panda.PcapBlock(name: str = '', connector: DeviceConnector | None = None)[source]#

Bases: ophyd_async.core.Device

Position capture block in the PandA.

This mirrors the interface provided by PandABlocks-FPGA/modules/pcap/pcap.block.ini

active: SignalR[bool]#

None

arm: SignalRW[bool]#

None

class ophyd_async.fastcs.panda.PcompBlock(name: str = '', connector: DeviceConnector | None = None)[source]#

Bases: ophyd_async.core.Device

Position compare block in the PandA.

This mirrors the interface provided by PandABlocks-FPGA/modules/pcomp/pcomp.block.ini

active: SignalR[bool]#

None

dir: SignalRW[PandaPcompDirection]#

None

enable: SignalRW[PandaBitMux]#

None

pulses: SignalRW[int]#

None

start: SignalRW[int]#

None

step: SignalRW[int]#

None

width: SignalRW[int]#

None

class ophyd_async.fastcs.panda.PandaPcompDirection[source]#

Bases: ophyd_async.core.StrictEnum

Direction options for position compare in the PandA.

POSITIVE#

‘Positive’

NEGATIVE#

‘Negative’

EITHER#

‘Either’

class ophyd_async.fastcs.panda.PandaPosMux[source]#

Bases: ophyd_async.core.SubsetEnum

Pos input in the PandA.

ZERO#

‘ZERO’

class ophyd_async.fastcs.panda.PulseBlock(name: str = '', connector: DeviceConnector | None = None)[source]#

Bases: ophyd_async.core.Device

Used for configuring pulses in the PandA.

This mirrors the interface provided by PandABlocks-FPGA/modules/pulse/pulse.block.ini

enable: SignalRW[PandaBitMux]#

None

delay: SignalRW[float]#

None

pulses: SignalRW[int]#

None

step: SignalRW[float]#

None

width: SignalRW[float]#

None

class ophyd_async.fastcs.panda.SeqBlock(name: str = '', connector: DeviceConnector | None = None)[source]#

Bases: ophyd_async.core.Device

Sequencer block in the PandA.

This mirrors the interface provided by PandABlocks-FPGA/modules/seq/seq.block.ini

table: SignalRW[SeqTable]#

None

active: SignalR[bool]#

None

repeats: SignalRW[int]#

None

prescale: SignalRW[float]#

None

prescale_units: SignalRW[PandaTimeUnits]#

None

enable: SignalRW[PandaBitMux]#

None

posa: SignalRW[PandaPosMux]#

None

class ophyd_async.fastcs.panda.PandaTimeUnits[source]#

Bases: ophyd_async.core.StrictEnum

Options for units of time in the PandA.

MIN#

‘min’

S#

‘s’

MS#

‘ms’

US#

‘us’

class ophyd_async.fastcs.panda.HDFPanda(prefix: str, path_provider: PathProvider, name: str = '')[source]#

Bases: ophyd_async.fastcs.panda._block.CommonPandaBlocks, ophyd_async.core.StandardDetector

PandA with common blocks for standard HDF writing.

class ophyd_async.fastcs.panda.DatasetTable(**kwargs)[source]#

Bases: ophyd_async.core.Table

An abstraction of a Table where each field is a column.

For example:

>>> from ophyd_async.core import Table, Array1D
>>> import numpy as np
>>> from collections.abc import Sequence
>>> class MyTable(Table):
...     a: Array1D[np.int8]
...     b: Sequence[str]
...
>>> t = MyTable(a=[1, 2], b=["x", "y"])
>>> len(t)  # the length is the number of rows
2
>>> t2 = t + t  # adding tables together concatenates them
>>> t2.a
array([1, 2, 1, 2], dtype=int8)
>>> t2.b
['x', 'y', 'x', 'y']
>>> t2[1]  # slice a row
array([(2, b'y')], dtype=[('a', 'i1'), ('b', 'S40')])

name: Sequence[str]#

None

dtype: Sequence[PandaHdf5DatasetType]#

None

class ophyd_async.fastcs.panda.PandaHdf5DatasetType[source]#

Bases: ophyd_async.core.StrictEnum

Dataset options for HDF capture.

FLOAT_64#

‘float64’

UINT_32#

‘uint32’

class ophyd_async.fastcs.panda.SeqTable(**kwargs)[source]#

Bases: ophyd_async.core.Table

Data type for the panda seq table.

repeats: Array1D[uint16]#

None

trigger: Sequence[SeqTrigger]#

None

position: Array1D[int32]#

None

time1: Array1D[uint32]#

None

outa1: Array1D[bool_]#

None

outb1: Array1D[bool_]#

None

outc1: Array1D[bool_]#

None

outd1: Array1D[bool_]#

None

oute1: Array1D[bool_]#

None

outf1: Array1D[bool_]#

None

time2: Array1D[uint32]#

None

outa2: Array1D[bool_]#

None

outb2: Array1D[bool_]#

None

outc2: Array1D[bool_]#

None

outd2: Array1D[bool_]#

None

oute2: Array1D[bool_]#

None

outf2: Array1D[bool_]#

None

static row(*, repeats: int = 1, trigger: str = SeqTrigger.IMMEDIATE, position: int = 0, time1: int = 0, outa1: bool = False, outb1: bool = False, outc1: bool = False, outd1: bool = False, oute1: bool = False, outf1: bool = False, time2: int = 0, outa2: bool = False, outb2: bool = False, outc2: bool = False, outd2: bool = False, oute2: bool = False, outf2: bool = False) SeqTable[source]#
class ophyd_async.fastcs.panda.SeqTrigger[source]#

Bases: ophyd_async.core.StrictEnum

Trigger options for the SeqTable.

IMMEDIATE#

‘Immediate’

BITA_0#

‘BITA=0’

BITA_1#

‘BITA=1’

BITB_0#

‘BITB=0’

BITB_1#

‘BITB=1’

BITC_0#

‘BITC=0’

BITC_1#

‘BITC=1’

POSA_GT#

‘POSA>=POSITION’

POSA_LT#

‘POSA<=POSITION’

POSB_GT#

‘POSB>=POSITION’

POSB_LT#

‘POSB<=POSITION’

POSC_GT#

‘POSC>=POSITION’

POSC_LT#

‘POSC<=POSITION’

class ophyd_async.fastcs.panda.PcompInfo(/, **data: Any)[source]#

Bases: ophyd_async.core.ConfinedModel

Info for the PandA PcompBlock for fly scanning.

start_position: int#

‘Field(…)’

pulse_width: int#

‘Field(…)’

rising_edge_step: int#

‘Field(…)’

number_of_pulses: int#

‘Field(…)’

direction: PandaPcompDirection#

‘Field(…)’

class ophyd_async.fastcs.panda.SeqTableInfo(/, **data: Any)[source]#

Bases: ophyd_async.core.ConfinedModel

Info for the PandA SeqTable for fly scanning.

sequence_table: SeqTable#

‘Field(…)’

repeats: int#

‘Field(…)’

prescale_as_us: float#

‘Field(…)’

class ophyd_async.fastcs.panda.StaticPcompFlyableLogic[source]#

Bases: ophyd_async.core.FlyableLogic[ophyd_async.fastcs.panda._fly_logic.PcompInfo, None]

For controlling the PandA PcompBlock when fly scanning.

pcomp: PcompBlock#

None

async on_prepare(value: PcompInfo)[source]#

Move to the start of the fly scan, set it up, and return its context.

Parameters:

value – the per-scan info for this fly scan.

async on_kickoff(ctx: None) None[source]#

Start the fly scan.

Parameters:

ctx – the context returned by on_prepare.

Return the (possibly updated) context to be passed to on_complete.

async on_complete(ctx: None) None[source]#

Block until the fly scan is done.

Parameters:

ctx – the context returned by on_kickoff.

async stop()[source]#

Stop/disarm the flyer and wait for everything to be stopped.

Called by on_stage and on_unstage by default; override those instead if stage and unstage need to differ.

class ophyd_async.fastcs.panda.StaticSeqTableFlyableLogic[source]#

Bases: ophyd_async.core.FlyableLogic[ophyd_async.fastcs.panda._fly_logic.SeqTableInfo, None]

For controlling the PandA SeqTable when fly scanning.

seq: SeqBlock#

None

async on_prepare(value: SeqTableInfo)[source]#

Move to the start of the fly scan, set it up, and return its context.

Parameters:

value – the per-scan info for this fly scan.

async on_kickoff(ctx: None) None[source]#

Start the fly scan.

Parameters:

ctx – the context returned by on_prepare.

Return the (possibly updated) context to be passed to on_complete.

async on_complete(ctx: None) None[source]#

Block until the fly scan is done.

Parameters:

ctx – the context returned by on_kickoff.

async stop()[source]#

Stop/disarm the flyer and wait for everything to be stopped.

Called by on_stage and on_unstage by default; override those instead if stage and unstage need to differ.

class ophyd_async.fastcs.panda.ScanSpecInfo(/, **data: Any)[source]#

Bases: ophyd_async.core.ConfinedModel

A base class confined to explicitly defined fields in the model schema.

spec: Spec[Motor]#

None

deadtime: float#

None

class ophyd_async.fastcs.panda.ScanSpecSeqTableFlyableLogic[source]#

Bases: ophyd_async.core.FlyableLogic[ophyd_async.fastcs.panda._fly_logic.ScanSpecInfo, None]

Minimum logic needed for controlling a StandardFlyable.

Inherit and fill in the hooks for a particular flyable (e.g. a motion or trigger system). This base holds no state; concrete subclasses are typically @dataclasses that hold whatever signals or sub-devices they need as fields.

State that must be carried between stages is threaded through an explicit context object rather than stored on the logic: on_prepare returns it, on_kickoff receives and returns it, and on_complete receives it. StandardFlyable owns that context and enforces the call ordering, so subclasses do not need to guard against being called out of order. A flyer with no cross-stage state uses None for the context (see the PandA trigger logics).

seq: SeqBlock#

None

motor_pos_outs: dict[Motor, PosOutScaleOffset]#

‘field(…)’

async on_prepare(value: ScanSpecInfo)[source]#

Move to the start of the fly scan, set it up, and return its context.

Parameters:

value – the per-scan info for this fly scan.

async on_kickoff(ctx: None) None[source]#

Start the fly scan.

Parameters:

ctx – the context returned by on_prepare.

Return the (possibly updated) context to be passed to on_complete.

async on_complete(ctx: None) None[source]#

Block until the fly scan is done.

Parameters:

ctx – the context returned by on_kickoff.

async stop()[source]#

Stop/disarm the flyer and wait for everything to be stopped.

Called by on_stage and on_unstage by default; override those instead if stage and unstage need to differ.

class ophyd_async.fastcs.panda.PosOutScaleOffset[source]#
name: str#

None

scale: SignalRW[float]#

None

offset: SignalRW[float]#

None

classmethod from_inenc(panda: CommonPandaBlocks, number: int) PosOutScaleOffset[source]#
ophyd_async.fastcs.panda.apply_panda_settings(settings: Settings[HDFPanda]) MsgGenerator[None][source]#

Apply given settings to a panda device.