poolbasechannel

This module is part of the Python Pool library. It defines the base classes for experiment channels

Classes

PoolBaseChannel

Inheritance diagram of PoolBaseChannel
class PoolBaseChannel(**kwargs)[source]

Bases: PoolElement

Base class for Pool experimental channel

Todo

Value ref API should be exposed only on the channels which belongs to referable controllers.

ValueAttributeClass

alias of Value

ValueBufferClass

alias of ValueBuffer

ValueRefAttributeClass

alias of ValueRef

ValueRefBufferClass

alias of ValueRefBuffer

AcquisitionClass

alias of PoolAcquisitionSoftware

has_pseudo_elements()[source]

Informs whether this channel forms part of any pseudo element e.g. pseudo counter.

Return type:

bool

Returns:

has pseudo elements

get_pseudo_elements()[source]

Returns list of pseudo elements e.g. pseudo counters that this channel belongs to.

Return type:

Sequence[ReferenceType]

Returns:

weak references to pseudo elements

add_pseudo_element(element)[source]

Adds pseudo element e.g. pseudo counter that this channel belongs to.

Parameters:

element (PoolPseudoCounter) – pseudo element

Return type:

None

remove_pseudo_element(element)[source]

Removes pseudo element e.g. pseudo counters that this channel belongs to.

Parameters:

element (PoolPseudoCounter) – pseudo element

Return type:

None

get_value_attribute()[source]

Returns the value attribute object for this experiment channel

Return type:

SardanaAttribute

Returns:

the value attribute

get_value_buffer()[source]

Returns the value attribute object for this experiment channel

Return type:

SardanaBuffer

Returns:

the value attribute

get_value_ref_attribute()[source]

Returns the value attribute object for this experiment channel

Note

The get_value_ref_attribute method has been included in Sardana on a provisional basis. Backwards incompatible changes (up to and including removal of the class) may occur if deemed necessary by the core developers.

Return type:

SardanaAttribute

Returns:

the value attribute

get_value_ref_buffer()[source]

Returns the value attribute object for this experiment channel

Note

The get_value_ref_buffer method has been included in Sardana on a provisional basis. Backwards incompatible changes (up to and including removal of the class) may occur if deemed necessary by the core developers.

Return type:

SardanaBuffer

Returns:

the value attribute

on_change(evt_src, evt_type, evt_value)[source]
get_default_attribute()[source]
get_acquisition()[source]
property acquisition

acquisition object

read_value()[source]

Reads the channel value from hardware.

Returns:

a SardanaValue containing the channel value

Return type:

SardanaValue

put_value(value, quality=AttrQuality.Valid, propagate=1)[source]

Sets a value.

Parameters:
  • value (SardanaValue) – the new value

  • quality (AttrQuality) – the new quality

  • propagate (int) – 0 for not propagating, 1 to propagate, 2 propagate with priority

Return type:

Any

get_value(cache=True, propagate=1)[source]

Returns the channel value.

Parameters:
  • cache (bool) – if True (default) return value in cache, otherwise read value from hardware

  • propagate (int) – 0 for not propagating, 1 to propagate, 2 propagate with priority

Return type:

SardanaAttribute

Returns:

the channel value

set_value(value)[source]

Starts an acquisition on this channel

Parameters:

value (float) – the value to count

Return type:

None

property value: SardanaAttribute

channel value

extend_value_buffer(values, idx=None, propagate=1)[source]

Extend value buffer with new values assigning them consecutive indexes starting with idx. If idx is omitted, then the new values will be added right after the last value in the buffer. Also update the read value of the attribute with the last element of values.

Parameters:
  • values (SardanaValue) – values to be added to the buffer

  • propagate (int) – 0 for not propagating, 1 to propagate, 2 propagate with priority

Return type:

ValueBuffer

append_value_buffer(value, idx=None, propagate=1)[source]

Extend value buffer with new values assigning them consecutive indexes starting with idx. If idx is omitted, then the new value will be added with right after the last value in the buffer. Also update the read value.

Parameters:
  • value (SardanaValue) – value to be added to the buffer

  • propagate (int) – 0 for not propagating, 1 to propagate, 2 propagate with priority

Return type:

ValueBuffer

clear_value_buffer()[source]
read_value_ref()[source]

Reads the channel value ref from hardware.

Note

The read_value_ref method has been included in Sardana on a provisional basis. Backwards incompatible changes (up to and including removal of the class) may occur if deemed necessary by the core developers.

Returns:

a sardana value containing the channel value

Return type:

SardanaValue

put_value_ref(value_ref, propagate=1)[source]

Sets a value ref.

Note

The put_value_ref method has been included in Sardana on a provisional basis. Backwards incompatible changes (up to and including removal of the class) may occur if deemed necessary by the core developers.

Parameters:
  • value_ref (SardanaValue) – the new value

  • propagate (int) – 0 for not propagating, 1 to propagate, 2 propagate with priority

Return type:

ValueRef

get_value_ref()[source]

Returns the channel value ref.

Note

The get_value_ref method has been included in Sardana on a provisional basis. Backwards incompatible changes (up to and including removal of the class) may occur if deemed necessary by the core developers.

Return type:

SardanaValue

Returns:

the channel value

property value_ref: SardanaValue

channel value ref

extend_value_ref_buffer(value_refs, idx=None, propagate=1)[source]

Extend value ref buffer with new values assigning them consecutive indexes starting with idx. If idx is omitted, then the new values will be added right after the last value ref in the buffer. Also update the read value ref of the attribute with the last element of values.

Note

The extend_value_ref_buffer method has been included in Sardana on a provisional basis. Backwards incompatible changes (up to and including removal of the class) may occur if deemed necessary by the core developers.

Parameters:
  • value_refs (SardanaValue) – values to be added to the buffer

  • idx (Optional[int]) – index at which to append the value_refs

  • propagate (int) – 0 for not propagating, 1 to propagate, 2 propagate with priority

Return type:

ValueRefBuffer

append_value_ref_buffer(value_ref, idx=None, propagate=1)[source]

Append new value ref to the value ref buffer at the idx position.

If idx is omitted, then the new value ref will be added right after the last value ref in the buffer. Also update the read value ref.

Note

The append_value_ref_buffer method has been included in Sardana on a provisional basis. Backwards incompatible changes (up to and including removal of the class) may occur if deemed necessary by the core developers.

Parameters:
  • value_ref (SardanaValue) – value ref to be added to the buffer

  • idx (Optional[int]) – index at which to append the value_ref

  • propagate (int) – 0 for not propagating, 1 to propagate, 2 propagate with priority

Return type:

ValueRefBuffer

clear_value_ref_buffer()[source]

Clear value ref buffer.

Note

The clear_value_ref_buffer method has been included in Sardana on a provisional basis. Backwards incompatible changes (up to and including removal of the class) may occur if deemed necessary by the core developers.

get_value_ref_pattern()[source]

Returns the channel value reference pattern.

Note

The get_value_ref_pattern method has been included in Sardana on a provisional basis. Backwards incompatible changes (up to and including removal of the class) may occur if deemed necessary by the core developers.

Return type:

str

Returns:

the channel value

set_value_ref_pattern(value_ref_pattern, propagate=1)[source]

Set a value reference pattern in the kernel (not in the hardware).

Note

The set_value_ref_pattern method has been included in Sardana on a provisional basis. Backwards incompatible changes (up to and including removal of the class) may occur if deemed necessary by the core developers.

Parameters:
  • value_ref_pattern (str) – the new value reference pattern

  • propagate (int) – 0 for not propagating, 1 to propagate, 2 propagate with priority

Return type:

None

property value_ref_pattern: str

channel value reference pattern

is_value_ref_enabled()[source]

Check if value reference is enabled.

Note

The is_value_ref_enabled method has been included in Sardana on a provisional basis. Backwards incompatible changes (up to and including removal of the class) may occur if deemed necessary by the core developers.

Return type:

bool

Returns:

the channel value

set_value_ref_enabled(value_ref_enabled, propagate=1)[source]

Set value reference enabled flag in the kernel (not in the hardware).

Note

The set_value_ref_enabled method has been included in Sardana on a provisional basis. Backwards incompatible changes (up to and including removal of the class) may occur if deemed necessary by the core developers.

Parameters:
  • value_ref_enabled (bool) – the new value reference enabled

  • propagate (int) – 0 for not propagating, 1 to propagate, 2 propagate with priority

Return type:

None

property value_ref_enabled: bool

channel value reference enabled

is_referable()[source]

Check if channel has referable capability.

Note

The is_referable method has been included in Sardana on a provisional basis. Backwards incompatible changes (up to and including removal of the class) may occur if deemed necessary by the core developers.

get_integration_time()[source]

Return the integration time for this object.

Return type:

float

Returns:

the current integration time

set_integration_time(integration_time, propagate=1)[source]

Set the integration time for this object.

Parameters:
  • integration_time (float) – integration time in seconds to set

  • propagate (int) – 0 for not propagating, 1 to propagate, 2 propagate with priority

Return type:

None

property integration_time: float

channel integration time

get_shape(cache=True, propagate=1)[source]
read_shape()[source]
property shape

channel value shape

start_acquisition()[source]