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.Sensor#

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

Bases: StandardReadable

A demo sensor that produces a scalar value based on X and Y Movers

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.

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_name

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

set_readable_signals

Parameters:

stage

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

unstage

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

Attributes

name

Return the name of the Device

parent

The parent Device if it exists

async connect(sim: bool = False)#

Connect self and all child Devices.

Parameters:
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#

Return the name of the Device

parent: Device | None = 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

set_readable_signals(read: Sequence[SignalR] = (), config: Sequence[SignalR] = (), read_uncached: Sequence[SignalR] = ())#
Parameters:
read:

Signals to make up read()

conf:

Signals to make up read_configuration()

read_uncached:

Signals to make up read() that won’t be cached

stage() None#

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

It should return a Status that is marked done when the device is done staging.

unstage() None#

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

It should return a Status that is marked done when the device is finished unstaging.