*** Wartungsfenster jeden ersten Mittwoch vormittag im Monat ***

Skip to content
Snippets Groups Projects
Commit 630d4b50 authored by Leolab Cavity CAD PC's avatar Leolab Cavity CAD PC
Browse files

Added unit conversion class for TimeBase FM to use detuning

parent 7a5d04de
No related branches found
No related tags found
No related merge requests found
......@@ -18,7 +18,7 @@
from labscript_utils.unitconversions.UnitConversionBase import UnitConversion
from labscript_utils.unitconversions.generic_frequency import FreqConversion
# from labscript_utils.unitconversions.detuning import detuning
from labscript_utils.unitconversions.detuning import detuning
from numpy import log10
class TimeBaseAOMDriver_AM(UnitConversion):
......@@ -32,7 +32,7 @@ class TimeBaseAOMDriver_AM(UnitConversion):
class TimeBaseAOMDriver_FM(UnitConversion):
class FM(UnitConversion):
# This must be defined outside of init, and must match the default hardware unit specified within the BLACS tab
base_unit = "V"
derived_units = ["Hz"]
......@@ -48,6 +48,23 @@ class TimeBaseAOMDriver_FM(UnitConversion):
def Hz_from_base(self,V):
return self.parameters["freq"] + V/10 * self.parameters["FM_deviation"]
class FM_detuning(detuning,FM):
"""
Combination of the deuning class and FM by overwriting the base unit and only two functions,
to convert the FM voltage to the detuning from the atom resonance.
"""
base_unit = "V"
derived_units = ["MHz", "d_MHz", "linewidths"]
def __init__(self, calibration_parameters):
detuning.__init__(self,calibration_parameters)
def MHz_to_base(self, aom_frequency_MHz):
return self.Hz_to_base(aom_frequency_MHz*1e6)
def MHz_from_base(self, V):
return self.Hz_from_base(V) * 1e-6
class dBm_to_W(UnitConversion):
base_unit = "dBm"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment