Пример #1
0
if args.log_level != '':
    import logging
    log_level = args.log_level.strip()
    try:
        logging.basicConfig(level=eval('logging. %s' % log_level))
    except AttributeError:
        raise RuntimeError('No such log level: %s' % log_level)

configfile = args.config
if 'CORR2INI' in os.environ.keys() and configfile == '':
    configfile = os.environ['CORR2INI']
if configfile == '':
    raise RuntimeError('No good carrying on without a config file')

configd = utils.parse_ini_file(configfile)
baselines = utils.baselines_from_config(config=configd)
fhosts = utils.hosts_from_config(config=configd, section='fengine')


def baselines_from_source(source):
    rv = {}
    for ctr, baseline in enumerate(baselines):
        if source == baseline[0] or source == baseline[1]:
            rv[ctr] = baseline
    return rv


# host name
if args.host != '':
    host = args.host
    print '%s:' % host
Пример #2
0
    if "CORR2INI" in os.environ.keys() and args.config == "":
        args.config = os.environ["CORR2INI"]

    VERBOSE = args.verbose

    # load the rx port and sd info from the config file
    config = utils.parse_ini_file(args.config)
    data_port = int(config["xengine"]["output_destination_port"])
    n_chans = int(config["fengine"]["n_chans"])

    N_CHANS = n_chans

    NUM_HEAPS = args.numheaps
    HEAP_CTR = 0

    BASELINES = utils.baselines_from_config(config=config)

    ANTS_UNDER_TEST = args.inputlist.split(",")
    freqs = args.freqlist.split(",")
    fstart = int(freqs[0])
    fstop = int(freqs[1])
    FREQS_UNDER_TEST = range(fstart, fstop)

    BLS_UNDER_TEST = ants_to_baselines(ANTS_UNDER_TEST)
    print "testing frequencies:", min(FREQS_UNDER_TEST), "-", max(FREQS_UNDER_TEST)
    print "testing ants:", ANTS_UNDER_TEST
    print "testing baselines:", BLS_UNDER_TEST
    print "checking %i heaps" % NUM_HEAPS

    fhosts = config["fengine"]["hosts"].split(",")