21mar06 ------------------------------------------------------ Copied & printed the new cookbook from the web. Moved files in .ipython and .matplotlib directories in /users/dshepher to pretest.ipython.files and pretest.matplotlib.files. Then downloaded new iphthinrc and matplotlibrc files from the web and put them in .ipython and .matplotlib directories. Working in directory: /home/sola/dss/alma/tsts/offline/tst4.mar06/1.test Using VLA and BIMA data I downloaded from the web during pre-testing. source /home/basho/casa/framework/aipsinit.csh # CASA Version 1.9 Build 1315 which casapy: /home/basho/casa/framework/linux_gnu/bin/casapy > casapy # CASA log window came up. It is blank. # CASA xterm interface reports: # ___________________________________________________________ # Available tools: # # ms (MS) mp (MS plot) # cb (calibrater) cp (cal plot) # tb (table) tp (table plot) # im (imager) af (autoflag) # me (measures) # # pl (pylab functions) # # ___________________________________________________________ # Available tasks: # # data import : vlafiller, fitstoms # imaging : clean, feather, invert, mosaic, (wproj) # # ___________________________________________________________ # # type 'pdoc tool' or 'pdoc tool.function' for help # type 'quickhelp' for the available tool list # ___________________________________________________________ # Activating auto-logging. # Current session state plus future input saved to: ./ipython.log # Logging mode: append # # CASA [1]: ********************************** Command line access to the underlying directory and unix commands spot check: ls # casapy.log and ipython.log created less ipython.log # __IP.call_alias('ls','') # __IP.call_alias('less','ipython.log') less casapy.log # tab completion works. cd data.bima # works ********************************** spot checked pdoc, ?, quickhelp & help tools - looks good help im and im. gives information on the functions in im. But pdoc {tool} only returns: imager object calibrater object while pdoc vlafiller (a global function) returns full input listing and defaults. *** when I use the pdoc method to print documentation, if I just put in a tool, say im, I'd like to get a list of all the functions available in that tool. ********************************** Logs: I recommend: - One log holds commands AND system responses This should be the log that is visible in the window that comes up. - The 2nd log holds just commands (so you can build scripts more easily. ********************************** ms.open 'data/vla/B0319_0317.ms' # this is a typo, it should have been 'data.vla/...' # I got a SEVERE error but then the tool returned 'True' - Tue Mar 21 17:33:35 2006 SEVERE : Exception Reported: Table /home/sola/dss/alma/tsts/offline/tst4.mar06/ 1.test/data/vla/B0319_0317.ms does not exist ---------> ms.open('data/vla/B0319_0317.ms') Out[28]: True If the command can't execute, I think it should return 'False' ********************************** Submit a bug report at http://bugs.aoc.nrao.edu username = dshepher pswd = casabug99 ********************************** ms.open 'data.vla/B0319_0317.ms' # ---------> ms.open('data.vla/B0319_0317.ms') # Out[29]: True # I like the auto-parentheses function ms.summary # ---------> ms.summary() # Out[30]: {'header': {}, 'return': True} # Why the extra stuff and not just 'True'??? # It looks like the code response to users is not always consistent. # It should be. ms.done # ---------> ms.done() # Out[32]: False # Get rid of this - doesn't work does it? And not needed? ms.close # ---------> ms.close() # Out[33]: True ms.open 'data.vla/F0542_0317.ms' ms.summary ms.close # something wrong with the summary: # Tue Mar 21 17:59:08 2006 NORMAL ms::summary "Antennas: 2" # This is strange - the Antenna ID is not listed. # It was listed for the first one. ms.open 'data.vla/G0336_0317.ms' ms.summary ms.close # Tue Mar 21 17:59:08 2006 NORMAL ms::summary "Antennas: 2" # antenna ID missing in this one too. ### summaries in 1.vla.summary.txt ms.open 'data.bima/3C273_0506.ms' ms.summary ms.close ms.open 'data.bima/G1310_0506.ms' ms.summary ms.close # antenna IDs missing in both bima datasets too. ********************************** Repeat comment on summary listing in CASA log: ## Tue Mar 21 18:50:09 2006 NORMAL imager::Imager::summary() (file /home/basho/casa/framework/ code/synthesis/implement/MeasurementEquations/Imager.cc, line 1001): ***** I still want this confusing text deleted in the final output summary. ********************************** Cookbook intro detailed comments since I requested a major re-write of this: I like the section 1.3.1 On-line help Its straight forward to go through Section 1.3.3 (autoparen) and 1.3.4 specifying arguments to functions: VERY NICE. section 1.3.4 shell access - good at first, then gets complicated. At least it is all combined if someone wants to skip some of this now. Typo on pg 19: Change "CASA [3]: sx ls v* # stores output of 'pwd' in a list to "CASA [3]: sx ls v* # stores output of 'ls' in a list Section 1.3.5 Logging - good to have this all together. Still needs some work: Mention that the logfile command is specified in the ipythonrc file so people know where to change this default. logstate example returns 'File: ipython.log' - typo? Shouldn't this be ./ipython.log? The final note doesn't help me much - what is a 'primitive state' and how does this affect the user? This could indicate that the user should expect crashes. I doubt if you mean this. Please clarify. section 1.3.6 history and searching History part need a little re-work - intro and follow through on example needed. Example inputs need to match output. I have hand written notes. Search part - interesting. good. hist() command works well now. section 1.3.7 macros good section 1.3.8 on line editing I think you should mention that emacs is also available on-line, we are not limited to !vi... section 1.3.9 executing python scripts # Created test.py file: ms.open ('data.vla/G0336_0317.ms') ms.summary() ms.close() execfile 'test.py' # OK, worked. Easy. run -i 'test.py' # worked. NICE. Section 1.3.10 How do I exit from CASA? Humm, I would put this in section 1.2.3 - right after the startup explanations. Its so critical that it should be early in the manual. Section 1.3.11 Tools in CASA good. - On the im.summary() example: I would not list the whole summary of this dataset. Especially with all the extra lines running off the page, it is confusing and I can easily see that the user might wonder whether they are supposed to learn about tools or what the contents of a summary listing is. OK, that is it on comments for chapter 1. ********************************** *************************************** ******************************************** ************************************************* move on to data reduction: ********************************************************* dell -r vla.b.m vla.b.mf vla.g.m vla.g.mf ################## VLA BANDPASS CALIBRATOR ################## ms.open 'data.vla/B0319_0317.ms' ms.summary ms.done mp.open msname='data.vla/B0319_0317.ms' pl.clf mp.setspectral mp.plotoptions subplot=131 mp.uvdist column='data', what='amp' mp.setspectral nchan=1, start=5, width=50 mp.plotoptions plotsymbol='o', subplot=132 mp.uvdist column='data', what='amp' mp.setspectral nchan=50, start=5, width=1 mp.plotoptions subplot=133 mp.uvdist column='data', what='amp' pl.clf mp.setspectral mp.plotoptions subplot=131 mp.uvdist column='data', what='phase' mp.setspectral nchan=1, start=5, width=50 mp.plotoptions plotsymbol='o', subplot=132 mp.uvdist column='data', what='phase' mp.setspectral nchan=50, start=5, width=1 mp.plotoptions subplot=133 mp.uvdist column='data', what='phase' pl.clf mp.setspectral mp.plotoptions plotsymbol='o', subplot=231 mp.array mp.plotoptions plotsymbol='o', subplot=232 mp.baseline mp.plotoptions subplot=233 mp.vistime mp.plotoptions subplot=234 mp.azimuth mp.plotoptions subplot=235 mp.vischannel mp.plotoptions subplot=236 mp.hourangle() # bummer to have the title always there and not be able to change the labeling characteristics. pl.clf mp.setspectral mp.plotoptions subplot=231 mp.elevation mp.plotoptions subplot=232 mp.parallacticangle mp.plotoptions plotsymbol='o', subplot=233 mp.uvcoverage # need a ledgend saying what red and black points are # maybe report this type of plot-specific information in the log # window? mp.plotoptions subplot=234 mp.uvdist # it is not pretty when dealing with subplots because of overlapping text but it works. pl.clf mp.setspectral mp.plotoptions mp.vischannel column='data', what='amp' mp.markflags # nothing looks horrid, just flag 1st and last channels mp.flagdata # NICE report now on what is selected. # Region to Flag (data) : 61.523573201 5.46437894933e-17 -> 62.635235732 0.235714285714 # Region to Flag (data) : 1.07692307692 0.0178571428571 -> 2.46650124069 1.24285714286 # Data is replotted with selected data missing. # I would still like to option of seeing the data that I've selected as a different color mp.flagdata(diskwrite=true) # Report: Flags written to disk. # Still want to see the data flagged as a different color/symbol mp.close # verify flagging: mp.open msname='data.vla/B0319_0317.ms' mp.vischannel column='data', what='amp' mp.close # flags were saved - excellent # Note: plotter remains open after closing the mp. hit the 'x' to clean up desk top. Nothing bad seems to have happened. ############ Calibrate the Bandpass calibrator: ############ # 63 channels, 1 and 63 were flagged above # observed for 10min total, probably made with 10s integrations # use a 30s gcal interval cb.open('data.vla/B0319_0317.ms') cb.initcalset cb.reset cb.setsolve type='M', t=30, table='vla.b.m' cb.state cb.solve # Found 17 good M Mueller solutions. # 0 solution intervals failed, or had insufficient data. #### I wish I knew who or what Mueller was. I searched the online cookbook for 'mueller' and there is no mention of him/her. Can you give me a hint? cb.reset cp.open('vla.b.m') pl.subplot(121) cp.plot plottype='AMP' pl.subplot(122) cp.plot plottype='phase' # Oh cute, the solutions are sky blue here ### Try some plot interaction testing: open mp without closing cp. mp.open msname='data.vla/B0319_0317.ms' # OK, mp took over cp plot window. # but I would like to see the data and the cal solutions at the same time. So I would like to assign a plot window version so data is plotted in window 1 and cal solutions are plotted in window 2. pl.clf mp.setspectral mp.plotoptions subplot=111 mp.uvdist column='data', what='amp' # zoom and pan work well. # I still want popup help on the bottom left buttons Now you can click on a button and see some help on the right but I would rather not have to take action (e.g. click a button) before I can see the help text. # saved some plots as .png, eps - worked and as .svg - not sure what this is, I need documentation I can't use xv to view svg files... ##### I still want to be able to plot any column against any other, to select specific ranges of time or hour angle coverage, or channels and only plot them, mp.close # cp is still open. pl.clf # humm, I close mp, window remains up, then I do a pl.clf because cp is still open and a new plot window opens up. pl.subplot(122) cp.plot plottype='phase' cp.close # plot window goes away when you close. #### mp and cp behavior should be the same when you close the window. Once this is achieved, then lets talk about having 2 plot windows up and be able to direct plot output to a specific window. # OK. gain solutions look reasonable. cb.reset cb.setapply type='M', table='vla.b.m' cb.setsolve type='MF', t=1000, table='vla.b.mf' cb.state cb.solve cp.open('vla.b.mf') pl.subplot(121) cp.plot plottype='AMP' pl.subplot(122) cp.plot plottype='phase' # now we have lots of different colors. They look pretty but I need a legend on what colors mean. # Interesting, the first and last channels have solutions even though the data is flagged. Tbe solutions are zero. Why are solutions derived for flagged data? cp.close # In any event, it looks OK cb.reset cb.setdata nchan=61, start=1, step=1 # humm, nchan default = 1, according to online help. It should be all channels... In fact, the cookbook suggests that it is all channels. One of the help text must be wrong. # select all but first and last channels. # Tue Mar 21 21:40:04 2006 WARN Calibrater::setdata: # Selection is empty: reverting to sorted MeasurementSet # why is the selection empty? cb.setdata mode='none, nchan=61, start=1, step=1 # SyntaxError: EOL while scanning single-quoted string # good error message but yipes, I can't read these sky blue, bright green, and yellow letters. Please make these colors have some black mixed in so I can read them easier. cb.setdata mode='none', nchan=61, start=1, step=1 # selection is still empty cb.setdata nchan=30, start=10, step=1 # selection is still empty # It appears that set data is not working. # I only have one field so I should not need msselect. try anyway. cb.setdata nchan=61, start=1, step=1, msselect='FIELD_ID==0' # humm, this it likes... Selection did not drop any rows cb.setdata nchan=30, start=1, step=1, msselect='FIELD_ID==0' # Selection did not drop any rows, humm it should have only selected some rows. # It really does look to me like setdata is broken. OK if all you want to do is select source fields but it looks like you must have msselect TAQL string and nchan/start/step is not working at all. # Assume that the cookbook is correct and I just need to set the msselect for field 0.. cb.reset cb.setdata msselect='FIELD_ID==0' cb.setapply type='M', table='vla.b.m' cb.setapply type='MF', table='vla.b.mf' cb.state cb.correct cb.close # Look at corrected data: mp.open 'data.vla/B0319_0317.ms' pl.clf mp.setspectral mp.plotoptions subplot=121 mp.uvdist column='data', what='amp' mp.plotoptions subplot=122 mp.uvdist column='corrected', what='amp' pl.clf mp.setspectral mp.plotoptions subplot=121 mp.uvdist column='data', what='phase' mp.plotoptions subplot=122 mp.uvdist column='corrected', what='phase' # corrected and data columns look right mp.setspectral nchan=1, start=5, width=50 mp.plotoptions subplot=121 mp.uvdist column='data', what='amp' mp.plotoptions subplot=122 mp.uvdist column='corrected', what='amp' # I wish I could put these on the same scale... ####### mp.plotoptions? gives a bunch of text that looks like: ESC[1;31mType: ESC[0mbuiltin_function_or_method ESC[1;31mBase Class: ESC[0m I have to hit 'q' to get out of this I think something is wrong with the help file? # same thing happens with pl.axes? # Here I want to see the corrected and data columns displayed on the same scale so I can compare the scatter in the resulting values. pl.clf mp.setspectral nchan=1, start=5, width=50 mp.plotoptions subplot=121 mp.uvdist column='data', what='amp' pl.xlim(xmin=44.5, xmax=44.9) pl.ylim(ymin=0.25, ymax=1.25) mp.plotoptions subplot=122 mp.uvdist column='corrected', what='amp' pl.xlim(xmin=44.5, xmax=44.9) pl.ylim(ymin=0.25, ymax=1.25) # Odd that I have to first plot stuff and then replot the points to get the scale changed. Then, the x-axis doesn't look pretty (numbers overlap and are crowded. I can do it though. ###### Setting the xy limits should be something in plotoptions... pl.clf mp.setspectral nchan=63, start=0, width=1 # first and last channels are flagged. Error: SEVERE : [ MsPlot::setSpectral() ] The relationship 'l_nChan[i]*l_width[i] + l_start[i] > totalNchan[i]-1' must hold! ###### Not good. This should work even if the first channel is flagged. mp.setspectral nchan=61, start=1, width=1 mp.plotoptions subplot=121 mp.vischannel column='data', what='amp' pl.ylim(ymin=0, ymax=3) mp.plotoptions subplot=122 mp.vischannel column='corrected', what='amp' pl.ylim(ymin=0, ymax=3) # flag last channels that are not well calibrated: pl.clf mp.setspectral nchan=61, start=1, width=1 mp.vischannel column='corrected', what='amp' mp.markflags # mark one more channel at the beginning 0,1 flagged and last 3 channels 59,60,61,62,63 now flagged mp.flagdata(diskwrite=true) # remaining channels = 2 - 58 pl.clf mp.setspectral nchan=57, start=2, width=1 mp.plotoptions subplot=121 mp.vischannel column='data', what='amp' pl.ylim(ymin=0, ymax=3) mp.plotoptions subplot=122 mp.vischannel column='corrected', what='amp' pl.ylim(ymin=0, ymax=3) pl.clf mp.setspectral nchan=57, start=2, width=1 mp.plotoptions subplot=121 mp.vischannel column='data', what='phase' ##### plot is from -3 to +4 - this should be -180 to 180 deg mp.plotoptions subplot=122 mp.vischannel column='corrected', what='phase' pl.ylim(ymin=-3, ymax=4) # OK, at least I can tell that things look about right mp.close # note, plotting has been robust, no crashes where as during pretesting there were several crashes and/or hangs by this time. ### create the uvmodel of a point source and overplot it: No flux scaling, so assume 1 Jy flux density at the phase center. cb.modelfit ##### There appears to be no way to tell it what column to use. Does it automatically use CORRECTED_DATA column? It might but I can't tell. This needs to be more clear. Assume this operates on CORRECTED_DATA column cb.open 'data.vla/B0319_0317.ms' cb.modelfit niter=5, compshape='P', par=[1,0,0], file='vla.b.cl' iter=0 chi2=2431.3: I=1, dir=[0, 0] arcsec iter=1 chi2=2431.3: I=1, dir=[-1.60778e-08, 4.41383e-08] arcsec iter=2 chi2=2431.3: I=1, dir=[-1.76856e-08, 4.85521e-08] arcsec iter=3 chi2=2431.3: I=1, dir=[-1.78464e-08, 4.89935e-08] arcsec iter=4 chi2=2431.3: I=1, dir=[-1.94542e-08, 5.34074e-08] arcsec # chi2 didn't go down as the cookbook says it should. cb.modelfit niter=15, compshape='P', par=[1,0,0], file='vla.b2.cl' # chi2 remains rock solid, what goes? cb.close # use the component list file to fill the MODEL_DATA column: im.open 'vla.data/B0319_0317.ms' # error, wrong data path. im.open 'data.vla/B0319_0317.ms' ##### Whoa - what goes? CASA [380]: im.open 'data.vla/B0319_0317.ms' *** glibc detected *** double free or corruption (!prev): 0x09f06260 *** ----------> im.open('data.vla/B0319_0317.ms') Abort (core dumped) ############### CRASH AND BURN - first time in 6 hours of testing. interaction between cb and im? ## Restart casapy im.open 'data.vla/B0319_0317.ms' # worked this time im.ft complist='vla.b.cl' im.close # Plot MODEL_DATA column over CORRECTED_DATA column mp.open msname='data.vla/B0319_0317.ms' mp.uvdist column='corrected' mp.plotoptions overplot=true, plotsymbol='bo' mp.uvdist column='model' # It looks very nice with green or blue dots at 1 for all uv points. But is it right? The convergence just doesn't look right and the model looks too perfect relative to the data. Not sure about this. # Cookbook suggests that you split and average the data before deriving a model. ########### It would be better to have a channel averaging input in model fit rather than having to split and average the data and then use this to derive the model. ms.split(outputms='B0319_0317.split.ms', nchan=1, start=2, step=57, whichcol="CORRECTED_DATA") # CASA [12]: ms.split(outputms='B0319_0317.split.ms', # ....: nchan=1, start=2, step=57, # ....: # Display all 276 possibilities? (y or n) # This thinks I'm in help now, what, I can't continue lines??? ms.split(outputms='B0319_0317.split.ms', nchan=1, start=2, step=57, whichcol="CORRECTED_DATA") # Oh, right, I have to open the tool. Tasks will be nice... ms.open 'data.vla/B0319_0317.ms' ms.split(outputms='B0319_0317.split.ms', nchan=1, start=2, step=57, whichcol="CORRECTED_DATA") ms.close mp.open msname='B0319_0317.split.ms' mp.plotoptions mp.vischannel column='corrected' # hey, there are 61 channels here, ###### First off the split function did not average the data for me into one channel, and ###### Second off, the 2nd flag that I performed on the dataset didn't take... DACH. mp.close # more testing to verify mp.open msname='data.vla/B0319_0317.ms' mp.plotoptions mp.vischannel column='corrected' # last end channels I flagged are still there... # reflag with previous commands and verify: pl.clf mp.setspectral nchan=61, start=1, width=1 mp.vischannel column='corrected', what='amp' mp.markflags # mark one more channel at the beginning 0,1 flagged and last 3 channels 59,60,61,62,63 now flagged mp.flagdata(diskwrite=true) # Response: Region to Flag (data) : 58.4665012407 0.0803571428571 -> 61.9404466501 4.31632653061 Region to Flag (data) : 0.521091811414 0.0803571428571 -> 1.35483870968 1.79081632653 mp.flagdata(diskwrite=true) Flags written to disk. # data is not plotted. mp.done mp.open msname='data.vla/B0319_0317.ms' pl.clf mp.setspectral nchan=61, start=1, width=1 mp.vischannel column='corrected', what='amp' # sure enough, flags did not take. But they took the first time... mp.markflags mp.flagdata mp.flagdata(diskwrite=true) mp.done mp.open msname='data.vla/B0319_0317.ms' pl.clf mp.setspectral nchan=61, start=1, width=1 mp.vischannel column='corrected', what='amp' # flags still did not take... # try flagging on the DATA column: mp.vischannel column='data', what='amp' mp.markflags mp.flagdata(diskwrite=true) mp.done mp.open msname='data.vla/B0319_0317.ms' pl.clf mp.setspectral nchan=61, start=1, width=1 mp.vischannel column='corrected', what='amp' # nope, still won't work. # Its as if I'm only allowed one flagging event and nothing else. ####### BUG... mp.close # Go with what I"ve got: cb.open 'B0319_0317.split.ms' cb.modelfit niter=5, compshape='P', par=[1,0,0], file='vla.b3.cl' iter=0 chi2=2431.3: I=1, dir=[0, 0] arcsec iter=1 chi2=2431.3: I=1, dir=[-1.60778e-08, 4.41383e-08] arcsec iter=2 chi2=2431.3: I=1, dir=[-1.76856e-08, 4.85521e-08] arcsec iter=3 chi2=2431.3: I=1, dir=[-1.78464e-08, 4.89935e-08] arcsec iter=4 chi2=2431.3: I=1, dir=[-1.94542e-08, 5.34074e-08] arcsec # absolutely no change from before but since split didn't average the data I guess I don't expect any difference... cb.close # try splitting once more, no line break: ms.open 'data.vla/B0319_0317.ms' ms.split(outputms='B0319_0317.split2.ms', nchan=1, start=2, step=57, whichcol="CORRECTED_DATA") ms.close mp.open msname='B0319_0317.split2.ms' mp.plotoptions mp.vischannel column='data' # nope, there are 61 channels and nothin' on... ---------- ########### Summary: ms.split won't average channels mp.flag won't work 2nd time but does work the first time. Try with a different dataset: G0336_0317.2.ms mp.open "data.vla/G0336_0317.2.ms" mp.vischannel column='data', what='amp' mp.markflags mp.flagdata # took out a square chunk mp.flagdata(diskwrite=true) mp.close mp.open "data.vla/G0336_0317.2.ms" mp.vischannel column='data', what='amp' # flags took. mp.markflags mp.flagdata mp.flagdata(diskwrite=true) mp.close mp.open "data.vla/G0336_0317.2.ms" mp.vischannel column='data', what='amp' # flags took. mp.vischannel column='corrected', what='amp' # strange, there is a corrected data column that is different from the data column... what processing has been going on before we got the data? mp.vischannel column='data', what='amp' # In any event, both flag zones are still there... mp.close mp.open "data.vla/G0336_0317.ms" mp.vischannel column='data', what='amp' mp.markflags # mark an empty region (I can't undo a region once I start it, DACH). # mark a point in channel 11 around amp=1.2 mp.flagdata mp.flagdata(diskwrite=true) mp.close mp.open "data.vla/G0336_0317.ms" mp.vischannel column='data', what='amp' # OK, so that flag stayed. mp.vischannel column='corrected', what='amp' mp.markflags # flag last 3 columns: mp.flagdata(diskwrite=true) mp.close mp.open "data.vla/G0336_0317.ms" mp.vischannel column='corrected', what='amp' # data remains flagged now... mp.markflags # flag channel 1 (2nd channel) and last channel like last time: mp.flagdata(diskwrite=true) mp.close mp.open "data.vla/G0336_0317.ms" mp.vischannel column='corrected', what='amp' # data is staying flagged. So why couldn't I do this on the first dataset? # re-try flagging the first dataset: ### Once more: mp.open msname='data.vla/B0319_0317.ms' mp.vischannel column='data', what='amp' mp.vischannel column='corrected', what='amp' mp.markflags # mark last 3 channels and 1st channel mp.flagdata(diskwrite=true) mp.done mp.open msname='data.vla/B0319_0317.ms' pl.clf mp.vischannel column='corrected', what='amp' # now it works. Was I in a strange state before? ######### DACH, don't you hate non-repeatable bugs? End testing for today. ==================================================================== ==================================================================== 22mar06 Talked to Joe (about user & software errors in above testing) and George (about what to expect from uv model fitting). Excellent support on both counts. Very helpful. # user error = I needed to set nomodify='false' when I opened the MS before splitting - This is non-intuitive - I'm not modifying the original dataset, just reading and writing out a portion of it. I can't wait for this to be a task so the user will not have to know how the code is written to perform a task. # I should highlight this as a consideration that should be taken into account before each task is defined. # software error = the function should have given me a warning if it could not combine channels, instead it merrily wrote the original dataset out without telling me there was something amiss. # documentation error = the cookbook does mention that you need to set nomodify='false' but the online documentation (which was what I was using) did not. It did not refer to conditions in the tool setup which affected the function behavior. It should have. Of course, once this is a task this will be a moot point. # OK, I got the data flagged properly yesterday. Now evaluate the # performance of uvmodel. First, average the calibrated data with # SPLIT and then rederive the uvmodel to see how/if it changes. dell -r B0319_0317.split.ms B0319_0317.split2.ms ms.open thems='data.vla/B0319_0317.ms', nomodify='false' # exceptions.TypeError Traceback (most recent call last) # /home/sola/dss/alma/tsts/offline/tst4.mar06/1.test/ # TypeError: an integer is required ########### An integer? 1 or 0? # humm, I'm not allowed to use the word false even though on-line document and cookbook says this is what I should do... ######## BUG. # Humm, is true=1 and false = 0 in a zero based system? try it. ms.open thems='data.vla/B0319_0317.ms', nomodify=0 ms.split(outputms='B0319_0317.split.ms', nchan=1, start=2, step=57, whichcol="CORRECTED_DATA") ms.close mp.open "B0319_0317.split.ms" mp.vischannel what='amp' # humm, there are 58 channels, that obviously didn't work. mp.close ------------ ms.open thems='data.vla/B0319_0317.ms', nomodify=1 ms.split(outputms='B0319_0317.split2.ms', nchan=1, start=2, step=57, whichcol="CORRECTED_DATA") ms.close mp.open "B0319_0317.split2.ms" mp.vischannel what='amp' # humm, there are still 58 channels, mp.close --------------- # Try no parenthesis: ms.open thems='data.vla/B0319_0317.ms', nomodify=false ms.split(outputms='B0319_0317.split3.ms', nchan=1, start=2, step=57, whichcol="CORRECTED_DATA") ms.close # seemed to work. mp.open "B0319_0317.split3.ms" mp.vischannel what='amp' # there are still 58 channels, mp.close ####### OK, stop trying to use ms.split. Sent Joe message that I still can't get it to work. ------------------------------------------ # see what happens if I don't get close to the right flux or position: cb.open 'data.vla/B0319_0317.ms' cb.modelfit niter=5, compshape='P', par=[2,0,0], file='vla.b4.cl' iter=0 chi2=8672.23: I=2, dir=[0, 0] arcsec iter=1 chi2=1963.85: I=0.871426, dir=[-0.0480486, 0.131918] arcsec iter=2 chi2=1963.85: I=0.871426, dir=[-0.0480486, 0.131918] arcsec iter=3 chi2=1963.85: I=0.871426, dir=[-0.0480486, 0.131918] arcsec iter=4 chi2=1963.85: I=0.871426, dir=[-0.0480486, 0.131918] arcsec cb.close # humm, it didn't converge to 1 Jy flux. cb.open 'data.vla/B0319_0317.ms' cb.modelfit niter=5, compshape='P', par=[0.5,0,0], file='vla.b5.cl' iter=0 chi2=3627.73: I=0.5, dir=[0, 0] arcsec iter=1 chi2=1996.64: I=0.869928, dir=[-0.192194, 0.527674] arcsec iter=2 chi2=1973.91: I=0.870625, dir=[-0.110266, 0.303069] arcsec iter=3 chi2=1973.17: I=0.871023, dir=[-0.109988, 0.304307] arcsec iter=4 chi2=1973.17: I=0.871023, dir=[-0.109987, 0.30431] arcsec cb.close # converged to a similar value. Does this mean that the calibration was off? Because it should converge onto the assumed value of 1 Jy flux. Plot the data to see what the average is: mp.open "data.vla/B0319_0317.ms" mp.vischannel column='corrected', what='amp' # there are 58 channels, average looks to be about 1 although the range goes from 0 to 2.5. # I want to average all the uv points in a given channel to see how this # average value compares with the spread in the data. It doesn't appear that I can do this... Another reason why we need more flexible selections in plotting - we need every possible combo and the developer doesn't always know what is needed in every circumstance. They should not have to second guess what is needed. Just provide adequate flexibility. # see what this does: mp.setspectral nchan=2, start=2, width=29 mp.plotoptions overplot=true mp.vischannel column='corrected', what='amp' # OK, when the data is averaged into 2 channels, the higher SNR data # cluster very closely around 1.0. It is most certainly not 0.87. # Calibration is OK. # ==> So, the uvmodel should converge to a flux of 1. # save plot as 0.amp.chan.all.and.2ave.chans.eps mp.close cb.open 'data.vla/B0319_0317.ms' cb.modelfit niter=5, compshape='P', par=[0.8,0,0], file='vla.b6.cl' iter=0 chi2=2133.19: I=0.8, dir=[0, 0] arcsec iter=1 chi2=1976.61: I=0.870227, dir=[-0.120116, 0.329811] arcsec iter=2 chi2=1973.17: I=0.871018, dir=[-0.110407, 0.30311] arcsec iter=3 chi2=1973.17: I=0.871023, dir=[-0.110147, 0.303871] arcsec iter=4 chi2=1973.17: I=0.871023, dir=[-0.110147, 0.303871] arcsec cb.close # still converging to the wrong place. cb.open 'data.vla/B0319_0317.ms' cb.modelfit niter=5, compshape='P', par=[0.9,0,0], file='vla.b6.cl' iter=0 chi2=1913.17: I=0.9, dir=[0, 0] arcsec iter=1 chi2=1913.17: I=0.9, dir=[-2.13665e-08, 5.86572e-08] arcsec iter=2 chi2=1913.17: I=0.9, dir=[-2.15802e-08, 5.92438e-08] arcsec iter=3 chi2=1913.17: I=0.9, dir=[-2.16015e-08, 5.93025e-08] arcsec iter=4 chi2=1913.17: I=0.9, dir=[-2.16037e-08, 5.93083e-08] arcsec cb.close # won't change flux value at all. cb.open 'data.vla/B0319_0317.ms' cb.modelfit niter=5, compshape='P', par=[0.95,0,0], file='vla.b6.cl' iter=0 chi2=1855.32: I=0.95, dir=[0, 0] arcsec iter=1 chi2=1855.32: I=0.95, dir=[-2.0242e-08, 5.557e-08] arcsec iter=2 chi2=1855.32: I=0.95, dir=[-2.04444e-08, 5.61257e-08] arcsec iter=3 chi2=1855.32: I=0.95, dir=[-2.04646e-08, 5.61813e-08] arcsec iter=4 chi2=1855.32: I=0.95, dir=[-2.04666e-08, 5.61868e-08] arcsec cb.close # interesting, it overwrites the file or appended to it without asking me if I wanted to. It shouldn't do this. ##### OK, at this point, I think the point source convergence is not working in the way I would expect. Perhaps I'm wrong but I don't think that there are this many local minima in this data that it can converge to. It should converge to 1, not 0.87 or 0.9 or 0.95. I don't know what is in vla.b6.cl so erase it and put in a clean model: dell -r vla.b6.cl cb.open 'data.vla/B0319_0317.ms' cb.modelfit niter=5, compshape='P', par=[0.8,0,0], file='vla.b6.cl' iter=4 chi2=1973.17: I=0.871023, dir=[-0.110147, 0.303871] arcsec cb.close cb.open 'data.vla/B0319_0317.ms' cb.modelfit niter=5, compshape='P', par=[0.9,0,0], file='vla.b7.cl' iter=4 chi2=1913.17: I=0.9, dir=[-2.16037e-08, 5.93083e-08] arcsec cb.close cb.open 'data.vla/B0319_0317.ms' cb.modelfit niter=5, compshape='P', par=[1,0,0], file='vla.b8.cl' iter=0 chi2=1832.23: I=1, dir=[0, 0] arcsec cb.close cb.open 'data.vla/B0319_0317.ms' cb.modelfit niter=5, compshape='P', par=[1.1,0,0], file='vla.b8.cl' iter=4 chi2=1838.78: I=0.985149, dir=[-0.0582723, 0.159974] arcsec # OK, this one is trying to get to 1 but stops at 0.985 cb.close cb.open 'data.vla/B0319_0317.ms' cb.modelfit niter=5, compshape='P', par=[1.2,0,0], file='vla.b8.cl' iter=4 chi2=1968.92: I=0.870627, dir=[-0.0800853, 0.219852] arcsec # jumps back to 0.87 again... cb.close ### so chi2 is a minimum around 1, but it won't converge to that minimum in this simple dataset. what does that mean? # compare models with actual plotted data: im.open 'data.vla/B0319_0317.ms' im.ft complist='vla.b6.cl' im.close mp.open msname='data.vla/B0319_0317.ms' mp.setspectral nchan=2, start=2, width=29 mp.plotoptions plotsymbol='o' mp.uvdist column='corrected' mp.plotoptions overplot=true, plotsymbol='bo' mp.uvdist column='model' mp.close # yep, this model clearly doesn't match. So what is reported in the modelfit routine is what is actually found. # save plot as 0.amp.corr.and.model.b6.eps ######### This seems like a problem in convergence to me. Talk to Joe - he verified that this is not working properly. He brought in the same dataset that was calibrated differently (different pre-averaging set up, etc...) and it did converge. # so the convergence algorithm is not very robust. My data is adequately calibrated but uvmodelfit doesn't converge. Joe's data is differently adquately calibrated but uvmodelfit does converge. # My data is calibrated with: cb.open('data.vla/B0319_0317.ms') cb.initcalset cb.reset cb.setsolve type='M', t=30, table='vla.b.m' cb.solve cb.reset cb.setapply type='M', table='vla.b.m' cb.setsolve type='MF', t=1000, table='vla.b.mf' cb.solve # Joe's data is calibrated with: cb.open('B0319_0317.ms') cb.initcalset() cb.reset() cb.setsolve(type='M', t=3, table='B0319.M') cb.solve() cb.reset() cb.setapply(type='M', table='B0319.M') cb.setsolve(type='MF', t=30000, table='B0319.MF') cb.solve() # the only difference between the 2 is that I'm doing a pre-average of 30s and Joe takes a pre-average time of 3s. (mf time doesn't count, we still both get one solution). Joe took my calibrated dataset and ran it in the new CASA that has improvements in the robustness of how the model converges and it works. So this problem appears to have been solved in the latest version of CASA but that version is not quite ready for user testing. Its nice to see that CASA is fixing problems before they are found by testers. ------------------------------------------ Joe has workaround for ms.split - the defaulting is not working. So I can split/average the data if I specify all inputs/outputs explicitely, e.g. ms.open 'data.vla/B0319_0317.ms',false ms.split outputms='test.ms', fieldids=0, spwids=0, nchan=3, start=2, step=15, whichcol='CORRECTED_DATA' mp.open('test.ms') mp.plotoptions plotsymbol='bo' mp.vischannel # works like a charm... ------------------------------------------ OK, move on. For the rest of the testing, take a pre-average of 3s for the gain cal so my solutions will converge on other datasets. =============================================== ======================================================================== ################## VLA GAIN CALIBRATOR ################## ms.open 'data.vla/G0336_0317.ms' ms.summary ms.done mp.open msname='data.vla/G0336_0317.ms' pl.clf mp.setspectral mp.plotoptions plotsymbol='o', subplot=231 mp.array mp.plotoptions plotsymbol='o', subplot=232 mp.baseline mp.plotoptions subplot=233 mp.vistime mp.plotoptions subplot=234 mp.azimuth mp.plotoptions subplot=235 mp.vischannel mp.plotoptions subplot=236 mp.hourangle() pl.clf mp.setspectral mp.plotoptions subplot=231 mp.elevation mp.plotoptions subplot=232 mp.parallacticangle mp.plotoptions plotsymbol='o', subplot=233 mp.uvcoverage mp.plotoptions subplot=234 mp.uvdist pl.clf mp.setspectral mp.plotoptions mp.vischannel column='data', what='amp' # no problems, don't mark or flag anything # mp.markflags # mp.flagdata # mp.flagdata(diskwrite=true) mp.close ############ Calibrate ############ cb.open 'data.vla/G0336_0317.ms' cb.initcalset cb.reset cb.setsolve type='M', t=3, table='vla.g.m' cb.solve cb.reset cp.open('vla.g.m') pl.subplot(121) cp.plot plottype='AMP' pl.subplot(122) cp.plot plottype='phase' cp.close cb.setapply type='M', table='vla.g.m' cb.setsolve type='MF', t=30000, table='vla.g.mf' # wierd, putting in a *tab* bx 30000, and table= makes CASA think I want help but a space works. Here it looks exactly the same. cb.solve() cp.open('vla.g.mf') pl.subplot(121) cp.plot plottype='AMP' pl.subplot(122) cp.plot plottype='phase' cb.reset cb.setdata msselect='FIELD_ID==0' cb.setapply type='M', table='vla.g.m' cb.setapply type='MF', table='vla.g.mf' cb.state cb.correct cb.close # Look at corrected data: mp.open msname='data.vla/G0336_0317.ms' pl.clf mp.setspectral nchan=1, start=5, width=50 mp.plotoptions subplot=121 mp.uvdist column='data', what='amp' pl.xlim(xmin=25, xmax=45) pl.ylim(ymin=0.05, ymax=1.25) mp.plotoptions subplot=122 mp.uvdist column='corrected', what='amp' pl.xlim(xmin=25, xmax=45) pl.ylim(ymin=0.05, ymax=1.25) # humm, corrected data amplitudes have a wider spread... # and corrected amps are not clustered at 1 - they are more like 1.05 or 1.1. Calibration doesn't look great. # flag last channels that are not well calibrated: pl.clf mp.setspectral nchan=61, start=1, width=1 mp.vischannel column='corrected', what='amp' mp.markflags mp.flagdata(diskwrite=true) # flag only channels 61 and 62 - rest looks OK. pl.clf mp.setspectral nchan=57, start=2, width=1 mp.plotoptions subplot=121 mp.vischannel column='data', what='amp' pl.ylim(ymin=0, ymax=10) mp.plotoptions subplot=122 mp.vischannel column='corrected', what='amp' pl.ylim(ymin=0, ymax=10) pl.clf mp.setspectral nchan=57, start=2, width=1 mp.plotoptions subplot=121 mp.vischannel column='data', what='phase' mp.plotoptions subplot=122 mp.vischannel column='corrected', what='phase' mp.close cb.open 'data.vla/G0336_0317.ms' cb.modelfit niter=5, compshape='P', par=[0.7,0,0], file='vla.g.cl' iter=0 chi2=5.82354e+07: I=0.7, dir=[0, 0] arcsec iter=1 chi2=5.69058e+07: I=1.12769, dir=[0.275031, 1.98348] arcsec iter=2 chi2=5.68159e+07: I=1.12872, dir=[0.170869, 1.22738] arcsec iter=3 chi2=5.6814e+07: I=1.12908, dir=[0.17372, 1.20845] arcsec iter=4 chi2=5.67842e+07: I=1.12908, dir=[0.214073, 0.917297] arcsec # agreed, calibration is more like 1.1 cb.close im.open 'data.vla/G0336_0317.ms' im.ft complist='vla.g.cl' im.close # Plot MODEL_DATA column over CORRECTED_DATA column mp.open msname='data.vla/G0336_0317.ms' mp.uvdist column='corrected' mp.plotoptions overplot=true, plotsymbol='bo' mp.uvdist column='model' # crappy calibration but the uvmodelfit is working well. ###################################################################33 end for today. ###################################################################33 ms.open 'data.vla/G0336_0317.ms',false ms.split outputms='test.ms', fieldids=0, spwids=0, nchan=3, start=2, step=15, whichcol='CORRECTED_DATA' ms.close cb.open 'data.vla/B0319_0317.ms' cb.modelfit niter=5, compshape='P', par=[1,0,0], file='vla.b.cl' cb.close im.open 'data.vla/B0319_0317.ms' im.ft complist='vla.b.cl' im.close # Plot MODEL_DATA column over CORRECTED_DATA column mp.open msname='data.vla/B0319_0317.ms' mp.uvdist column='corrected' mp.plotoptions overplot=true, plotsymbol='bo' mp.uvdist column='model' - looks good. =============================================== ======================================================================== ################## VLA FLUX CALIBRATOR ################## ms.open 'data.vla/F0542_0317.ms' ms.summary ms.done mp.open msname='data.vla/F0542_0317.ms' pl.clf mp.setspectral mp.plotoptions plotsymbol='o', subplot=231 mp.array mp.plotoptions plotsymbol='o', subplot=232 mp.baseline mp.plotoptions subplot=233 mp.vistime mp.plotoptions subplot=234 mp.azimuth mp.plotoptions subplot=235 mp.vischannel mp.plotoptions subplot=236 mp.hourangle() pl.clf mp.setspectral mp.plotoptions subplot=231 mp.elevation mp.plotoptions subplot=232 mp.parallacticangle mp.plotoptions plotsymbol='o', subplot=233 mp.uvcoverage mp.plotoptions subplot=234 mp.uvdist pl.clf mp.setspectral mp.plotoptions mp.vischannel column='data', what='amp' # no problems, don't mark or flag anything # mp.markflags # mp.flagdata # mp.flagdata(diskwrite=true) mp.close ############ Calibrate ############ cb.open 'data.vla/F0542_0317.ms' cb.initcalset cb.reset cb.setsolve type='M', t=3, table='vla.f.m' cb.solve # Found 61 good M Mueller solutions. # 1 solution intervals failed, or had insufficient data. cb.reset cp.open('vla.f.m') pl.subplot(121) cp.plot plottype='AMP' pl.subplot(122) cp.plot plottype='phase' # There is a performance issue - this always takes longer to plot the solution points than mp does to put up much more data. cp.close cb.setapply type='M', table='vla.f.m' cb.setsolve type='MF', t=30000, table='vla.f.mf' # Found 1 good MF Mueller solutions. # 0 solution intervals failed, or had insufficient data. cb.solve() cp.open('vla.f.mf') pl.subplot(121) cp.plot plottype='AMP' pl.subplot(122) cp.plot plottype='phase' cp.close cb.reset cb.setdata msselect='FIELD_ID==0' cb.setapply type='M', table='vla.f.m' cb.setapply type='MF', table='vla.f.mf' cb.state cb.correct cb.close # Look at corrected data: mp.open msname='data.vla/F0542_0317.ms' pl.clf mp.setspectral nchan=1, start=5, width=50 mp.plotoptions subplot=121 mp.uvdist column='data', what='amp' pl.xlim(xmin=44, xmax=44.3) pl.ylim(ymin=0.0, ymax=1.7) mp.plotoptions subplot=122 mp.uvdist column='corrected', what='amp' pl.xlim(xmin=44, xmax=44.3) pl.ylim(ymin=0.0, ymax=1.7) # humm, corrected data amplitudes have a wider spread... # corrected amps are clustered at 1 # flag last channels that are not well calibrated: pl.clf mp.setspectral nchan=62, start=0, width=1 mp.vischannel column='corrected', what='amp' mp.markflags mp.flagdata(diskwrite=true) # Channel 21 is abnormally high - one ant? a line? # flag channels 60 - 62 # I want to iterate through ants quickly but I can't figure out how to use interplot* tasks - documentation is not adequate. Implementation looks clunky (3 tasks). No examples provided in cookbook on how to iterate through antennas - what are labels, datastr, iteraxes? mp.iterplotstart datastr='ant', iteraxes=y # doesn't like y mp.iterplotstart datastr='ant', iteraxes='y' # it takes 'y' I think but bulks on ant string... mp.iterplotstart datastr='ant', iteraxes=2 # StandardError: cannot convert to StringVec # doesn't like ant? ######### DACH. # try to isolate the offending antenna the hard way: mp.setspectral nchan=62, start=0, width=1 mp.setdata antennaNames=0 # TypeError: argument 1 must be string, not int # [ MsPlot::setData() ] setData selection resulted no data! mp.vischannel column='corrected', what='amp' # Thu Mar 23 22:39:18 2006 WARN : # msplot::[vischannel()] Data not set, the whole MS will be used! # terminate called after throwing an instance of 'std::bad_alloc' # what(): St9bad_alloc # ----------> mp.vischannel(column='corrected', what='amp') # Abort (core dumped) - So if setdata doesn't work then vischannel crashes # Restart casapy and see if I can reproduce this: mp.open msname='data.vla/F0542_0317.ms' mp.setspectral nchan=62, start=0, width=1 mp.setdata antennaNames=0 mp.vischannel column='corrected', what='amp' ######### BUG repeats: the flags didn't take again. # but, hey, I get all data plotted and this didn't crash CASAPY... ######### So the bug I was trying to reproduce didn't reproduce. # Brought Joe in while things were in error state. He verified that the flags were not taking and when he brought in a different dataset, it reset the state of mp and started working again. Also, before he reset the state of mp, the setdata was not working. So mp was clearly in a strange state. Bringing in a new dataset reinitialized it and all is working now... # Isolating the problem with channel 20: mp.open msname='data.vla/F0542_0317.ms' mp.setspectral nchan=62, start=0, width=1 mp.vischannel column='corrected', what='amp' mp.setdata mp.setdata correlations='RR' mp.setspectral(5,18,1) mp.vischannel column='corrected', what='amp' # channel 20 high mp.setdata mp.setdata correlations='LL' mp.setspectral(5,18,1) mp.vischannel column='corrected', what='amp' # channel 20 looks OK, it is RR that hosed a channel # Flag RR, channel 20: mp.setdata mp.setdata correlations='RR' mp.setspectral(5,18,1) mp.vischannel column='corrected', what='amp' mp.markflags mp.flagdata(diskwrite=true) mp.close # verify flags... mp.open msname='data.vla/F0542_0317.ms' mp.setspectral nchan=62, start=0, width=1 mp.vischannel column='corrected', what='amp' mp.setdata mp.setdata correlations='RR' mp.setspectral(5,18,1) mp.vischannel column='corrected', what='amp' # DACH - flags didn't take again... # Forget this stuff, move on and finish up with the dataset: mp.close cb.open 'data.vla/F0542_0317.ms' cb.modelfit niter=5, compshape='P', par=[0.7,0,0], file='vla.f.cl' iter=0 chi2=8.0826e+07: I=0.7, dir=[0, 0] arcsec iter=1 chi2=8.03169e+07: I=0.867422, dir=[-0.245347, 0.194401] arcsec iter=2 chi2=8.03073e+07: I=0.868531, dir=[-0.197717, 0.156868] arcsec iter=3 chi2=8.03072e+07: I=0.868589, dir=[-0.19802, 0.156722] arcsec iter=4 chi2=8.03072e+07: I=0.868589, dir=[-0.19802, 0.156722] arcsec # same problem of non-convergence cb.close im.open 'data.vla/F0542_0317.ms' im.ft complist='vla.f.cl' im.close # Plot MODEL_DATA column over CORRECTED_DATA column mp.open msname='data.vla/F0542_0317.ms' mp.plotoptions mp.setspectral nchan=62, start=0, width=1 mp.vischannel column='corrected', what='amp' # end channels are flagged, channel 20 remains mp.setspectral nchan=1, start=1, width=59 mp.uvdist column='corrected' mp.plotoptions overplot=true, plotsymbol='bo' mp.uvdist column='model' # uvfit is offset again. Known bug. mp.close =============================================== ======================================================================== ################## BIMA GAIN CALIBRATOR ################## ######## continuum, one channel... ms.open 'data.bima/G1310_0506.ms' ms.summary ms.done mp.open msname='data.bima/G1310_0506.ms' pl.clf mp.setspectral mp.plotoptions plotsymbol='o', subplot=231 mp.array mp.plotoptions plotsymbol='o', subplot=232 mp.baseline mp.plotoptions subplot=233 mp.vistime mp.plotoptions subplot=234 mp.azimuth mp.plotoptions subplot=235 mp.vischannel mp.plotoptions subplot=236 mp.hourangle() pl.clf mp.setspectral mp.plotoptions subplot=231 mp.elevation mp.plotoptions subplot=232 mp.parallacticangle mp.plotoptions plotsymbol='o', subplot=233 mp.uvcoverage mp.plotoptions subplot=234 mp.uvdist pl.clf mp.setspectral mp.plotoptions mp.vistime column='data', what='amp' # no problems, don't mark or flag anything # mp.markflags # mp.flagdata # mp.flagdata(diskwrite=true) mp.close ############ Calibrate ############ # 12 integrations, each one is several minutes. cb.open 'data.bima/G1310_0506.ms' cb.initcalset cb.reset cb.setsolve type='M', t=500, table='bima.g.m' cb.solve # Found 12 good M Mueller solutions. # 0 solution intervals failed, or had insufficient data. cb.reset cp.open('bima.g.m') pl.subplot(121) cp.plot plottype='AMP' pl.subplot(122) cp.plot plottype='phase' # There is a performance issue - this always takes longer to plot the solution points than mp does to put up much more data. cp.close cb.reset cb.setdata msselect='FIELD_ID==0' cb.setapply type='M', table='bima.g.m' cb.state cb.correct cb.close # Look at corrected data: mp.open msname='data.bima/G1310_0506.ms' pl.clf mp.setspectral nchan=1, start=5, width=50 mp.plotoptions subplot=121 mp.vistime column='data', what='amp' pl.xlim(xmin=0., xmax=14.) ## wow, that doesn't work, It looks like the time axis is not interpreted with pl.xlim properly. Lots of traceback text ############ Bug... we should be able to use pl.xlim for all plots. mp.vistime column='data', what='amp' mp.plotoptions subplot=122 mp.uvdist column='corrected', what='amp' # monster bad calibration at one uv distance - where is it? mp.vistime column='corrected', what='amp' # timestamp 10 is bad mp.markflags mp.flagdata(diskwrite=true) mp.close # verify flags... mp.open msname='data.bima/G1310_0506.ms' mp.vistime column='corrected', what='amp' # flags took. mp.close cb.open 'data.bima/G1310_0506.ms' cb.modelfit niter=5, compshape='P', par=[0.7,0,0], file='bima.g.cl' iter=0 chi2=3385.56: I=0.7, dir=[0, 0] arcsec iter=1 chi2=3385.56: I=0.7, dir=[5.17693e-08, 6.18903e-08] arcsec iter=2 chi2=3385.56: I=0.7, dir=[5.2287e-08, 6.25092e-08] arcsec iter=3 chi2=3385.56: I=0.7, dir=[5.28047e-08, 6.31281e-08] arcsec iter=4 chi2=3385.56: I=0.7, dir=[5.28565e-08, 6.319e-08] arcsec # same problem of non-convergence cb.close cb.open 'data.bima/G1310_0506.ms' cb.modelfit niter=5, compshape='P', par=[1,0,0], file='bima.g2.cl' iter=0 chi2=3073.7: I=1, dir=[0, 0] arcsec iter=1 chi2=3073.7: I=0.999889, dir=[0.000362313, 0.000433146] arcsec iter=2 chi2=3073.7: I=0.999777, dir=[0.000724674, 0.000866349] arcsec iter=3 chi2=3073.7: I=0.999666, dir=[0.00108708, 0.00129961] arcsec iter=4 chi2=3073.7: I=0.999666, dir=[0.00108708, 0.00129961] arcsec cb.close im.open 'data.bima/G1310_0506.ms' im.ft complist='bima.g2.cl' im.close # Plot MODEL_DATA column over CORRECTED_DATA column mp.open msname='data.bima/G1310_0506.ms' mp.plotoptions mp.uvdist column='corrected', what='amp' mp.plotoptions overplot=true, plotsymbol='bo' mp.uvdist column='model' # model is what ever I set in the input parm. But procedure worked. mp.close =============================================== ======================================================================== ################## BIMA 3C CALIBRATOR ################## ######## continuum, one channel... ms.open 'data.bima/3C273_0506.ms' ms.summary ms.done mp.open msname='data.bima/3C273_0506.ms' pl.clf mp.setspectral mp.plotoptions plotsymbol='o', subplot=231 mp.array mp.plotoptions plotsymbol='o', subplot=232 mp.baseline mp.plotoptions subplot=233 mp.vistime mp.plotoptions subplot=234 mp.azimuth mp.plotoptions subplot=235 mp.vischannel mp.plotoptions subplot=236 mp.hourangle() pl.clf mp.setspectral mp.plotoptions subplot=231 mp.elevation mp.plotoptions subplot=232 mp.parallacticangle mp.plotoptions plotsymbol='o', subplot=233 mp.uvcoverage mp.plotoptions subplot=234 mp.uvdist pl.clf mp.setspectral mp.plotoptions mp.vistime column='data', what='amp' # Some dropouts but let's see how it goes # mp.markflags # mp.flagdata # mp.flagdata(diskwrite=true) mp.close ############ Calibrate ############ # 23 integrations, each one is several seconds cb.open 'data.bima/3C273_0506.ms' cb.initcalset cb.reset cb.setsolve type='M', t=30, table='bima.3c.m' cb.solve # Found 9 good M Mueller solutions. # 14 solution intervals failed, or had insufficient data. cb.reset cp.open('bima.3c.m') pl.subplot(121) cp.plot plottype='AMP' pl.subplot(122) cp.plot plottype='phase' # crappy data. cp.close cb.reset cb.setdata msselect='FIELD_ID==0' cb.setapply type='M', table='bima.3c.m' cb.state cb.correct cb.close # Look at corrected data: mp.open msname='data.bima/3C273_0506.ms' pl.clf mp.setspectral nchan=1, start=5, width=50 mp.plotoptions subplot=121 mp.vistime column='data', what='amp' mp.plotoptions subplot=122 mp.uvdist column='corrected', what='amp' # crappy data but it is scaled OK. mp.close cb.open 'data.bima/3C273_0506.ms' cb.modelfit niter=5, compshape='P', par=[0.7,0,0], file='bima.g.cl' iter=0 chi2=4.86009: I=0.7, dir=[0, 0] arcsec iter=1 chi2=1.60552: I=0.9997, dir=[8.89982e-09, -2.26821e-07] arcsec iter=2 chi2=1.60552: I=0.9997, dir=[8.89977e-09, -2.26819e-07] arcsec iter=3 chi2=1.60552: I=0.9997, dir=[8.89971e-09, -2.26818e-07] arcsec iter=4 chi2=1.60552: I=0.9997, dir=[8.89966e-09, -2.26817e-07] arcsec # nice convergence this time... cb.close im.open 'data.bima/3C273_0506.ms' im.ft complist='bima.g.cl' im.close # Plot MODEL_DATA column over CORRECTED_DATA column mp.open msname='data.bima/3C273_0506.ms' mp.plotoptions mp.uvdist column='corrected', what='amp' mp.plotoptions overplot=true, plotsymbol='bo' mp.uvdist column='model' # OK mp.close ###################################################################33 end testing of provided datasets. ###################################################################33