(1) START AIPS++: ------------------------------------------------------------------- cd to the directory in which you have the test measurement set (MS). Start AIPS++: If you have a file called "~/aips++/aipsinit.csh" then type: source ~/aips++/aipsinit.csh Continue by typing: aips++ Two things will happen: - The terminal in which you started aips++ will now take glish inputs (handy for starting viewer and for exiting) - A logger window GUI will come up (handy for telling you error messages during plotting) If your .aipsrc file includes the line: toolmanager.gui.auto: F Then the tool manager GUI will be disabled - this is fine - you don't need it. If the GUI comes up, just close it out. (2) IDENTIFY WHICH DATA HAVE BEEN FLAGGED: ------------------------------------------------------------------- This is easiest using the viewer - start the viewer at the glish prompt "- " by entering these two commands include 'viewer.g'; dv.gui(); This brings up two new GUI windows: Data Manager and Display Panel The Data Manager window will show a list of files in the directory you started AIPS++. Scroll down the list until you see the MS you want to view (e.g. data.ms). --> click on your data.ms file in the Data Manager window (I clicked on 20feb97-g067.ms) --> click on 'Raster Image' under DisplayData Type - If the MS is relatively small (it can fit into the available memory) then it will load into the viewer Display Panel directly. It will take a while to load in the data from the measurement set (possibly several minutes depending on the size of the data set) When it is done, you will see a pattern of stripes in the Display Panel screen. If the dataset is too large to load all at once, then In the Display Panel, you will see that the screen is grey - you need to click on the 'Adjust...' button in the lower left and then click on 'Apply' in the Adjust panel this will actually load the MS into the viewer. - The default display shows time versus baseline for spectral window (SPW) 1 ** note that AIPS++ will not display multiple spectral windows if they have different numbers of channels! - Flagged data is shown in purple and stands out nicely as long as there is enough of it. If you haven't already brought up the "Adjustment" GUI panel, then you can do so by clicking on the "Adjust..." button in the lower left of the Display Panel. Alternatively: --> click on DisplayData along the top edge of the display panel --> click on Adjust in the pop-up panel it brings up In the "Adjustment" GUI: --> click on "Basic settings" to shrink it --> click on "MS and Visibility Selection" to expand it This will let you select a subset of the data i.e. one spectral window at a time and/or one source at a time. For example, to select only spectral window 3 (where I happen to know there is data) --> Put your cursor in the white box to the right of the words "Spectral Windows", delete what is there. In the now empty Spectral Windows space, enter 3 and then move the cursor away (this will put [] around the 3 which is necessary for AIPS++) --> Then click on "Apply" (bottom left corner). Note: if you hit return after you edit the spectral windows choice, you don't have to click on the "Apply" button. You can now use the up and down arrows on the right side of the Display Panel GUI to step or scroll through the 64 channels in this data set; note that when scrolling (green arrows) the channel counter sometimes doesn't keep up with the display (hit the red square to stop and see what channel it says you're on). Play around with the features on the "Adjustment" GUI to show, e.g., the data in different color stretches or palettes (e.g. greyscale, hotmetal, rainbows), show a color bar or not, plot different axes, or show amplitude, phase or amplitude RMS etc. You have a wide range of options that can highlight bad data in different ways. To look at calibrator data only, select only those field IDs associated with calibrators. The display can be much easier to manage if you load less data at a time and display sources with similar amplitude scales. Note that you can see what data matches which calibrator by putting your cursor over the relevant place in the DISPLAY panel; source and time are then shown below the plot. Also, to zoom in on a region in the Display Panel: --> Click on the magnifying glass icon in at the left of the display --> Use your cursor to select a region in the display (click and drag the cursor to create a green box). If you want to change the size, just grab a corner with the mouse and move it. --> Double click in the green box to zoom in on that region. --> If you want to erase the box you just drew, put your cursor in the Display Panel and hit the "ESC" key on your keyboard. To unzoom, --> Click on the "Unzoom" button at the bottom of the display. As an example, for the 20feb97-g067.ms dataset, FLAGGING THAT SEEMS TO BE PRESENT: (calibrators only) All sources: channels 1-3 (all times), 62-64 (all times), 33-34 (all times) 0415 (field ID:1) - all channels, first block of data (12:57-13:18 approx) - channels 34-35 (all times) MWC349 (field ID 2) - channel 39-40, all times (only a small range of time) When you are finished looking at the data: --> exit viewer by clicking on red "DONE" buttons in Data Manager and Display Panel windows (3) INSPECT THE DATA USING AN XY PLOT (RATHER THAN RASTER SCANS) ------------------------------------------------------------------- This is most easily done with the msplot tool. To use msplot to view data in the file called data.unflagged.ms, type at the glish prompt: - include 'msplot.g'; - plot1 := msplot(msfile='data.unflagged.ms', edit=F); Setting edit=F means you can't change the flags accidentally. If you want to actually edit data, you must set edit=T in the above line. (but msplot comes up quicker if you set edit=F). This command brings up a new GUI window labeled msplot: "data.ms. (read only)" When the data is loaded, the logger will display a short summary of the data (so you can figure out what fields and spectral window IDs you have more easily). You may want to cut and paste this information into a text file and display it or print it out for easy reference. It is easiest to look at the data from one calibrator at a time. In the msplot GUI window: --> Click on the button "Data selection" --> In the yellow "Field ID" space, delete the word "" then enter the ID number of one of your calibrators. As soon as you move the cursor out of the window, you will get square brackets around the ID number you typed and the window will turn white to indicate you have manually set this selection. --> Now click on the button "Spectral selection" --> Clear the "List of Spectral Windows" field and then the spectral window ID associated with the calibrator you have chosen. E.g., if caibrator 2 was observed in spwid 4, then type in 4 --> Now click on the button in the top middle of the GUI called "X axis" --> In the pop-up window that comes up, click on "channel" --> Click on the green "Go" button in the upper right corner This will bring up a new window labeled "msplot:plot" and if all goes well, you will see data. (If you DON'T see data, look for yellow warnings in your log window; if there are any, check your inputs again.) In the example above, the plot will show amplitude versus channel for one calibrator sources. You can plot versus time, vs uvdistance, for different spectral windows and different source fields. You can also average channels to get higher S/N and plot versus time. (4) PARALLEL PLOTTING WITH MSPLOT ------------------------------------------------------------------- IT CAN BE HANDY (but you have to be careful) to bring up ANOTHER msplot window with the FLAGGED data set as input. That way you can have side-by-side plots showing you the data before and after flagging. To use msplot to view data in the file called data.flagged.ms, type at the glish prompt: - plot2 := msplot(msfile='data.flagged.ms', edit=F); Note: I called this msplot tool 'plot2' to distinguish it from the 'plot1' tool you are using to look at unflagged data. You will see another msplot selection GUI window. If you do the same selections (Data selection, spectral selection, X) as before and hit GO, you should get a second window showing you how the data look after they are flagged. In THIS case, you also need to select --> Click on the "Y axis" button --> Click on the "data" option in the pop-up window --> Click on the "what" option in the next pop-up --> Click on the "observed" option Otherwise you will see CALIBRATED data, which is harder to compare to the uncalibrated raw data To make the plots match for ease of comparison, set the y scale on the flagged data to match that used for the raw data. In the raw data msplot window: --> Click on "X,Y plot limits" --> Click on the "Range" button to the right of the yellow "Y" space In the flagged data msplot window: --> Click on "X,Y plot limits" --> Click on "Range" next to "Y" --> Clear the Y entry, then type in the same range you see displayed in the raw data msplot window. --> Click on GO to replot the data (5) NOTES AND CAVEATS ABOUT PLOTTING WITH MSPLOT ------------------------------------------------------------------- - If you set the Y plot limit manually, don't forget to set it back to Original with the wrench icon before you change your plotting variables. - Sometimes msplot gives an error but nothing is wrong. If you check your inputs and you can't see anything that's wrong, try clicking on Go again - Running the two msplot windows, I think it sometimes got confused if I tried to modify the inputs in one window while the second window was trying to plot. Safest to make yourself work sequentially - I generally like to look at these plots for each calibrator: * amplitude vs channel * phase vs channel * amplitude vs time * (phase vs time if anything odd was in phase vs channel) - When plotting amplitude vs time for the RAW data, you will see quite a scatter of points due to the noisy channels at the beginning and end of the spectrum. You can avoid plotting them using Spectral Selection i.e. Number of Channels 28 Start channel 4 will plot only channels 4-31, avoiding the bad channels at the start and in the middle of the band (6) AN EXAMPLE: DETAILED DATA INSPECTION WITH MSPLOT FOR 20feb97.ms ------------------------------------------------------------------- FLAGGING THAT SEEMS TO BE PRESENT: (calibrators only) (from inspection with viewer) All sources: channels 1-3 (all times), 62-64 (all times), 33-34 (all times) 0415 (field ID:1) - all channels, first block of data (12:57-13:18 approx) - channels 34-35 (all times) MWC349 (field ID 2) - channel 39-40, all times (only a small range of time) FieldID 1 (0415+379) amp vs channel: flagging looks perfect (ch 1-3, 32-35, 61-64) phase vs channel: there is some flagging here across all channels? phase vs time: yes, first set of data is flagged and should be (phase is all over the place) amp vs time: if use all channels, scattered points in unflagged data if use 4-31 or 36-61, plot is OK Flagging that is done seems OK Don't see anything that should have been flagged but wasn't FieldID 2 (MWC349) amp vs channel: flagging perfect (ch 1-3, 32-33, 61-64) phase vs channel: noticed ALSO flagged ch 39-40 (second dip) OK amp vs time: scattered high points 4-31 is OK; 41-61 is OK Flagging that is done seems OK Don't see anything that should have been flagged but wasn't FieldID 3 (0528+134) amp vs channel: channel flagging perfect; looks like spread of data is smaller? maybe a trick of the y scaling? yes, it is phase vs channel: OK phase vs time: OK amp vs time: ch 4-31; ch 34-61 all OK Flagging that is done seems OK Don't see anything that should have been flagged but wasn't Total elapsed time: approximately 2 hours (including making these notes) NOTE: for REAL test, I would need to look at spw 11, 15, 19 (1mm data) as well! -- ---- ------- ----------- Debra Shepherd e-mail: dshepher@aoc.nrao.edu National Radio Astronomy Observatory phone: (505) 835-7398 P.O. Box O FAX: (505) 835-7027 Socorro, NM 87801 http://www.nrao.edu/~dshepher