ibex_bluesky_core.devices.dae

Low-level bluesky device interface to the DAE.

Members

Dae

Device representing the full interface to the ISIS data acquisition electronics.

DaeCheckingSignal

Device that wraps a signal and checks the result of a set.

RunstateEnum

The run state.

class ibex_bluesky_core.devices.dae.BeginRunEx(dae_prefix: str, name: str = '')[source]

Bases: StandardReadable, Movable[BeginRunExBits]

Set up write-only signal for BEGINRUNEX.

set(value: BeginRunExBits) None[source]

Start a run with the specified behaviour flags.

See also

BeginRunExBits for a description of the behaviour flags.

class ibex_bluesky_core.devices.dae.BeginRunExBits(value)[source]

Bases: IntFlag

Bit-flags for BeginRunEx.

These flags control behaviour such as beginning in ‘paused’ mode.

BEGIN_DELAYED = 2

Allow ‘delayed’ begin commands.

BEGIN_PAUSED = 1

Begin a run in the ‘paused’ state.

NONE = 0

Begin a run in the standard way.

class ibex_bluesky_core.devices.dae.Dae(prefix: str, name: str = 'DAE')[source]

Bases: StandardReadable

Device representing the full interface to the ISIS data acquisition electronics.

Warning

This class exposes underlying DAE functionality behaviour to bluesky, but has no configured behaviour. A raw Dae object is therefore unsuitable for use in a scan.

To use the DAE in a scan, use a subclass such as SimpleDae.

async trigger_and_get_specdata(detectors: ndarray[tuple[Any, ...], dtype[int32 | int64]] | slice | None = None) ndarray[tuple[Any, ...], dtype[int32]][source]

Get a correctly-shaped spectrum-data array.

This array will have shape (num_spectra, num_time_channels).

If detectors is a slice or an array, the number of detectors will be given by that slice or array. If detectors is None, all detectors, including the “junk” detector 0, will be included.

The number of spectra will be determined by the current DAE TCB settings. The returned array will not include the “junk” time-channel 0.

Parameters:

detectors – a numpy array or slice describing detectors to get data from. Default is all detectors. Pass np.array([1]) to select detector 1.

class ibex_bluesky_core.devices.dae.DaeCheckingSignal(datatype: type[T], prefix: str)[source]

Bases: StandardReadable, Movable[T], Generic[T]

Device that wraps a signal and checks the result of a set.

This ensures that the DAE has accepted a configuration change, ensuring that runs are not accidentally started in an unwanted configuration if the DAE does not accept new settings.

Parameters:
  • datatype – The datatype of the signal.

  • prefix – The PV address of the signal.

set(value: T) None[source]

Set and check a signal.

Parameters:

value – the value to set.

Raises:

OSError – If the signal failed to be set to the specified value.

class ibex_bluesky_core.devices.dae.DaeControls(dae_prefix: str, name: str = '')[source]

Bases: StandardReadable

DAE run controls, for example to begin and end runs.

abort_run: SignalX

Abort the current run (does not save data files).

begin_run: SignalX

Begin a run.

begin_run_ex: BeginRunEx

Begin a run, with options.

end_run: SignalX

End a run.

pause_run: SignalX

Pause the current run.

recover_run: SignalX

Recover a previously-aborted run.

resume_run: SignalX

Resume the current run.

save_run: SignalX

Save a data file for the current run (equivalent to update & store).

store_run: SignalX

Write data currently in-memory in the ICP to a data file.

update_run: SignalX

Ensure that data in the DAE has been downloaded to the ICP.

class ibex_bluesky_core.devices.dae.DaeEventMode(dae_prefix: str, name: str = '')[source]

Bases: StandardReadable

DAE event mode statistics.

buf_used: SignalR[float]

Event mode buffer used fraction.

data_rate: SignalR[float]

Event mode data rate (MB/s).

file_size: SignalR[float]

Event mode file size (MB).

fraction: SignalR[float]

Event mode fraction.

1 is full event mode, 0 is full histogram mode. Values between 0 and 1 imply that some spectra are in event mode and others are in histogram mode.

class ibex_bluesky_core.devices.dae.DaeMonitor(dae_prefix: str, name: str = '')[source]

Bases: StandardReadable

DAE monitor statistics and diagnostics.

counts: SignalR[int]

Monitor counts.

from_: SignalR[float]

Monitor integration lower bound (us).

spectrum: SignalR[int]

Monitor spectrum.

to: SignalR[float]

Monitor integration upper bound (us).

class ibex_bluesky_core.devices.dae.DaePeriod(dae_prefix: str, name: str = '')[source]

Bases: StandardReadable

DAE statistics and diagnostics for the current DAE period.

good_frames: SignalR[int]

DAE good frames in the current DAE period.

good_uah: SignalR[float]

DAE good uAh in the current DAE period.

raw_frames: SignalR[int]

DAE raw frames in the current DAE period.

run_duration: SignalR[int]

Run duration (seconds) in the current DAE period.

sequence: SignalR[int]

DAE period sequence.

type: SignalR[str]

DAE period type.

class ibex_bluesky_core.devices.dae.DaePeriodSettings(dae_prefix: str, name: str = '')[source]

Bases: StandardReadable, Locatable[DaePeriodSettingsData], Movable[DaePeriodSettingsData]

DAE hardware period settings.

See also

DaePeriodSettingsData for options.

async locate() Location[DaePeriodSettingsData][source]

Retrieve the current DAE hardware period settings.

set(value: DaePeriodSettingsData) None[source]

Set the current DAE hardware period settings.

class ibex_bluesky_core.devices.dae.DaePeriodSettingsData(*, periods_settings: list[SinglePeriodSettings] | None = None, periods_soft_num: int | None = None, periods_type: PeriodType | None = None, periods_src: PeriodSource | None = None, periods_file: str | None = None, periods_seq: int | None = None, periods_delay: int | None = None)[source]

Bases: object

Data class for specifying hardware period settings.

periods_delay: int | None = None

Hardware periods output delay (in us).

periods_file: str | None = None

Hardware period settings file path.

periods_seq: int | None = None

Number of hardware period sequences.

periods_settings: list[SinglePeriodSettings] | None = None

Explicit hardware period settings.

periods_soft_num: int | None = None

Number of software periods.

periods_src: PeriodSource | None = None

Whether to get period settings from file or explicitly-set parameters.

periods_type: PeriodType | None = None

Type of DAE periods in use.

class ibex_bluesky_core.devices.dae.DaeSettings(dae_prefix: str, name: str = '')[source]

Bases: StandardReadable, Locatable[DaeSettingsData], Movable[DaeSettingsData]

DAE settings interface.

See also

DaeSettingsData for options.

async locate() Location[DaeSettingsData][source]

Retrieve the current DAE settings.

set(value: DaeSettingsData) None[source]

Change any modified DAE settings.

class ibex_bluesky_core.devices.dae.DaeSettingsData(*, wiring_filepath: str | None = None, detector_filepath: str | None = None, spectra_filepath: str | None = None, mon_spect: int | None = None, mon_from: int | None = None, mon_to: int | None = None, timing_source: DaeTimingSource | None = None, smp_veto: bool | None = None, ts2_veto: bool | None = None, hz50_veto: bool | None = None, ext0_veto: bool | None = None, ext1_veto: bool | None = None, ext2_veto: bool | None = None, ext3_veto: bool | None = None, fermi_veto: bool | None = None, fermi_delay: int | None = None, fermi_width: int | None = None, muon_ms_mode: bool | None = None, muon_cherenkov_pulse: int | None = None, veto_0_name: str | None = None, veto_1_name: str | None = None, veto_2_name: str | None = None, veto_3_name: str | None = None)[source]

Bases: object

Data class for general DAE settings.

All settings accept None, which means this setting will not be changed from the current setting.

detector_filepath: str | None = None

Detector table file path.

ext0_veto: bool | None = None

External veto 0 enabled.

ext1_veto: bool | None = None

External veto 1 enabled.

ext2_veto: bool | None = None

External veto 2 enabled.

ext3_veto: bool | None = None

External veto 3 enabled.

fermi_delay: int | None = None

Fermi chopper veto desired delay (us).

fermi_veto: bool | None = None

Fermi chopper veto enabled.

fermi_width: int | None = None

Fermi chopper veto width (us).

hz50_veto: bool | None = None

50Hz veto enabled.

mon_from: int | None = None

Monitor integration lower bound (us).

mon_spect: int | None = None

Monitor spectrum number.

mon_to: int | None = None

Monitor integration upper bound (us).

muon_cherenkov_pulse: int | None = None

Cherenkov pulse selection (muon instruments only).

muon_ms_mode: bool | None = None

MS mode enabled (muon instruments only).

smp_veto: bool | None = None

SMP veto enabled.

spectra_filepath: str | None = None

Spectra table file path.

timing_source: DaeTimingSource | None = None

Dae timing source.

ts2_veto: bool | None = None

TS2 veto enabled.

veto_0_name: str | None = None

Veto 0 name.

veto_1_name: str | None = None

Veto 1 name.

veto_2_name: str | None = None

Veto 2 name.

veto_3_name: str | None = None

Veto 3 name.

wiring_filepath: str | None = None

Wiring table file path.

class ibex_bluesky_core.devices.dae.DaeSpectra(dae_prefix: str, *, spectra: int, period: int, name: str = '')[source]

Bases: StandardReadable

Interface to a single DAE spectrum.

async read_counts() ndarray[tuple[Any, ...], dtype[float32]][source]

Read a correctly-sized array of counts.

async read_counts_per_time() ndarray[tuple[Any, ...], dtype[float32]][source]

Read a correctly-sized array of counts divided by bin width.

async read_spectrum_dataarray() DataArray[source]

Get a scipp.DataArray containing the current data from this spectrum.

Variances are set to the counts - i.e. the standard deviation is \(\sqrt{N}\), which is typical for counts data.

Data is returned along dimension “tof”, which has bin-edge coordinates and units set from the units of the underlying PVs.

async read_tof() ndarray[tuple[Any, ...], dtype[float32]][source]

Read a correctly-sized time-of-flight (x) array representing bin centres.

async read_tof_edges() ndarray[tuple[Any, ...], dtype[float32]][source]

Read a correctly-sized time-of-flight (x) array representing bin edges.

class ibex_bluesky_core.devices.dae.DaeTCBSettings(dae_prefix: str, name: str = '')[source]

Bases: StandardReadable, Locatable[DaeTCBSettingsData], Movable[DaeTCBSettingsData]

DAE time channel settings.

See also

DaeTCBSettingsData for options.

async locate() Location[DaeTCBSettingsData][source]

Retrieve and convert the current XML to DaeTCBSettingsData.

set(value: DaeTCBSettingsData) None[source]

Set any changes in the TCB settings to the XML.

class ibex_bluesky_core.devices.dae.DaeTCBSettingsData(*, tcb_tables: dict[int, TimeRegime] | None = None, tcb_file: str | None = None, time_unit: TCBTimeUnit | None = None, tcb_calculation_method: TCBCalculationMethod | None = None)[source]

Bases: object

DAE TCB (time channel binning) settings.

All values accept None, which means do not change that setting from its current value.

tcb_calculation_method: TCBCalculationMethod | None = None

TCB source (file or explicit tables).

tcb_file: str | None = None

TCB file path.

tcb_tables: dict[int, TimeRegime] | None = None

TCB tables.

A dictionary of time-regime numbers (as int keys) to TimeRegime values.

time_unit: TCBTimeUnit | None = None

TCB time unit (usually μs for neutron instruments, ns for muon instruments).

class ibex_bluesky_core.devices.dae.DaeTimingSource(value)[source]

Bases: Enum

The DAE timing source.

See also

DAE Timing Sources in the IBEX user manual.

INTERNAL_TEST_CLOCK = 1

Timing pulse from the internal test clock.

ISIS = 0

Timing pulse from the ISIS accelerator.

ISIS_FIRST_TS1 = 5

ISIS timing, but only counting on the first TS1 pulse after the ‘missing’ TS2 pulse.

ISIS_TS1_ONLY = 6

ISIS timing, but only counting TS1 pulses.

MUON_CHERENKOV = 3

Cherenkov pulse timing (muon instruments only)

MUON_MS = 4

MS pulse timing (muon instruments only)

SMP = 2

Timing source from a ‘secondary master pulse’ (usually a chopper).

class ibex_bluesky_core.devices.dae.PeriodSource(value)[source]

Bases: Enum

The period setup source, whether to use parameters or file.

FILE = 1

Specify DAE period settings using a file.

PARAMETERS = 0

Specify DAE period settings using explicit parameters.

class ibex_bluesky_core.devices.dae.PeriodType(value)[source]

Bases: Enum

DAE period type.

HARDWARE_DAE = 1

Hardware periods (internal DAE control).

HARDWARE_EXTERNAL = 2

Hardware periods (external signal control).

SOFTWARE = 0

Software periods.

class ibex_bluesky_core.devices.dae.RunstateEnum(value)[source]

Bases: StrictEnum

The run state.

ABORTING = 'ABORTING'

Aborting state.

BEGINNING = 'BEGINNING'

Beginning state.

CHANGING = 'CHANGING'

Changing state.

ENDING = 'ENDING'

Ending state.

PAUSED = 'PAUSED'

Paused state.

PAUSING = 'PAUSING'

Pausing state.

PROCESSING = 'PROCESSING'

Processing state.

RESUMING = 'RESUMING'

Resuming state.

RUNNING = 'RUNNING'

Running state.

SAVING = 'SAVING'

Saving state.

SETUP = 'SETUP'

Setup (idle) state.

STORING = 'STORING'

Storing state.

UPDATING = 'UPDATING'

Updating state.

VETOING = 'VETOING'

Vetoing state (running blocked by hardware signal).

WAITING = 'WAITING'

Waiting state (running blocked by run control).

class ibex_bluesky_core.devices.dae.SinglePeriodSettings(*, type: int | None = None, frames: int | None = None, output: int | None = None, label: str | None = None)[source]

Bases: object

Data class for the settings on a single hardware period.

frames: int | None = None

Hardware period frames.

label: str | None = None

Hardware period label.

output: int | None = None

Hardware period output.

type: int | None = None

Hardware period type.

class ibex_bluesky_core.devices.dae.TCBCalculationMethod(value)[source]

Bases: Enum

Calculation method for DAE TCB settings.

SPECIFY_PARAMETERS = 0

Explicitly-specified TCB settings.

USE_TCB_FILE = 1

TCB settings from file.

class ibex_bluesky_core.devices.dae.TCBTimeUnit(value)[source]

Bases: Enum

Time unit for DAE TCB settings.

MICROSECONDS = 0

Microsecond TCB unit (neutron instruments).

NANOSECONDS = 1

Nanosecond TCB unit (muon instruments).

class ibex_bluesky_core.devices.dae.TimeRegime(rows: dict[int, TimeRegimeRow])[source]

Bases: object

A single DAE Time regime.

rows: dict[int, TimeRegimeRow]

Dictionary with keys representing row number and TimeRegimeRow values.

class ibex_bluesky_core.devices.dae.TimeRegimeMode(value)[source]

Bases: Enum

Time Regime Mode options for a single row.

BLANK = 0

Blank (unused) time regime.

DT = 1

dT = C spacing.

DTDIVT = 2

dT/T = C spacing.

DTDIVT2 = 3

dT/T**2 = C spacing.

SHIFTED = 4

‘Shifted’ mode.

class ibex_bluesky_core.devices.dae.TimeRegimeRow(*, from_: float | None = None, to: float | None = None, steps: float | None = None, mode: TimeRegimeMode | None = None)[source]

Bases: object

A single time regime row.

from_: float | None = None

Time from which this TCB row applies.

mode: TimeRegimeMode | None = None

Time regime spacing mode.

steps: float | None = None

Step size.

to: float | None = None

Time up to which this TCB row applies.