ibex_bluesky_core.devices.reflectometry
Reflectometry-specific bluesky devices and utilities.
Members
Angle-mapping reducer describing parameters of beam on a 1-D angular detector. |
|
Reflectometry server parameter. |
|
Reflectometry server parameter redefinition. |
|
Small wrapper around a reflectometry parameter device. |
- class ibex_bluesky_core.devices.reflectometry.AngleMappingReducer(*, detectors: ndarray[tuple[Any, ...], dtype[int32]], angle_map: ndarray[tuple[Any, ...], dtype[float64]], flood: Variable | None = None)[source]
Bases:
Reducer,StandardReadableAngle-mapping reducer describing parameters of beam on a 1-D angular detector.
This
Reducerfits the counts on each pixel of a detector, against the relative angular positions of those pixels. It then exposes fitted quantities, and their standard deviations, as signals from this reducer.The fitting model used is a
Gaussian. Uncertainties from the counts data are taken into account on these fits - the variances are set to counts + 0.5 (see ADR5 for justification).Optionally, a flood map can be provided to normalise for pixel efficiencies before fitting. This flood map is provided as a
scipp.Variable, which means that it may contain variances.Warning
The uncertainties (signals ending in
_err) from this reducer are obtained fromlmfit. The exact method is described in lmfit’sMinimizerResultdocumentation. For a perfect fit, which might result from fitting a limited number of points or flat data, uncertainties may be zero.Because the uncertainties may be zero, using them in an ‘outer’ fit is discouraged; an uncertainty of zero implies infinite weighting, which will likely cause the outer fit to fail to converge.
- Parameters:
detectors – numpy array of detector spectra to include.
angle_map – numpy array of relative pixel angles for each selected detector
flood – Optional
scipp.Variabledescribing a flood-correction. This array should be aligned along a “spectrum” dimension; counts are divided by this array before being used in fits. This is used to normalise the intensities detected by each detector pixel.
- amp
Amplitude of fitted Gaussian
- amp_err
Amplitude standard deviation of fitted Gaussian.
This is the standard error reported by
lmfit.model.Model.fit.
- background
Background of fitted Gaussian
- background_err
Background standard deviation of fitted Gaussian.
This is the standard error reported by
lmfit.model.Model.fit.
- r_squared
R-squared (goodness of fit) parameter reported by
lmfit.model.Model.fit.
- sigma
Width (sigma) of fitted Gaussian
- sigma_err
Width (sigma) standard deviation of fitted Gaussian.
This is the standard error reported by
lmfit.model.Model.fit.
- x0
Centre (x0) of fitted Gaussian
- x0_err
Centre (x0) standard deviation of fitted Gaussian.
This is the standard error reported by
lmfit.model.Model.fit.
- class ibex_bluesky_core.devices.reflectometry.ReflParameter(prefix: str, name: str, changing_timeout_s: float, *, has_redefine: bool = True)[source]
Bases:
StandardReadable,NamedMovable[float]Reflectometry server parameter.
- Parameters:
prefix – the PV prefix.
name – the name of the parameter.
changing_timeout_s – seconds to wait for the CHANGING signal to go to False after a set.
has_redefine – whether this parameter can be redefined.
- redefine: ReflParameterRedefine | None
Signal for redefining this parameter.
Will be
Noneif this parameter was constructed withhas_redefine=False.
- class ibex_bluesky_core.devices.reflectometry.ReflParameterRedefine(prefix: str, name: str)[source]
Bases:
StandardReadableReflectometry server parameter redefinition.
- Parameters:
prefix – the reflectometry parameter full address.
name – the name of the parameter redefinition.
- ibex_bluesky_core.devices.reflectometry.refl_parameter(name: str, changing_timeout_s: float = 60.0, has_redefine: bool = True) ReflParameter[source]
Small wrapper around a reflectometry parameter device.
This automatically applies the current instrument’s PV prefix.
- Parameters:
name – the reflectometry parameter name.
changing_timeout_s – time to wait (seconds) for the CHANGING signal to go False after a set.
has_redefine – whether this parameter can be redefined.
Returns a device pointing to a reflectometry parameter.