#--------------------------------------------
#Module step9(): Examine & edit the calibrated data -
#CASA task:
#     plotms
#--------------------------------------------
#
def step9():
 print "Examine & edit the calibrated data -"
 print "Plot Structure of vis function - Amplitude vs UVwave for "
 print "iterating "+BPname+", "+CGname+", "+T1name+",  and "+FLname
  user_check=raw_input('hit Enter for Amplitude-time spectral block 1 -')
 plotms(vis=datain+'_'+str(bw)+'.ms',
        ydatacolumn='corrected',
        xaxis='Time',
        yaxis='amp',
        coloraxis='spw',
        spw=blckspw1,
        avgchannel=str(nchspw),
        iteraxis='field')
 user_check=raw_input('hit Enter for Amplitude-time spectral block 2 -')
 plotms(vis=datain+'_'+str(bw)+'.ms',
        ydatacolumn='corrected',
        xaxis='Time',
        yaxis='amp',
        coloraxis='spw',
        spw=blckspw2,
        avgchannel=str(nchspw),
        iteraxis='field')
  user_check=raw_input('hit Return for Amplitude-uvwave for spectral block1 -')
 plotms(vis=datain+'_'+str(bw)+'.ms',
        ydatacolumn='corrected',
        xaxis='uvwave',
        yaxis='amp',
        coloraxis='spw',
        spw=blckspw1,
        avgchannel=str(nchspw),
        iteraxis='field')
 user_check=raw_input('hit Return for Phase-uvwave for spectral block1 -')
 plotms(vis=datain+'_'+str(bw)+'.ms',
        ydatacolumn='corrected',
        xaxis='uvwave',
        yaxis='phase',
        coloraxis='spw',
        spw=blckspw1,
        avgchannel=str(nchspw),
        iteraxis='field')
 user_check=raw_input('hit Return for Amplitude-uvwave for spectral block2 -')
 plotms(vis=datain+'_'+str(bw)+'.ms',
        ydatacolumn='corrected',
        xaxis='uvwave',
        yaxis='amp',
        coloraxis='spw',
        spw=blckspw2,
        avgchannel=str(nchspw),
        iteraxis='field')
 user_check=raw_input('hit Return for Phase-uvwave for spectral block2 -')
 plotms(vis=datain+'_'+str(bw)+'.ms',
        ydatacolumn='corrected',
        xaxis='uvwave',
        yaxis='phase',
        coloraxis='spw',
        spw=blckspw2,
        avgchannel=str(nchspw),
        iteraxis='field')
 user_check=raw_input('hit Return for Amplitude-uvwave for spectral block1 -')
 plotms(vis=datain+'_'+str(bw)+'.ms',
        ydatacolumn='corrected',
        xaxis='uvwave',
        yaxis='amp',
        coloraxis='spw',
        spw=blckspw1,
        avgchannel=str(nchspw),
        iteraxis='field')
 user_check=raw_input('hit Return for Phase-uvwave for spectral block1 -')
 plotms(vis=datain+'_'+str(bw)+'.ms',
        ydatacolumn='corrected',
        xaxis='uvwave',
        yaxis='phase',
        coloraxis='spw',
        spw=blckspw1,
        avgchannel=str(nchspw),
        iteraxis='field')
 user_check=raw_input('hit Return for Amplitude-uvwave for spectral block2 -')
 plotms(vis=datain+'_'+str(bw)+'.ms',
        ydatacolumn='corrected',
        xaxis='uvwave',
        yaxis='amp',
        coloraxis='spw',
        spw=blckspw2,
        avgchannel=str(nchspw),
        iteraxis='field')
 user_check=raw_input('hit Return for Phase-uvwave for spectral block2 -')
 plotms(vis=datain+'_'+str(bw)+'.ms',
        ydatacolumn='corrected',
        xaxis='uvwave',
        yaxis='phase',
        coloraxis='spw',
        spw=blckspw2,
        avgchannel=str(nchspw),
        iteraxis='field')
 user_check=raw_input('hit Enter to check fringe amp(t), BL as iteraxis, for block1&2 of field 0~7  , gone through by user')
 plotms(vis=datain+'_'+str(bw)+'.ms',
        ydatacolumn='corrected',
        field='0',
        xaxis='time',
        yaxis='amp',
        coloraxis='spw',
        spw=allspw2,
        avgchannel=str(nchspw),
        iteraxis='baseline')
 user_check=raw_input('hit Enter to check fringe spectra, spw as iteraxis, for block1 of fields 0~7, gone through by user')
 plotms(vis=datain+'_'+str(bw)+'.ms',
        ydatacolumn='corrected',
        xaxis='frequency',
        yaxis='amp',
        coloraxis='spw',
        field='0',
        spw=blckspw1,
        avgscan=T,
        avgchannel=str(avgchan0),
        iteraxis='spw')
 user_check=raw_input('hit Enter to check fringe spectra, spw as iteraxis, for block2 of fields 0~7, gone through by user')
 plotms(vis=datain+'_'+str(bw)+'.ms',
        ydatacolumn='corrected',
        xaxis='frequency',
        yaxis='amp',
        coloraxis='spw',
        field='0',
        spw=blckspw2,
        avgscan=T,
        avgchannel=str(avgchan0),
        iteraxis='spw')
 user_check=raw_input('hit Enter to check fringe spectra, BL as iteraxis, for block1 of fields 0~7, gone through by user')
 plotms(vis=datain+'_'+str(bw)+'.ms',
        ydatacolumn='corrected',
        xaxis='frequency',
        yaxis='amp',
        coloraxis='spw',
        field='0',
        spw=blckspw1,
        avgscan=T,
        avgchannel=str(avgchan0),
        iteraxis='baseline')
 user_check=raw_input('hit Enter to check fringe spectra, BL as iteraxis, for block2 of fields 0~7, gone through by user')
 plotms(vis=datain+'_'+str(bw)+'.ms',
        ydatacolumn='corrected',
        xaxis='frequency',
        yaxis='amp',
        coloraxis='spw',
        field='0',
        spw=blckspw2,
        avgscan=T,
        avgchannel=str(avgchan0),
        iteraxis='baseline')
 print "Done with inspecttion of the calibrated data!"