Beispiel #1
0
 def _apply_sequence_settings(self, **kwargs) -> None:
     if "sequence_type" in kwargs.keys():
         if kwargs["sequence_type"] == "None":
             # If sequence type is given as string `None`, return
             # enumeration for `None` from the SequenceType class
             t = SequenceType(None)
         else:
             t = SequenceType(kwargs["sequence_type"])
         if t not in self._parent.allowed_sequences:
             _logger.error(
                 f"Sequence type {t} must be one of "
                 f"{[s.value for s in self._parent.allowed_sequences]}!",
                 _logger.ExceptionTypes.ToolkitError,
             )
     if "trigger_mode" in kwargs.keys():
         if kwargs["trigger_mode"] == "None":
             # If trigger mode is given as string `None`, return
             # enumeration for `None` from the TriggerMode class
             t = TriggerMode(None)
         else:
             t = TriggerMode(kwargs["trigger_mode"])
         if t not in self._parent.allowed_trigger_modes:
             _logger.error(
                 f"Trigger mode {t} must be one of "
                 f"{[s.value for s in self._parent.allowed_trigger_modes]}!",
                 _logger.ExceptionTypes.ToolkitError,
             )
Beispiel #2
0
 def _apply_sequence_settings(self, **kwargs):
     if "sequence_type" in kwargs.keys():
         t = SequenceType(kwargs["sequence_type"])
         allowed_sequences = [
             SequenceType.NONE,
             SequenceType.SIMPLE,
             SequenceType.READOUT,
             SequenceType.CW_SPEC,
             SequenceType.PULSED_SPEC,
             SequenceType.CUSTOM,
         ]
         if t not in allowed_sequences:
             raise ToolkitError(
                 f"Sequence type {t} must be one of {[s.value for s in allowed_sequences]}!"
             )
         # apply settings depending on sequence type
         elif t == SequenceType.CW_SPEC:
             self._apply_cw_settings()
         elif t == SequenceType.PULSED_SPEC:
             self._apply_pulsed_settings()
         elif t == SequenceType.READOUT:
             self._apply_readout_settings()
         else:
             self._apply_base_settings()
     # apply settings dependent on trigger type
     if "trigger_mode" in kwargs.keys():
         if TriggerMode(
                 kwargs["trigger_mode"]) == TriggerMode.EXTERNAL_TRIGGER:
             self._apply_trigger_settings()
Beispiel #3
0
 def _apply_sequence_settings(self, **kwargs):
     # apply settings depending on the sequence type
     if "sequence_type" in kwargs.keys():
         t = SequenceType(kwargs["sequence_type"])
         allowed_sequences = [
             SequenceType.NONE,
             SequenceType.PULSETRAIN,
             SequenceType.SIMPLE,
             SequenceType.READOUT,
             SequenceType.CW_SPEC,
             SequenceType.PULSED_SPEC,
             SequenceType.CUSTOM,
         ]
         if t not in allowed_sequences:
             raise ToolkitError(
                 f"Sequence type {t} must be one of {[s.value for s in allowed_sequences]}!"
             )
         elif t == SequenceType.CW_SPEC:
             self._apply_cw_settings()
         elif t == SequenceType.PULSED_SPEC:
             self._apply_pulsed_settings()
         elif t == SequenceType.READOUT:
             self._apply_readout_settings()
         else:
             self._apply_base_settings()
     # apply settings dependent on trigger mode
     if "trigger_mode" in kwargs.keys():
         t = TriggerMode(kwargs["trigger_mode"])
         allowed_trigger_modes = [
             TriggerMode.NONE,
             TriggerMode.SEND_TRIGGER,
             TriggerMode.EXTERNAL_TRIGGER,
             TriggerMode.RECEIVE_TRIGGER,
             TriggerMode.SEND_AND_RECEIVE_TRIGGER,
             TriggerMode.ZSYNC_TRIGGER,
         ]
         if t not in allowed_trigger_modes:
             raise ToolkitError(
                 f"Trigger mode {t} must be one of {[s.value for s in allowed_trigger_modes]}!"
             )
         elif t in [TriggerMode.EXTERNAL_TRIGGER, TriggerMode.RECEIVE_TRIGGER]:
             self._apply_receive_trigger_settings()
         elif t == TriggerMode.ZSYNC_TRIGGER:
             self._apply_zsync_trigger_settings()
Beispiel #4
0
 def _apply_sequence_settings(self, **kwargs):
     if "sequence_type" in kwargs.keys():
         t = SequenceType(kwargs["sequence_type"])
         allowed_sequences = [
             SequenceType.NONE,
             SequenceType.SIMPLE,
             SequenceType.RABI,
             SequenceType.T1,
             SequenceType.T2,
             SequenceType.CUSTOM,
             SequenceType.TRIGGER,
         ]
         if t not in allowed_sequences:
             raise ToolkitError(
                 f"Sequence type {t} must be one of {allowed_sequences}!")
     if "trigger_mode" in kwargs.keys():
         if TriggerMode(
                 kwargs["trigger_mode"]) == TriggerMode.EXTERNAL_TRIGGER:
             self._apply_trigger_settings()
Beispiel #5
0
 def _apply_sequence_settings(self, **kwargs):
     if "sequence_type" in kwargs.keys():
         t = SequenceType(kwargs["sequence_type"])
         allowed_sequences = [
             SequenceType.NONE,
             SequenceType.PULSETRAIN,
             SequenceType.CUSTOM,
         ]
         if t not in allowed_sequences:
             raise ToolkitError(
                 f"Sequence type {t} must be one of {[s.value for s in allowed_sequences]}!"
             )
         # apply settings depending on sequence type
         self._apply_base_settings()
     # apply settings dependent on trigger type
     if "trigger_mode" in kwargs.keys():
         if TriggerMode(
                 kwargs["trigger_mode"]) == TriggerMode.EXTERNAL_TRIGGER:
             self._apply_trigger_settings()
Beispiel #6
0
 def _apply_sequence_settings(self, **kwargs) -> None:
     super()._apply_sequence_settings(**kwargs)
     if "sequence_type" in kwargs.keys() and kwargs["sequence_type"] != "None":
         t = SequenceType(kwargs["sequence_type"])
         # apply settings depending on the sequence type
         if t == SequenceType.CW_SPEC:
             self._apply_cw_settings()
         elif t == SequenceType.PULSED_SPEC:
             self._apply_pulsed_settings()
         elif t == SequenceType.READOUT:
             self._apply_readout_settings()
         else:
             self._apply_base_settings()
     if "trigger_mode" in kwargs.keys() and kwargs["trigger_mode"] != "None":
         t = TriggerMode(kwargs["trigger_mode"])
         # apply settings depending on trigger mode
         if t in [TriggerMode.EXTERNAL_TRIGGER, TriggerMode.RECEIVE_TRIGGER]:
             self._apply_receive_trigger_settings()
         elif t == TriggerMode.ZSYNC_TRIGGER:
             self._apply_zsync_trigger_settings()