ophyd_async.plan_stubs
#
Plan stubs for connecting, setting up and flying devices.
Package Contents#
Functions#
Kickoff, complete and collect with a flyer and multiple detectors. |
|
|
Prepare a hardware triggered flyable and one or more detectors. |
Run a scan wth a flyer and multiple detectors. |
|
Plan stub to ensure devices are connected with a given timeout. |
|
Set up attributes on NdArray devices. |
|
Set up nd stats for a detector. |
|
Apply given settings to a panda device. |
|
Set every SignalRW to the given value in Settings. If value is None ignore it. |
|
Set every SignalRW in settings, only if it is different to the current value. |
|
Get current settings on |
|
Retrieve named Settings for a Device from a provider. |
|
Walk a Device for SignalRWs and store their values. |
API#
- ophyd_async.plan_stubs.fly_and_collect(stream_name: str, flyer: StandardFlyer[SeqTableInfo] | StandardFlyer[PcompInfo], detectors: list[StandardDetector])[source]#
Kickoff, complete and collect with a flyer and multiple detectors.
This stub takes a flyer and one or more detectors that have been prepared. It declares a stream for the detectors, then kicks off the detectors and the flyer. The detectors are collected until the flyer and detectors have completed.
- ophyd_async.plan_stubs.prepare_static_seq_table_flyer_and_detectors_with_same_trigger(flyer: StandardFlyer[SeqTableInfo], detectors: list[StandardDetector], number_of_frames: int, exposure: float, shutter_time: float, repeats: int = 1, period: float = 0.0, frame_timeout: float | None = None)[source]#
Prepare a hardware triggered flyable and one or more detectors.
Prepare a hardware triggered flyable and one or more detectors with the same trigger. This method constructs TriggerInfo and a static sequence table from required parameters. The table is required to prepare the flyer, and the TriggerInfo is required to prepare the detector(s).
This prepares all supplied detectors with the same trigger.
- ophyd_async.plan_stubs.time_resolved_fly_and_collect_with_static_seq_table(stream_name: str, flyer: StandardFlyer[SeqTableInfo], detectors: list[StandardDetector], number_of_frames: int, exposure: float, shutter_time: float, repeats: int = 1, period: float = 0.0, frame_timeout: float | None = None)[source]#
Run a scan wth a flyer and multiple detectors.
The stub demonstrates the standard basic flow for a flyscan:
Prepare the flyer and detectors with a trigger
Fly and collect:
Declare the stream and kickoff the scan
Collect while completing
This needs to be used in a plan that instantates detectors and a flyer, stages/unstages the devices, and opens and closes the run.
- ophyd_async.plan_stubs.ensure_connected(*devices: Device, mock: bool | LazyMock = False, timeout: float = DEFAULT_TIMEOUT, force_reconnect=False)[source]#
Plan stub to ensure devices are connected with a given timeout.
- ophyd_async.plan_stubs.setup_ndattributes(device: NDArrayBaseIO, ndattributes: Sequence[NDAttributePv | NDAttributeParam])[source]#
Set up attributes on NdArray devices.
- ophyd_async.plan_stubs.apply_panda_settings(settings: Settings[HDFPanda]) MsgGenerator[None] [source]#
Apply given settings to a panda device.
- ophyd_async.plan_stubs.apply_settings(settings: Settings) MsgGenerator[None] [source]#
Set every SignalRW to the given value in Settings. If value is None ignore it.
- ophyd_async.plan_stubs.apply_settings_if_different(settings: Settings, apply_plan: Callable[[Settings], MsgGenerator[None]], current_settings: Settings | None = None) MsgGenerator[None] [source]#
Set every SignalRW in settings, only if it is different to the current value.
- Parameters:
apply_plan – A device specific plan which takes the Settings to apply and applies them to the Device. Used to add device specific ordering to setting the signals.
current_settings – If given, should be a superset of settings containing the current value of the Settings in the Device. If not given it will be created by reading just the signals given in settings.
- ophyd_async.plan_stubs.get_current_settings(device: Device) MsgGenerator[Settings] [source]#
Get current settings on
Device
.
- ophyd_async.plan_stubs.retrieve_settings(provider: SettingsProvider, name: str, device: Device) MsgGenerator[Settings] [source]#
Retrieve named Settings for a Device from a provider.
- ophyd_async.plan_stubs.store_settings(provider: SettingsProvider, name: str, device: Device) MsgGenerator[None] [source]#
Walk a Device for SignalRWs and store their values.
- Parameters:
provider – The provider to store the settings with.
name – The name to store the settings under.
device – The Device to walk for SignalRWs.