Source code for atomiq.components.optoelectronics.wavelengthmeter

"""Abstract implementations of a wavelength meter to be used with HEROS wavelengthmeters or other remote devices."""

from __future__ import annotations

from atomiq.components.primitives import Component, Parametrizable, Measurable


from artiq.experiment import rpc


[docs] class WavelengthMeterChannel(Component, Measurable): def __init__(self, *args, **kwargs): """A generic wavelength meter which can measure a single wavelength.""" Component.__init__(self, *args, **kwargs) Measurable.__init__(self, ["wavelength", "frequency"])
[docs] @rpc def get_wavelength(self) -> float: """Return the wavelength in meters.""" return self.wavelength
[docs] @rpc def get_frequency(self) -> float: """Return the light frequency (vacuum) in Hz.""" return self.frequency
[docs] @rpc def _measure(self): raise NotImplementedError("Implement measure method")
[docs] class StabilizingWavelengthMeterChannel(WavelengthMeterChannel, Parametrizable): kernel_invariants = {"frequency_min", "frequency_max"} def __init__(self, default_frequency: float, frequency_min: float, frequency_max: float, *args, **kwargs) -> None: """A generic wavelength meter which can measure a single wavelength and change the frequency of an attached laser. Args: default_frequency: The default frequency to set when the channel is initialized. frequency_min: The minimum frequency that can be set. frequency_max: The maximum frequency that can be set. """ self.default_frequency = default_frequency self.frequency_min = frequency_min self.frequency_max = frequency_max WavelengthMeterChannel.__init__(self, *args, **kwargs) Parametrizable.__init__(self, ["wavelength", "frequency"])
[docs] @rpc def _measure(self) -> float: raise NotImplementedError("Implement measure method")
[docs] @rpc def set_frequency(self, frequency: float) -> None: """Set the frequency of the attached laser. Should check the requested frequency against ``frequency_min`` and ``frequency_max``. """ raise NotImplementedError("Implement set method")
[docs] @rpc def set_wavelength(self, wavelength: float) -> None: """Set the wavelength of the attached laser. Should check the requested wavelength against ``frequency_min`` and ``frequency_max``. """ raise NotImplementedError("Implement set method")