id4_common.utils.transfocator_calculation_new#
Transfocator functions.
Module Contents#
- id4_common.utils.transfocator_calculation_new.BE_REFR_INDEX_FILE = '/home/beams/POLAR/polar_instrument/src/instrument/utils/Be_refr_index.dat'#
- id4_common.utils.transfocator_calculation_new.LENS_SETTINGS = '/home/beams/POLAR/polar_instrument/src/instrument/utils/transfocator_settings.csv'#
- id4_common.utils.transfocator_calculation_new.read_delta(energy, path=BE_REFR_INDEX_FILE)#
Return the refractive index delta for beryllium at the given energy (eV).
- id4_common.utils.transfocator_calculation_new.transfocator_calculation(energy, optimize_position: float = None, experiment: str = 'diffractometer', reference_distance: float = 2591, distance_only: bool = False, selected_lenses: list = None, verbose: bool = True)#
Calculate the transfocator position and lenses set.
- Parameters:
energy (float) – Beamline energy in keV.
optimize_position (float) – CRL motor Z position that will be used to optimize the lenses for the calculation, in mm.
experiment ("diffractometer" or "magnet") – Name of the experimental configuration to focus.
reference_distance (float) – Distance between CRL and sample when the CRL Z motor is at zero. This will normally not change. In mm.
distance_only (bool) – If True it will only calculate the optimal distance, and won’t try to switch lenses.
selected_lenses (iterable) – If distance_only == True, then this is the lenses you want to use for the calculation.
verbose (bool) – Toggle to print information.