user_check=raw_input('hit Return to run plotms for ampl vs UTC through each spw -')
 print "Plot fringe ampl vs time (spw as iteraxis) -\n"
 plotms(vis=datain+'_'+str(bw)+'.ms',
        xaxis='time',
        yaxis='amp',
        field=BP,
        coloraxis='antenna1',
        spw=allspw,
        avgchannel=avgchan0,
        iteraxis='spw')
 print "Done with plotms for spw-based editing!"
#
 user_check=raw_input('hit Return to plot fringe ampl vs time through each BL -\n')
 print "Plot fringe ampl vs time (baseline as iteraxis) -\n"
 plotms(vis=datain+'_'+str(bw)+'.ms',
        xaxis='time',
        yaxis='amp',
        field=BP,
        coloraxis='spw',
        spw=allspw,
        avgchannel=avgchan0,
        iteraxis='baseline')
 print "Done with plotms for baseline-based editing!"
 user_check=raw_input('hit Enter to solve for delay -\n')
 os.system('rm -rf delays.cal')
 gaincal(vis=datain+'_'+str(bw)+'.ms', caltable='delays.cal', field=BP, scan='', spw=allspw,
        refant=rant, gaintype='K')
 user_check=raw_input('hit Return to continue script for display delay -\n')
 plotcal(caltable='delays.cal',xaxis='time',yaxis='delay',
        iteration='antenna',subplot=421)
 print "Done with gaincal for delay solving!"
 user_check=raw_input('hit Enter to solve for bandpass phase -\n')
 os.system('rm -rf bpphase.gcal')
 print "bpphase.gcal"
 gaincal(vis=datain+'_'+str(bw)+'.ms', caltable='bpphase.gcal', field=BP, scan='', spw=allspw,
        refant=rant,calmode='p',solint='int',minsnr=2.0,
        gaintable=['delays.cal'])
 print "plot the bandpass phase solutions"
 plotcal(caltable='bpphase.gcal',xaxis='time',yaxis='phase',
        iteration='antenna',subplot=421,plotrange=[0,0,-180,180])
 user_check=raw_input('hit Enter to solve for bandpass -\n')