NRAO Home > CASA > CASA Cookbook and User Reference Manual
3.3.2.15 Example session using plotxy

The following is an example of interactive plotting and flagging using plotxy on the Jupiter 6cm continuum VLA dataset. This is extracted from the script jupiter6cm_usecase.py available in the script area.

This assumes that the MS jupiter6cm.usecase.ms is on disk with flagautocorr already run.

default(’plotxy’)  
 
vis = ’jupiter6cm.usecase.ms’  
 
# The fields we are interested in: 1331+305,JUPITER,0137+331  
selectdata = True  
 
# First we do the primary calibrator  
field = ’1331+305’  
 
# Plot only the RR and LL for now  
correlation = ’RR LL’  
 
# Plot amplitude vs. uvdist  
xaxis = ’uvdist’  
yaxis = ’amp’  
multicolor = ’both’  
 
# The easiest thing is to iterate over antennas  
iteration = ’antenna’  
 
plotxy()  
 
# You’ll see lots of low points as you step through RR LL RL LR  
# A basic clip at 0.75 for RR LL and 0.055 for RL LR will work  
# If you want to do this interactively, set  
iteration = ’’  
 
plotxy()  
 
# You can also use flagdata2 to do this non-interactively  
# (see below)  
 
# Now look at the cross-polar products  
correlation = ’RL LR’  
 
plotxy()  
 
#---------------------------------------------------------------------  
# Now do calibrater 0137+331  
field = ’0137+331’  
correlation = ’RR LL’  
xaxis = ’uvdist’  
spw = ’’  
iteration = ’’  
antenna = ’’  
 
plotxy()  
 
# You’ll see a bunch of bad data along the bottom near zero amp  
# Draw a box around some of it and use Locate  
# Looks like much of it is Antenna 9 (ID=8) in spw=1  
 
xaxis = ’time’  
spw = ’1’  
correlation = ’’  
 
# Note that the strings like antenna=’9’ first try to match the  
# NAME which we see in listobs was the number ’9’ for ID=8.  
# So be careful here (why naming antennas as numbers is bad).  
antenna = ’9’  
 
plotxy()  
 
# YES! the last 4 scans are bad.  Box ’em and flag.  
 
# Go back and clean up  
xaxis = ’uvdist’  
spw = ’’  
antenna = ’’  
correlation = ’RR LL’  
 
plotxy()  
 
# Box up the bad low points (basically a clip below 0.52) and flag  
 
# Note that RL,LR are too weak to clip on.  
 
#---------------------------------------------------------------------  
# Finally, do JUPITER  
field = ’JUPITER’  
correlation = ’’  
iteration = ’’  
xaxis = ’time’  
 
plotxy()  
 
# Here you will see that the final scan at 22:00:00 UT is bad  
# Draw a box around it and flag it!  
 
# Now look at whats left  
correlation = ’RR LL’  
xaxis = ’uvdist’  
spw = ’1’  
antenna = ’’  
iteration = ’antenna’  
 
plotxy()  
 
# As you step through, you will see that Antenna 9 (ID=8) is often  
# bad in this spw. If you box and do Locate (or remember from  
# 0137+331) its probably a bad time.  
 
# The easiset way to kill it:  
 
antenna = ’9’  
iteration = ’’  
xaxis = ’time’  
correlation = ’’  
 
plotxy()  
 
# Draw a box around all points in the last bad scans and flag ’em!  
 
# Now clean up the rest  
xaxis = ’uvdist’  
correlation = ’RR LL’  
antenna = ’’  
spw = ’’  
 
# You will be drawing many tiny boxes, so remember you can  
# use the ESC key to get rid of the most recent box if you  
# make a mistake.  
 
plotxy()  
 
# Note that the end result is we’ve flagged lots of points  
# in RR and LL.  We will rely upon imager to ignore the  
# RL LR for points with RR LL flagged!  


More information about CASA may be found at the CASA web page

Copyright © 2010 Associated Universities Inc., Washington, D.C.

This code is available under the terms of the GNU General Public Lincense


Home | Contact Us | Directories | Site Map | Help | Privacy Policy | Search