ibex_bluesky_core.devices.muon

Muon-specific bluesky devices and utilities.

Members

MuonAsymmetryReducer

Create a new Muon asymmetry reducer.

damped_oscillator

Equation for a damped oscillator with an offset, as a function of time \(t\).

double_damped_oscillator

Equation for two damped oscillators with an offset, as a function of time \(t\).

class ibex_bluesky_core.devices.muon.MuonAsymmetryReducer(*, prefix: str, forward_detectors: ndarray[tuple[Any, ...], dtype[int32]], backward_detectors: ndarray[tuple[Any, ...], dtype[int32]], alpha: float = 1.0, time_bin_edges: Variable | None = None, model: Model, fit_parameters: Parameters)[source]

Bases: Reducer, StandardReadable

Create a new Muon asymmetry reducer.

Parameters:
  • prefix – PV prefix for the SimpleDae.

  • forward_detectors – numpy array of detector spectra to select for forward-scattering. For example, np.array([1, 2, 3]) selects spectra 1-3 inclusive. All detectors in this list are assumed to have the same time channel boundaries.

  • backward_detectors – numpy array of detector spectra to select for backward-scattering.

  • alpha – Scaling factor used in asymmetry calculation, applied to backward detector counts. Defaults to 1.

  • time_bin_edges – Optional scipp Variable describing bin-edges for rebinning the data before fitting. This must be bin edge coordinates, aligned along a scipp dimension label of “tof”, have a unit of time, for example nanoseconds, and must be strictly ascending. Use None to not apply any rebinning to the data.

  • modellmfit.model.Model object describing the model to fit to the muon data. The independent variable must be \(t\) (time, in nanoseconds).

  • fit_parameterslmfit.parameter.Parameters object describing the initial parameters (and constraints) for each fit parameter.

additional_readable_signals(dae: Dae) list[Device][source]

Publish interesting signals derived or used by this reducer.

async reduce_data(dae: Dae) None[source]

Fitting asymmetry to a set of DAE data.

ibex_bluesky_core.devices.muon.damped_oscillator(t: ndarray[tuple[Any, ...], dtype[floating]], B: float, A_0: float, omega_0: float, phi_0: float, lambda_0: float) ndarray[tuple[Any, ...], dtype[floating]][source]

Equation for a damped oscillator with an offset, as a function of time \(t\).

\[B + A_0 \cos(\omega_0 t + \phi_0) e^{-\lambda_0 t}\]
ibex_bluesky_core.devices.muon.double_damped_oscillator(t: ndarray[tuple[Any, ...], dtype[floating]], B: float, A_0: float, omega_0: float, phi_0: float, lambda_0: float, A_1: float, omega_1: float, phi_1: float, lambda_1: float) ndarray[tuple[Any, ...], dtype[floating]][source]

Equation for two damped oscillators with an offset, as a function of time \(t\).

\[B + A_0 \cos(\omega_0 t + \phi_0) e^{-\lambda_0 t} + A_1 \cos(\omega_1 t + \phi_1) e^{-\lambda_1 t}\]