get_sequence_snippet#

Waveforms.get_sequence_snippet() str[source]#

Return a sequencer code snippet for the defined waveforms.

Based on the defined waveforms and their additional information this function generates a sequencer code snippet that can be used to define the given waveforms. The following information will be used:

  • Waveform length

  • Waveform index

  • presence of markers and for which channel

  • Defined names of the waveforms (if set)

  • Defined output configuration (if set)

Example

>>> waveform = Waveform()
>>> waveform.assign_waveform(
        0,
        wave1=Wave(
            np.ones(1008),
            name="w1",
            output=OutputType.OUT1 | OutputType.OUT2
        ),
        wave2=Wave(
            -np.ones(1008),
            name="w2",
            output=OutputType.OUT2),
        markers=15 * np.ones(1008),
    )
>>> waveform.get_sequence_snippet()
wave w1 = placeholder(1008, true, true);
wave w2 = placeholder(1008, true, true);
assignWaveIndex(1, 2, w1, 2, w2, 0);
Returns:

Sequencer Code snippet.

Return type:

str

New in version 0.3.5.