Exemplo n.º 1
0
def read_frame(filehandle, verbose=False):
    """
    Function to read in a single COR frame (header+data) and store the 
    contents as a Frame object.
    """

    # New Go Fast! (TM) method
    try:
        newFrame = read_cor(filehandle, Frame())
    except gSyncError:
        mark = filehandle.tell() - FRAME_SIZE
        raise SyncError(location=mark)
    except gEOFError:
        raise EOFError

    return newFrame
Exemplo n.º 2
0
def read_frame(filehandle, verbose=False):
    """
    Function to read in a single TBW frame (header+data) and store the 
    contents as a Frame object.  This function wraps readerHeader and 
    readData[(12)|4].
    """

    # New Go Fast! (TM) method
    try:
        newFrame = read_tbw(filehandle, Frame())
    except gSyncError:
        mark = filehandle.tell() - FRAME_SIZE
        raise SyncError(location=mark)
    except gEOFError:
        raise EOFError

    return newFrame
Exemplo n.º 3
0
def read_frame(filehandle, gain=None, verbose=False):
    """
    Function to read in a single DR spectrometer/DRX frame (header+data) and 
    store the contents as a Frame object.
    """

    # New Go Fast! (TM) method
    try:
        newFrame = read_drspec(filehandle, Frame())
    except gSyncError:
        mark = filehandle.tell()
        raise SyncError(type='DRSpectrometer', location=mark)
    except gEOFError:
        raise EOFError

    if gain is not None:
        newFrame.gain = gain

    return newFrame
Exemplo n.º 4
0
def read_frame(filehandle, sample_rate=None, verbose=False):
    """
    Function to read in a single TBN frame (header+data) and store the 
    contents as a Frame object.
    """

    # New Go Fast! (TM) method
    try:
        newFrame = read_tbn(filehandle, Frame())
    except gSyncError:
        mark = filehandle.tell() - FRAME_SIZE
        raise SyncError(location=mark)
    except gEOFError:
        raise EOFError

    if sample_rate is not None:
        newFrame.setsample_rate(sample_rate)

    return newFrame
Exemplo n.º 5
0
def read_frame(filehandle, gain=None, verbose=False):
    """
    Function to read in a single DRX frame (header+data) and store the 
    contents as a Frame object.  This function wraps readerHeader and 
    readData.
    """

    # New Go Fast! (TM) method
    try:
        newFrame = read_drx(filehandle, Frame())
    except gSyncError:
        mark = filehandle.tell() - FRAME_SIZE
        raise SyncError(location=mark)
    except gEOFError:
        raise EOFError

    if gain is not None:
        newFrame.gain = gain

    return newFrame
Exemplo n.º 6
0
def read_frame(filehandle, sample_rate=0.0, central_freq=0.0, verbose=False):
    """
    Function to read in a single VDIF frame (header+data) and store the 
    contents as a Frame object.  This function wraps the _readerHeader and 
    _readData functions.
    """

    # New _vdif method
    try:
        newFrame = read_vdif(filehandle,
                             Frame(),
                             central_freq=central_freq,
                             sample_rate=sample_rate)
    except gSyncError:
        mark = filehandle.tell()
        raise SyncError(type='VDIF', location=mark)
    except gEOFError:
        raise EOFError

    return newFrame