dodal.devices.i09_1_shared#

Functions

calculate_gap_i09_hu(photon_energy_kev, ...)

Calculate the undulator gap required to produce a given energy at a given harmonic order.

get_hu_lut_as_dict(lut_path)

calculate_energy_i09_hu(gap, look_up_table)

Calculate the photon energy produced by the undulator at a given gap and harmonic order.

dodal.devices.i09_1_shared.calculate_gap_i09_hu(photon_energy_kev: float, look_up_table: dict[int, ndarray], order: int = 1, gap_offset: float = 0.0, undulator_period_mm: int = 27) float[source]#

Calculate the undulator gap required to produce a given energy at a given harmonic order. This algorithm was provided by the I09 beamline scientists, and is based on the physics of undulator radiation. https://cxro.lbl.gov//PDF/X-Ray-Data-Booklet.pdf

Parameters:
  • photon_energy_kev (float) – Requested photon energy in keV.

  • look_up_table (dict[int, np.ndarray]) – Lookup table containing undulator and beamline parameters for each harmonic order.

  • order (int, optional) – Harmonic order for which to calculate the gap. Defaults to 1.

  • gap_offset (float, optional) – Additional gap offset to apply (in mm). Defaults to 0.0.

  • undulator_period_mm (int, optional) – Undulator period in mm. Defaults to 27.

Returns:

Calculated undulator gap in millimeters.

Return type:

float

async dodal.devices.i09_1_shared.get_hu_lut_as_dict(lut_path: str) dict[int, ndarray][source]#
Parameters:

lut_path (str)

Return type:

dict[int, ndarray]

dodal.devices.i09_1_shared.calculate_energy_i09_hu(gap: float, look_up_table: dict[int, ndarray], order: int = 1, gap_offset: float = 0.0, undulator_period_mm: int = 27) float[source]#

Calculate the photon energy produced by the undulator at a given gap and harmonic order. Reverse of the calculate_gap_i09_hu function.

Parameters:
  • gap (float) – Undulator gap in millimeters.

  • look_up_table (dict[int, np.ndarray]) – Lookup table containing undulator and beamline parameters for each harmonic order.

  • order (int, optional) – Harmonic order for which to calculate the energy. Defaults to 1.

  • gap_offset (float, optional) – Additional gap offset to apply (in mm). Defaults to 0.0.

  • undulator_period_mm (int, optional) – Undulator period in mm. Defaults to 27.

Returns:

Calculated photon energy in keV.

Return type:

float