def main(args, taskvals): visname = va(taskvals, 'data', 'vis', str) calfiles, caldir = bookkeeping.bookkeeping(visname) fields = bookkeeping.get_field_ids(taskvals['fields']) spw = va(taskvals, 'crosscal', 'spw', str, default='') specavg = va(taskvals, 'crosscal', 'width', int, default=1) timeavg = va(taskvals, 'crosscal', 'timeavg', str, default='8s') keepmms = va(taskvals, 'crosscal', 'keepmms', bool) msmd.open(visname) newvis = split_vis(visname, spw, fields, specavg, timeavg, keepmms) config_parser.overwrite_config(args['config'], conf_dict={'vis': "'{0}'".format(newvis)}, conf_sec='data') config_parser.overwrite_config( args['config'], conf_dict={'crosscal_vis': "'{0}'".format(visname)}, conf_sec='run', sec_comment='# Internal variables for pipeline execution') fnames = msmd.namesforfields() config_parser.overwrite_config( args['config'], conf_dict={'fieldnames': "{0}".format(fnames)}, conf_sec='run', sec_comment='# Internal variables for pipeline execution') msmd.done()
def main(args, taskvals): visname = va(taskvals, 'data', 'vis', str) calfiles, caldir = bookkeeping.bookkeeping(visname) fields = bookkeeping.get_field_ids(taskvals['fields']) do_pre_flag_2(visname, fields)
def main(args, taskvals): visname = va(taskvals, 'data', 'vis', str) calfiles, caldir = bookkeeping.bookkeeping(visname) fields = bookkeeping.get_field_ids(taskvals['fields']) do_cross_cal_apply(visname, fields, calfiles, caldir)
def main(args, taskvals): visname = va(taskvals, 'data', 'vis', str) calfiles, caldir = bookkeeping.bookkeeping(visname) fields = bookkeeping.get_field_ids(taskvals['fields']) refant = va(taskvals, 'crosscal', 'refant', str, default='m005') minbaselines = va(taskvals, 'crosscal', 'minbaselines', int, default=4) do_parallel_cal_apply(visname, fields, calfiles)
def main(args,taskvals): visname = va(taskvals, 'data', 'vis', str) badfreqranges = taskvals['crosscal'].pop('badfreqranges', ['935~947MHz', '1160~1310MHz', '1476~1611MHz', '1670~1700MHz']) badants = taskvals['crosscal'].pop('badants') calfiles, caldir = bookkeeping.bookkeeping(visname) fields = bookkeeping.get_field_ids(taskvals['fields']) do_pre_flag(visname, fields, badfreqranges, badants)
def main(args,taskvals): visname = va(taskvals, 'data', 'vis', str) calfiles, caldir = bookkeeping.bookkeeping(visname) fields = bookkeeping.get_field_ids(taskvals['fields']) minbaselines = va(taskvals, 'crosscal', 'minbaselines', int, default=4) standard = va(taskvals, 'crosscal', 'standard', str, default='Stevens-Reynolds 2016') refant = va(taskvals, 'crosscal', 'refant', str, default='m059') do_parallel_cal(visname, fields, calfiles, refant, caldir, minbaselines, standard)
def main(args, taskvals): visname = va(taskvals, 'run', 'crosscal_vis', str) keepmms = va(taskvals, 'crosscal', 'keepmms', bool) calfiles, caldir = bookkeeping.bookkeeping(visname) fields = bookkeeping.get_field_ids(taskvals['fields']) msmd.open(visname) if not os.path.exists(PLOT_DIR): os.mkdir(PLOT_DIR) # #Superseded by 'plotcal_spw.py' # #Plot solutions for bandpass calibrator # plotms(vis=calfiles.bpassfile, xaxis='Real', yaxis='Imag', coloraxis='corr', plotfile='{0}/bpass_real_imag.png'.format(PLOT_DIR),showgui=False) # plotms(vis=calfiles.bpassfile, xaxis='freq', yaxis='Amp', coloraxis='antenna1', plotfile='{0}/bpass_freq_amp.png'.format(PLOT_DIR),showgui=False) # plotms(vis=calfiles.bpassfile, xaxis='freq', yaxis='Phase', coloraxis='antenna1', plotfile='{0}/bpass_freq_phase.png'.format(PLOT_DIR),showgui=False) # # #Plot solutions for phase calibrator # plotms(vis=calfiles.gainfile, xaxis='Real', yaxis='Imag', coloraxis='corr', plotfile='{0}/phasecal_real_imag.png'.format(PLOT_DIR),showgui=False) # plotms(vis=calfiles.gainfile, xaxis='Time', yaxis='Amp', coloraxis='antenna1', plotfile='{0}/phasecal_time_amp.png'.format(PLOT_DIR),showgui=False) # plotms(vis=calfiles.gainfile, xaxis='Time', yaxis='Phase', coloraxis='antenna1', plotfile='{0}/phasecal_time_phase.png'.format(PLOT_DIR),showgui=False) # # #Plot solutions for individual antennas of bandpass and phase calibrator in 3x2 panels # plot_antennas('bpass',fields,calfiles,xaxis='freq',yaxis='amp') # plot_antennas('bpass',fields,calfiles,xaxis='freq',yaxis='phase') # plot_antennas('phasecal',fields,calfiles,xaxis='time',yaxis='amp') # plot_antennas('phasecal',fields,calfiles,xaxis='time',yaxis='phase') extn = 'mms' if keepmms else 'ms' for field in fields: for subf in field.split(','): fname = msmd.namesforfields(int(subf))[0] inname = '%s.%s.%s' % (os.path.splitext(visname)[0], fname, extn) if not os.path.exists('{0}/{1}_freq_amp.png'.format( PLOT_DIR, fname)): plotms(vis=inname, xaxis='freq', yaxis='Amp', coloraxis='corr', plotfile='{0}/{1}_freq_amp.png'.format(PLOT_DIR, fname), showgui=False) plotms(vis=inname, xaxis='Real', yaxis='Imag', coloraxis='corr', plotfile='{0}/{1}_real_imag.png'.format( PLOT_DIR, fname), showgui=False) msmd.done()
def main(args, taskvals): visname = va(taskvals, "data", "vis", str) if os.path.exists(os.path.join(os.getcwd(), "caltables")): shutil.rmtree(os.path.join(os.getcwd(), "caltables")) calfiles, caldir = bookkeeping.bookkeeping(visname) fields = bookkeeping.get_field_ids(taskvals["fields"]) spw = va(taskvals, "crosscal", "spw", str, default="") standard = va(taskvals, "crosscal", "standard", str, default="Stevens-Reynolds 2016") dopol = va(taskvals, 'run', 'dopol', bool, default=False) createmms = va(taskvals, 'crosscal', 'createmms', bool, default=True) do_setjy(visname, spw, fields, standard, dopol, createmms)