qcodes/instrument_drivers/tektronix/AWGFileParser.py
def _unpacker(
        binaryarray: np.ndarray,
        dacbitdepth: int = 14
) -> Tuple[np.ndarray, np.ndarray, np.ndarray]:
    """
    Unpacks an awg-file integer wave into a waveform and two markers
    in the same way as the AWG does. This can be useful for checking
    how the signals are going to be interpreted by the instrument.

    Args:
        binaryarray: A numpy array containing the
            packed waveform and markers.
        dacbitdepth: Specifies the bit depth for the digitisation
            of the waveform. Allowed values: 14, 8. Default: 14.

    Returns:
        The waveform scaled to have values from -1 to 1, marker 1, marker 2.
    """

    wflength = len(binaryarray)
    wf = np.zeros(wflength)
    m1 = np.zeros(wflength)
    m2 = np.zeros(wflength)

    for ii, bitnum in enumerate(binaryarray):
        bitstring = bin(bitnum)[2:].zfill(16)
        m2[ii] = int(bitstring[0])
        m1[ii] = int(bitstring[1])
        wf[ii] = (int(bitstring[2:], base=2)-2**13)/2**13
        # print(bitstring, int(bitstring[2:], base=2))

    return wf, m1, m2

    Unpacks an awg-file integer wave into a waveform and two markers
    in the same way as the AWG does. This can be useful for checking
    how the signals are going to be interpreted by the instrument.

    Args:
        binaryarray: A numpy array containing the
            packed waveform and markers.
        dacbitdepth: Specifies the bit depth for the digitisation
            of the waveform. Allowed values: 14, 8. Default: 14.

    Returns:
        The waveform scaled to have values from -1 to 1, marker 1, marker 2.
    
Unpacks an awg-file integer wave into a waveform and two markers
in the same way as the AWG does. This can be useful for checking
how the signals are going to be interpreted by the instrument.
Unpacks an awg - file integer wave into a waveform and two markers in the same way as the AWG does . This can be useful for checking how the signals are going to be interpreted by the instrument .
def _unpacker(
        binaryarray: np.ndarray,
        dacbitdepth: int = 14
) -> Tuple[np.ndarray, np.ndarray, np.ndarray]:
    wflength = len(binaryarray)
    wf = np.zeros(wflength)
    m1 = np.zeros(wflength)
    m2 = np.zeros(wflength)
    for ii, bitnum in enumerate(binaryarray):
        bitstring = bin(bitnum)[2:].zfill(16)
        m2[ii] = int(bitstring[0])
        m1[ii] = int(bitstring[1])
        wf[ii] = (int(bitstring[2:], base=2)-2**13)/2**13
    return wf, m1, m2
def _unpacker ( binaryarray : np . ndarray , dacbitdepth : int = 14 ) -> Tuple [ np . ndarray , np . ndarray , np . ndarray ] : wflength = len ( binaryarray ) wf = np . zeros ( wflength ) m1 = np . zeros ( wflength ) m2 = np . zeros ( wflength ) for ii , bitnum in enumerate ( binaryarray ) : bitstring = bin ( bitnum ) [ 2 : ] . zfill ( 16 ) m2 [ ii ] = int ( bitstring [ 0 ] ) m1 [ ii ] = int ( bitstring [ 1 ] ) wf [ ii ] = ( int ( bitstring [ 2 : ] , base = 2 ) - 2 ** 13 ) / 2 ** 13 return wf , m1 , m2
Unpacks an awg-file integer wave into a waveform and two markers
in the same way as the AWG does.
Unpacks an awg - file integer wave into a waveform and two markers in the same way as the AWG does .
"""
    Unpacks an awg-file integer wave into a waveform and two markers
    in the same way as the AWG does. This can be useful for checking
    how the signals are going to be interpreted by the instrument.

    Args:
        binaryarray: A numpy array containing the
            packed waveform and markers.
        dacbitdepth: Specifies the bit depth for the digitisation
            of the waveform. Allowed values: 14, 8. Default: 14.

    Returns:
        The waveform scaled to have values from -1 to 1, marker 1, marker 2.
    """ # print(bitstring, int(bitstring[2:], base=2))
The waveform scaled to have values from -1 to 1, marker 1, marker 2.
The waveform scaled to have values from - 1 to 1 marker 1 marker 2 .
binaryarray
np.ndarray
A numpy array containing the
packed waveform and markers.
A numpy array containing the packed waveform and markers .
dacbitdepth
int
Specifies the bit depth for the digitisation
of the waveform. Allowed values: 14, 8.
Specifies the bit depth for the digitisation of the waveform . Allowed values : 14 8 .