Joe, OK, I got somewhere -- at first everything worked lousy, but the system trained me enough so that it basically works OK. (casapy didn't handle white space very well) Notes in the Report. -Mark Misc notes: OK, blank space in the scripts gets you into MAJOR TROUBLE when cutting and pasting. spaces preceeding a value command result in that command being invalid: CASA [260]: i = 2 CASA [261]: i = 2 ------------------------------------------------------------ File "", line 1 i = 2 ^ SyntaxError: invalid syntax ALSO, tabs in your provided example script get misinterpreted as "tell me more about this tool (ie, tb.) It seems that you can't have two tables open at the same time? Or images or MS? BIG MISTAKE if true. Hey, I got into a space where mp.close() (or mp.anything) results in: File "", line 1 mp.array() I solved for type='G' with cb ("crunchberry beast?"), and LOW AND BEHOLD it found some good solutions in spite of only having a single baseline! Overall feeling is that this is a more straightforward interface than the old AIPS++/glish, although I am sort of hamstrung in that I don't know how to do manipulative mathamatics in Python Potentially major problem: tb.open('3C273_0506.ms') dat = tb.getcol('DATA') t = tb.getcol('TIME') i = 3 t[i+1] - t[i] # === ok, this works now, but it often DID NOT work. ## and I can't figure out how to do vector operations on t, dat, which ## seem to be lists??? dt = t[1:64] - t [0:63] ## how do I get a vector of dt? Overall feeling is that this is a more straightforward interface than the old AIPS++/glish, although I am sort of hamstrung in that I don't know how to do manipulative mathamatics in Python On a number of occasions, casapy got into a bad state, and things that should have worked did not -- restarting casapy usually fixed things. ############################################################################### ## below, a script I was putting togther for the BIMA dataset ############################################################################### ms.open('3C273_0506.ms') ms.summary() # 1 channel, 65 rows, 14 minutes ms.open('G1310_0506.ms') ms.summary() # 1 channel?? 315 rows, 7 hours # mp.open('3C273_0506.ms') mp.plotoptions(plotsymbol='ro') mp.array() mp.uvcoverage() mp.open('G1310_0506.ms') mp.plotoptions(plotsymbol='ro') mp.array() mp.uvcoverage() mp.vistime() # amp == 15 mp.uvdist(what='phase') mp.vistime() # default = AMP AMP == 1.?? mp.open('3C273_0506.ms') mp.vistime() # amp == 15 mp.vistime(what='phase') # phase dip mp.markflags() # I don't see anything that I should flag ## ## ## Hey, I got into a space where mp.close() (or mp.anything) ## results in: File "", line 1 ## mp.array() ## ## OK, mp.elevation() works ## mp.elevation(what='phase') works ## ## how do we find out what the arguments are? ## >>>>> pdoc ## ## HOW DO I GET A PLOT OF THE MODEL DATA ## AH: mp.elevation(column='DATA', what='phase') # calibrate data cb.open('3C273_0506.ms') cb.initcalset(); cb.reset() cb.setsolve(type='M',t=60,table='3C273.M20') cb.state() cb.solve() ## ## 3s :=> 23 good solutions, 42 solutions with insufficient data ## 20s => 12 good, 21 failed ## 60s => 5 good 8 failed cb.reset() cb.setapply(type='M', table='3C273.M20') cb.state() cb.correct() cb.close() # Compare observed 'data' and 'corrected' data mp.open('3C273_0506.ms') mp.plotoptions(subplot=121) mp.uvdist() mp.plotoptions(subplot=121,overplot=true,plotsymbol='b+') mp.uvdist('corrected') mp.plotoptions(subplot=122) mp.uvdist('data') mp.plotoptions(subplot=122,overplot=true,plotsymbol='b+') mp.setdata() mp.uvdist('corrected') pl.ylim(0.,1.5) pl.savefig('3C273.M.corrected.60.png') ## Do it again for 10s cb.open('3C273_0506.ms') cb.initcalset(); cb.reset() cb.setsolve(type='M',t=10,table='3C273.M10') cb.state() cb.solve() cb.setapply(type='M',table='3C273.M10') cb.correct() # Compare observed 'data' and 'corrected' data mp.open('3C273_0506.ms') mp.plotoptions(subplot=121) mp.vistime() mp.plotoptions(subplot=121,overplot=true,plotsymbol='b+') mp.uvdist('corrected') mp.plotoptions(subplot=122) mp.uvdist('data', what='phase') mp.plotoptions(subplot=122,overplot=true,plotsymbol='b+') mp.setdata() mp.vistime('corrected', what='phase') pl.ylim(-1, 1) pl.savefig('3C273.M.corrected.10.png') ## mp.markflags() mp.flagdata(true) cb.open('3C273_0506.ms') cb.initcalset(); cb.reset() cb.setsolve(type='M',t=10,table='3C273.M10') cb.state() cb.solve() cb.setapply(type='M',table='3C273.M10') cb.correct() # Compare observed 'data' and 'corrected' data mp.open('3C273_0506.ms') mp.plotoptions(subplot=121) mp.vistime() mp.plotoptions(subplot=121,overplot=true,plotsymbol='b+') mp.uvdist('corrected') mp.plotoptions(subplot=122) mp.uvdist('data', what='phase') mp.plotoptions(subplot=122,overplot=true,plotsymbol='b+') mp.setdata() mp.vistime('corrected', what='phase') pl.ylim(-1, 1) pl.savefig('3C273.M.corrected.10.png') cb.open('3C273_0506.ms') cb.initcalset(); cb.reset() cb.setsolve(type='G',t=60,table='3C273.G') cb.state() cb.solve() ## ## THIS SHOULD HAVE FAILED, but! ## Found 4 good G Jones solutions. ## 1 solution intervals failed. ## 8 solution intervals had insufficient data. cb.summary() cb.setapply(type='M',table='3C273.M10') cb.correct() # Compare observed 'data' and 'corrected' data ## ## Overall feeling is that this is a more ## straightforward interface than the old AIPS++/glish, ## although I am sort of hamstrung in that I don't know how to ## do manipulative mathamatics in Python ## ## Now, why are these so many M solutions that fail? ## ## ## A lot of the system is not implemented yet! ## tb.browse(), tb.summary(), tb.open('3C273_0506.ms') dat = tb.getcol('DATA') t = tb.getcol('TIME') flags = tb.getcol('FLAG') wt = tb.getcol('IMAGING_WEIGHT') i = 0 dt = t ## t[20] - t[19] ==> this syntax doesn't work! ## #while i < (len(t)-1) : # dt[i] = t[(i+1)] - t[i] # ## ## t, dat are stored as LISTS, which do not embrace Mathematical Operations ??? ## ## im.open('3C273_0506.ms') im.advise() ## cell size: casac.Quantity --- how can I see this? oo = im.advise() qq = oo.get('cell') ## OK, we HAVE the quantity qq.units qq.value ## awkward, but OK im.sensitivity().get('pointsource').value im.sensitivity().get('pointsource').units