dodal.devices.electron_analyser.base.AbstractBaseRegion#
- class dodal.devices.electron_analyser.base.AbstractBaseRegion[source]#
Generic region model that holds the data. Specialised region models should inherit this to extend functionality. All energy units are assumed to be in eV.
- Parameters:
data (
Any)
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.selfis explicitly positional-only to allowselfas a field name.- Parameters:
data (
Any)
Methods
before_validation(data)Returns true if the energy_mode is binding.
Returns true if the energy_mode is kinetic.
prepare_for_epics(excitation_energy[, copy])Prepares a region for epics by converting BINDING to KINETIC by calculating new values for low_energy, centre_energy, and high_energy while also preserving the original energy mode e.g mode BINDING will stay as BINDING.
switch_energy_mode(energy_mode, ...[, copy])Get a region with a new energy mode: Kinetic or Binding.
Attributes
model_configConfiguration for the model, should be a dictionary conforming to [
ConfigDict][pydantic.config.ConfigDict].nameenabledslicesiterationsexcitation_energy_sourcelens_modepass_energyacquisition_modelow_energycentre_energyhigh_energyacquire_timeenergy_stepenergy_mode- switch_energy_mode(energy_mode: EnergyMode, excitation_energy: float, copy: bool = True) Self[source]#
Get a region with a new energy mode: Kinetic or Binding. It caculates new values for low_energy, centre_energy, high_energy, via the excitation enerrgy. It doesn’t calculate anything if the region is already of the same energy mode.
- Parameters:
energy_mode (
EnergyMode) – Mode you want to switch the region to.excitation_energy (
float) – Energy conversion for low_energy, centre_energy, and high_energy for new energy mode.copy (
bool, default:True) – Defaults to True. If true, create a copy of this region to alter for the new energy_mode and return it. If False, alter this region for the energy_mode and return it self.
- Return type:
Self- Returns:
Region with selected energy mode and new calculated energy values.
- prepare_for_epics(excitation_energy: float, copy: bool = True) Self[source]#
Prepares a region for epics by converting BINDING to KINETIC by calculating new values for low_energy, centre_energy, and high_energy while also preserving the original energy mode e.g mode BINDING will stay as BINDING.
- Parameters:
- Return type:
Self- Returns:
Region with selected original energy mode and new calculated KINETIC energy values for epics.