Examples¶
Examples that might be useful at the APS using BlueSky
SynPseudoVoigt (name, motor, motor_field[, …]) |
Evaluate a point on a pseudo-Voigt based on the value of a motor. |
-
class
APS_BlueSky_tools.examples.
SynPseudoVoigt
(name, motor, motor_field, center=0, eta=0.5, scale=1, sigma=1, bkg=0, noise=None, noise_multiplier=1, **kwargs)[source]¶ Evaluate a point on a pseudo-Voigt based on the value of a motor.
Provides a signal to be measured. Acts like a detector.
See: https://en.wikipedia.org/wiki/Voigt_profile PARAMETERS
- name : str
- name of detector signal
- motor : Mover
- The independent coordinate
- motor_field : str
- name of Mover field
- center : float, optional
- location of maximum value, default=0
- eta : float, optional
- 0 <= eta < 1.0: Lorentzian fraction, default=0.5
- scale : float, optional
- scale >= 1 : scale factor, default=1
- sigma : float, optional
- sigma > 0 : width, default=1
- bkg : float, optional
- bkg >= 0 : constant background, default=0
- noise : {‘poisson’, ‘uniform’, None}
- Add noise to the result.
- noise_multiplier : float
- Only relevant for ‘uniform’ noise. Multiply the random amount of noise by ‘noise_multiplier’
EXAMPLE
from APS_BlueSky_tools.examples import SynPseudoVoigt motor = Mover('motor', {'motor': lambda x: x}, {'x': 0}) det = SynPseudoVoigt('det', motor, 'motor', center=0, eta=0.5, scale=1, sigma=1, bkg=0)
EXAMPLE
import numpy as np from APS_BlueSky_tools.examples import SynPseudoVoigt synthetic_pseudovoigt = SynPseudoVoigt( 'synthetic_pseudovoigt', m1, 'm1', center=-1.5 + 0.5*np.random.uniform(), eta=0.2 + 0.5*np.random.uniform(), sigma=0.001 + 0.05*np.random.uniform(), scale=1e5, bkg=0.01*np.random.uniform()) # RE(bp.scan([synthetic_pseudovoigt], m1, -2, 0, 219))