print "##########################################################################" print FILENAME + " trial #%i: Recalculating redundant info removing new bad antennas..." % trials, new_bad_ant sys.stdout.flush() ant_bad_meter = {} crude_calpar = {} if trials > 1: #figure out old and new bad antennas badAntenna = list(np.sort(badAntenna + new_bad_ant)) print 'Current bad Antennas:', badAntenna print 'Bad unique baselines:', badUBLpair for p, key in enumerate(wantpols.keys()): if trials == 1: calibrators[key] = omni.RedundantCalibrator_PAPER(aa) calibrators[key].nTime = len(timing) calibrators[key].nFrequency = nfreq calibrators[key].removeDegeneracy = removedegen calibrators[key].convergePercent = converge_percent calibrators[key].maxIteration = max_iter calibrators[key].stepSize = step_size timer = time.time() calibrators[key].compute_redundantinfo( badAntenna=badAntenna, badUBLpair=badUBLpair, antennaLocationTolerance=redundancy_tol) print "Redundant info on %s computed in %f minutes." % ( key, (time.time() - timer) / 60.) info = calibrators[key].Info.get_info()
print FILENAME + " trial #%i: Recalculating redundant info removing new bad antennas..." % trials, new_bad_ant sys.stdout.flush() ant_bad_meter = {} ubl_bad_meter = {} crude_calpar = {} if trials > 1: #figure out old and new bad antennas badAntenna = list(np.sort(badAntenna + new_bad_ant)) print 'Current bad Antennas (%i):' % len(badAntenna), badAntenna print 'Bad unique baselines (%i):' % len(badUBLpair), badUBLpair for p, pol in enumerate(wantpols.keys()): if input_type == 'uv': calibrators[pol] = omni.RedundantCalibrator_PAPER(aa) elif input_type == 'odf': calibrators[pol] = omni.RedundantCalibrator_X5(header_antloc) calibrators[pol].nTime = len(timing) 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)