prsctrl.measurement.settings.MeasurementSettings#

class MeasurementSettings(measurement_time_s: float = 30, wait_time_s: float | None = None, additional_wait_time_s: float = 0, pump_source: str = 'none', auto_gain: bool = False, auto_sensitivity: bool = True, wavelengths_nm: tuple | list | NoneType = None, energies_eV: tuple | list | NoneType = None, pump_power_mWcm2: float | None = None)[source]#

Bases: SettingsClass

Methods

as_dict

Convenience wrapper for dataclasses.asdict(self)

from_dict

Recursively construct a SettingsClass from a dictionary.

get_wavelengths_nm

Generate a list of wavelengths according to either the 'wavelengths_nm' or 'energies_eV' field.

load_yaml

save_yaml

Attributes

additional_wait_time_s

auto_gain

auto_sensitivity

energies_eV

measurement_time_s

pump_power_mWcm2

pump_source

wait_time_s

wavelengths_nm

as_dict() dict#

Convenience wrapper for dataclasses.asdict(self)

classmethod from_dict(data: dict)#

Recursively construct a SettingsClass from a dictionary. If the value of a field is another SettingsClass, from_dict will be called for that field as well. Handled are: - SettingsClass - list[SettingsClass] - dict[<any>, SettingsClass] - all of the above as Optional

Raises:
  • ValueError – If data contains a value that has the wrong type for the field of cls (ONLY if the type is a subclass of SettingsClass! Other types are not enforced)

  • KeyError – If data contains a key that is not a field name of cls

get_wavelengths_nm(round_to_digits: int | None = 2, update_field: bool = True) list[float][source]#

Generate a list of wavelengths according to either the ‘wavelengths_nm’ or ‘energies_eV’ field. Either field may already be a list of values, or a tuple (start, stop, step size).

Parameters:
  • round_to_digits – Optional number of digits to round the values to.

  • update_field – If True, overwrite the value of ‘wavelengths_nm’ with the returned array and ‘energies_eV’ with None.

Returns:

list of wavelengths in nm