def cal2srcs(settings, cal='cal1.uv'): ''' settings: The settings file from your session. This will be used to copy over the solutions. cal: the name of the cal file (without full path) which you will use for the gain and bandpass calibration. ''' cal = settings.get('data', 'working') + cal srcprefix = settings.get('data', 'srcprefix') srcfiles = settings.get('data', 'srcfiles') stdout = apercal.shrun('ls -d ' + settings.get('data', 'working') + 'src*.uv') uvfiles = stdout[0].split('\n')[0:-1] o = [] for s in uvfiles: puthd = mirexec.TaskPutHead() puthd.in_ = s + '/restfreq' puthd.value = 1.420405752 o.append(puthd.snarf()) puthd.in_ = s + '/interval' puthd.value = 1.0 puthd.type = 'double' o.append(puthd.snarf()) gpcopy = mirexec.TaskGPCopy() gpcopy.vis = cal gpcopy.out = s o.append(gpcopy.snarf()) print "Copied Gains from ", cal, " to ", s print "DONE cal2srcs" return o
def gpcopy(v): gpcopy = mirexecb.TaskGPCopy() for i in range(len(v) - 1): gpcopy.vis = v[0] gpcopy.out = v[i] gpcopy.options = 'nopass' gpcopy.merge = 'nopass' o = gpcopy.snarf() print o
def cal2srcs(cal, settings): ''' Cals = 'cal1,cal2' Srcs = 'src1,src2' ''' for s in srcs.split(','): puthd = mirexec.TaskPutHead() puthd.in_ = s + '/restfreq' puthd.value = 1.420405752 o = puthd.snarf() puthd.in_ = s + '/interval' puthd.value = 1.0 puthd.type = 'double' o = puthd.snarf() gpcopy = mirexec.TaskGPCopy() gpcopy.vis = cal gpcopy.out = s o = gpcopy.snarf()