dodal.devices.insertion_device.lookup_table_models.EnergyCoverage#

class dodal.devices.insertion_device.lookup_table_models.EnergyCoverage[source]#

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

generate(min_energies, max_energies, ...)

get_energy_index(energy)

Binary search assumes self.energy_entries is sorted by min_energy.

get_poly(energy)

Return the numpy.poly1d polynomial applicable for the given energy.

Attributes

max_energy

min_energy

model_config

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

energy_entries

get_poly(energy: float) poly1d[source]#

Return the numpy.poly1d polynomial applicable for the given energy.

Return type:

poly1d

Parameters:#

energy:

Energy value in the same units used to create the lookup table.

param energy:

type energy:

float

get_energy_index(energy: float) int | None[source]#

Binary search assumes self.energy_entries is sorted by min_energy. Return index or None if not found.

Parameters:

energy (float)

Return type:

int | None