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.

self is explicitly positional-only to allow self as a field name.

Parameters:

data (Any)

Methods

before_validation(data)

is_binding_energy()

Returns true if the energy_mode is binding.

is_kinetic_energy()

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_config

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

name

enabled

slices

iterations

excitation_energy_source

lens_mode

pass_energy

acquisition_mode

low_energy

centre_energy

high_energy

acquire_time

energy_step

energy_mode

is_binding_energy() bool[source]#

Returns true if the energy_mode is binding.

Return type:

bool

is_kinetic_energy() bool[source]#

Returns true if the energy_mode is kinetic.

Return type:

bool

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:
  • 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 to calculate new energy values to return. If false, alter this region.

Return type:

Self

Returns:

Region with selected original energy mode and new calculated KINETIC energy values for epics.