ophyd_async.sim
#
Some simulated devices to be used in tutorials and testing.
Package Contents#
Classes#
For usage when simulating a motor. |
|
Minimal set of information required to fly a |
|
A simulated sample stage with X and Y movables. |
|
Generates pattern images in files. |
|
Simalutes a point detector with multiple channels. |
|
Simulates a detector and writes Blobs to file. |
API#
- class ophyd_async.sim.SimMotor(name='', instant=True)[source]#
Bases:
ophyd_async.core.StandardReadable
,bluesky.protocols.Movable
,bluesky.protocols.Stoppable
For usage when simulating a motor.
- set_name(name: str, *, child_name_separator: str | None = None) None [source]#
Set
self.name=name
and eachself.child.name=name+"-child"
.- Parameters:
name – New name to set.
child_name_separator – Use this as a separator instead of “-”. Use “_” instead to make the same names as the equivalent ophyd sync device.
- async prepare(value: FlySimMotorInfo)[source]#
Calculate run-up and move there, setting fly velocity when there.
- complete() WatchableAsyncStatus [source]#
Mark as complete once motor reaches completed position.
- class ophyd_async.sim.FlySimMotorInfo(/, **data: ~typing.Any)[source]#
Bases:
pydantic.BaseModel
Minimal set of information required to fly a
SimMotor
.- model_config#
‘ConfigDict(…)’
- cv_start: float#
None
Absolute position of the motor once it finishes accelerating to desired velocity, in motor EGUs
- cv_end: float#
None
Absolute position of the motor once it begins decelerating from desired velocity, in EGUs
- cv_time: float#
‘Field(…)’
Time taken for the motor to get from start_position to end_position, excluding run-up and run-down, in seconds.
- class ophyd_async.sim.SimStage(pattern_generator: PatternGenerator, name='')[source]#
Bases:
ophyd_async.core.StandardReadable
A simulated sample stage with X and Y movables.
- class ophyd_async.sim.PatternGenerator[source]#
Generates pattern images in files.
- generate_point(channel: int = 1, high_energy: bool = False) float [source]#
Make a point between 0 and 1 based on x and y.
- async observe_indices_written(timeout: float) AsyncGenerator[int] [source]#
- class ophyd_async.sim.SimPointDetector(generator: PatternGenerator, num_channels: int = 3, name: str = '')[source]#
Bases:
ophyd_async.core.StandardReadable
Simalutes a point detector with multiple channels.
- class ophyd_async.sim.SimBlobDetector(path_provider: PathProvider, pattern_generator: PatternGenerator | None = None, config_sigs: Sequence[SignalR] = (), name: str = '')[source]#
Bases:
ophyd_async.core.StandardDetector
Simulates a detector and writes Blobs to file.