Esempio n. 1
0
    calibrators[key] = RedundantCalibrator_CHIME(
        len(data_pack['feed_positions']))
    calibrators[key].compute_redundantinfo(data_pack,
                                           badAntenna=badAntenna,
                                           badUBLpair=badUBLpair)
    info = calibrators[key].Info.get_info()
    calibrators[key].nTime = nt
    calibrators[key].nFrequency = nfreq

    ###prepare rawCalpar for each calibrator and consider, if needed, raw calibration################
    if need_crude_cal:
        initant, solution_path, additional_solution_path, degen, _ = omni.find_solution_path(
            info)
        crude_calpar[key] = np.array([
            omni.raw_calibrate(data[p, 0, f], info, initant, solution_path,
                               additional_solution_path, degen)
            for f in range(calibrators[key].nFrequency)
        ])
        data[p] = omni.apply_calpar(data[p], crude_calpar[key],
                                    calibrators[key].totalVisibilityId)

    calibrators[key].rawCalpar = np.zeros(
        (calibrators[key].nTime, calibrators[key].nFrequency, 3 + 2 *
         (calibrators[key].Info.nAntenna + calibrators[key].Info.nUBL)),
        dtype='float32')

    ####calibrate################
    calibrators[key].removeDegeneracy = removedegen
    calibrators[key].convergePercent = converge_percent
    calibrators[key].maxIteration = max_iter
    calibrators[key].stepSize = step_size
Esempio n. 2
0
        calibrators[pol].nFrequency = nfreq
        calibrators[pol].removeDegeneracy = removedegen
        calibrators[pol].convergePercent = converge_percent
        calibrators[pol].maxIteration = max_iter
        calibrators[pol].stepSize = step_size


        timer = time.time()
        calibrators[pol].compute_redundantinfo(badAntenna = badAntenna, badUBLpair = badUBLpair, antennaLocationTolerance = redundancy_tol)
        print "Redundant info on %s computed in %f minutes."%(pol, (time.time() - timer)/60.)
        info = calibrators[pol].Info.get_info()

        ###prepare rawCalpar for each calibrator and consider, if needed, raw calibration################
        if need_crude_cal:
            initant, solution_path, additional_solution_path, degen, _ = omni.find_solution_path(info, tol = calibrators[pol].antennaLocationTolerance, verbose = False)
            crude_calpar[pol] = np.array([omni.raw_calibrate(rawdata[p, 0, f], info, initant, solution_path, additional_solution_path, degen) for f in range(calibrators[pol].nFrequency)])
            data[p] = omni.apply_calpar(rawdata[p], crude_calpar[pol], calibrators[pol].totalVisibilityId)
        else:
            data[p] = rawdata[p]
        #calibrators[pol].rawCalpar = np.zeros((calibrators[pol].nTime, calibrators[pol].nFrequency, 3 + 2 * (calibrators[pol].Info.nAntenna + calibrators[pol].Info.nUBL)),dtype='float32')

        ################################
        ########calibrate################
        ################################

        ################first round of calibration  #########################
        print FILENAME + " MSG: starting calibration on %s. nTime = %i, nFrequency = %i ..."%(pol, calibrators[pol].nTime, calibrators[pol].nFrequency),
        sys.stdout.flush()
        timer = time.time()
        additivein = np.zeros_like(data[p])
        calibrators[pol].logcal(data[p], additivein, verbose=True)
Esempio n. 3
0
calibrators = {}
omnigains = {}
adds = {}
for p, key in zip(range(len(data)), wantpols.keys()):

    calibrators[key] = omni.RedundantCalibrator_PAPER(aa)
    calibrators[key].read_redundantinfo(infopaths[key], verbose=False)
    info = calibrators[key].Info.get_info()
    calibrators[key].nTime = len(timing)
    calibrators[key].nFrequency = nfreq

    ###prepare rawCalpar for each calibrator and consider, if needed, raw calibration################
    if need_crude_cal:
        initant, solution_path, additional_solution_path, degen, _ = omni.find_solution_path(info)

        crude_calpar = np.array([omni.raw_calibrate(data[p, 0, f], info, initant, solution_path, additional_solution_path, degen) for f in range(calibrators[key].nFrequency)])
        data[p] = omni.apply_calpar(data[p], crude_calpar, calibrators[key].totalVisibilityId)

    calibrators[key].rawCalpar = np.zeros((calibrators[key].nTime, calibrators[key].nFrequency, 3 + 2 * (calibrators[key].Info.nAntenna + calibrators[key].Info.nUBL)),dtype='float32')


    ####calibrate################
    calibrators[key].removeDegeneracy = removedegen
    calibrators[key].convergePercent = converge_percent
    calibrators[key].maxIteration = max_iter
    calibrators[key].stepSize = step_size

    ################first round of calibration  #########################
    print FILENAME + " MSG: starting calibration on %s %s. nTime = %i, nFrequency = %i ..."%(dataano, key, calibrators[key].nTime, calibrators[key].nFrequency),
    sys.stdout.flush()
    timer = time.time()