Note

Ophyd.v2 is included on a provisional basis until the v2.0 release and may change API on minor release numbers before then

ophyd.v2.epicsdemo.Mover#

class ophyd.v2.epicsdemo.Mover(prefix: str, name='')#

Bases: StandardReadable, Movable, Stoppable

A demo movable that moves based on velocity

Parameters:
prefix:

This will be passed as a prefix to all child Device connects

name:

If set, name the Device and its children

primary:

Optional single Signal that will be named self.name

read:

Signals to make up read() that can be cached

read_uncached:

Signals to make up read() that should not be cached

conf:

Signals to make up read_configuration() that can be cached

Methods

connect

Connect self and all child Devices.

describe

Return an OrderedDict with exactly the same keys as the read method, here mapped to per-scan metadata about each field.

describe_configuration

Same API as describe, but corresponding to the keys in read_configuration.

move

Commandline only synchronous move of a Motor

read

Return an OrderedDict mapping string field name(s) to dictionaries of values and timestamps and optional per-point metadata.

read_configuration

Same API as read but for slow-changing fields related to configuration.

set

Return a Status that is marked done when the device is done moving.

set_name

Set self.name=name and each self.child.name=name+"-child".

stage

An optional hook for "setting up" the device for acquisition.

stop

Safely stop a device that may or may not be in motion.

unstage

A hook for "cleaning up" the device after acquisition.

Attributes

name

Used to populate object_keys in the Event Descriptor

parent

The parent Device if it exists

move(new_position: float, timeout: Optional[float] = None)#

Commandline only synchronous move of a Motor

set(new_position: float, timeout: Optional[float] = None) AsyncStatus#

Return a Status that is marked done when the device is done moving.

async stop(success=True)#

Safely stop a device that may or may not be in motion.

The argument success is a boolean. When success is true, bluesky is stopping the device as planned and the device should stop “normally”. When success is false, something has gone wrong and the device may wish to take defensive action to make itself safe.

This can be a standard function or an async function.

async connect(prefix: str = '', sim=False)#

Connect self and all child Devices.

Parameters:
prefix:

Device specific prefix that can be used to nest Devices one within another. For example a PV prefix.

sim:

If True then connect in simulation mode.

async describe() Dict[str, Descriptor]#

Return an OrderedDict with exactly the same keys as the read method, here mapped to per-scan metadata about each field.

This can be a standard function or an async function.

Example return value:

OrderedDict(('channel1',
             {'source': 'XF23-ID:SOME_PV_NAME',
              'dtype': 'number',
              'shape': []}),
            ('channel2',
             {'source': 'XF23-ID:SOME_PV_NAME',
              'dtype': 'number',
              'shape': []}))
async describe_configuration() Dict[str, Descriptor]#

Same API as describe, but corresponding to the keys in read_configuration.

This can be a standard function or an async function.

property name: str#

Used to populate object_keys in the Event Descriptor

https://blueskyproject.io/event-model/event-descriptors.html#object-keys

parent: Optional[Device] = None#

The parent Device if it exists

async read() Dict[str, Reading]#

Return an OrderedDict mapping string field name(s) to dictionaries of values and timestamps and optional per-point metadata.

This can be a standard function or an async function.

Example return value:

OrderedDict(('channel1',
             {'value': 5, 'timestamp': 1472493713.271991}),
             ('channel2',
             {'value': 16, 'timestamp': 1472493713.539238}))
async read_configuration() Dict[str, Reading]#

Same API as read but for slow-changing fields related to configuration. e.g., exposure time. These will typically be read only once per run.

This can be a standard function or an async function.

set_name(name: str = '')#

Set self.name=name and each self.child.name=name+"-child".

Parameters:
name:

New name to set, do nothing if blank or name is all set

stage() List[Any]#

An optional hook for “setting up” the device for acquisition.

It should return a list of devices including itself and any other devices that are staged as a result of staging this one. (The parent attribute expresses this relationship: a device should be staged/unstaged whenever its parent is staged/unstaged.)

unstage() List[Any]#

A hook for “cleaning up” the device after acquisition.

It should return a list of devices including itself and any other devices that are unstaged as a result of unstaging this one.