Ejemplo n.º 1
0
def ligo_model_overflow_channels(dcuid, ifo=None, frametype=None, gpstime=None,
                                 accum=True):
    """
    """
    # FIXME: write a docstring
    from lalframe.utils import get_channels

    ifo = ifo or const.IFO
    if ifo is None:
        raise ValueError("Cannot format channel without an IFO, "
                         "please specify")
    if frametype is None:
        frametype = '%s_R' % ifo
    if gpstime is None:
        gpstime = tconvert().seconds - 1000
    try:
        framefile = find_frames(ifo[0], frametype, gpstime, gpstime)[0].path
    except IndexError as e:
        e.args = ('No %s-%s frames found at GPS %d'
                  % (ifo[0], frametype, gpstime),)
        raise
    allchannels = get_channels(framefile)
    if accum:
        regex = re.compile('%s:FEC-%d_(ADC|DAC)_OVERFLOW_ACC_\d+_\d+\Z'
                           % (ifo, dcuid))
    else:
        regex = re.compile('%s:FEC-%d_(ADC|DAC)_OVERFLOW_\d+_\d+\Z'
                           % (ifo, dcuid))
    return natural_sort(filter(regex.match, allchannels))
Ejemplo n.º 2
0
def test_get_channels():
    assert utils.get_channels(TEST_GWF) == TEST_CHANNELS