S15qkd/timestampsimulator/readevents_simulator.py
def _data_extractor(filename, highres_tscard=False):
    """Reads raw timestamp into time and patterns vectors

    :param filename: a python file object open in binary mode
    :param highres_tscard: Flag for the 4ps time resolution card 
    :type filename: _io.BufferedReader
    :returns: Two vectors: timestamps, corresponding pattern
    :rtype: {numpy.ndarray(float), numpy.ndarray(uint32)}
    """
    with open(filename, 'rb') as f:
        data = np.fromfile(file=f, dtype='=I').reshape(-1, 2)
        if highres_tscard:
            t = ((np.uint64(data[:, 0]) << 22) + (data[:, 1] >> 10)) / 256.
        else:
            t = ((np.uint64(data[:, 0]) << 17) + (data[:, 1] >> 15)) / 8.
        p = data[:, 1] & 0xf
        return t, p
Reads raw timestamp into time and patterns vectors

    :param filename: a python file object open in binary mode
    :param highres_tscard: Flag for the 4ps time resolution card 
    :type filename: _io.BufferedReader
    :returns: Two vectors: timestamps, corresponding pattern
    :rtype: {numpy.ndarray(float), numpy.ndarray(uint32)}
    
Reads raw timestamp into time and patterns vectors
Reads raw timestamp into time and patterns vectors
def _data_extractor(filename, highres_tscard=False):
    with open(filename, 'rb') as f:
        data = np.fromfile(file=f, dtype='=I').reshape(-1, 2)
        if highres_tscard:
            t = ((np.uint64(data[:, 0]) << 22) + (data[:, 1] >> 10)) / 256.
        else:
            t = ((np.uint64(data[:, 0]) << 17) + (data[:, 1] >> 15)) / 8.
        p = data[:, 1] & 0xf
        return t, p
def _data_extractor ( filename , highres_tscard = False ) : with open ( filename , 'rb' ) as f : data = np . fromfile ( file = f , dtype = '=I' ) . reshape ( - 1 , 2 ) if highres_tscard : t = ( ( np . uint64 ( data [ : , 0 ] ) << 22 ) + ( data [ : , 1 ] >> 10 ) ) / 256. else : t = ( ( np . uint64 ( data [ : , 0 ] ) << 17 ) + ( data [ : , 1 ] >> 15 ) ) / 8. p = data [ : , 1 ] & 0xf return t , p
Reads raw timestamp into time and patterns vectors
Reads raw timestamp into time and patterns vectors
"""Reads raw timestamp into time and patterns vectors

    :param filename: a python file object open in binary mode
    :param highres_tscard: Flag for the 4ps time resolution card 
    :type filename: _io.BufferedReader
    :returns: Two vectors: timestamps, corresponding pattern
    :rtype: {numpy.ndarray(float), numpy.ndarray(uint32)}
    """
Two vectors: timestamps, corresponding pattern
Two vectors : timestamps corresponding pattern
{numpy.ndarray(float), numpy.ndarray(uint32)}
filename
a python file object open in binary mode
a python file object open in binary mode
highres_tscard
Flag for the 4ps time resolution card
Flag for the 4ps time resolution card