next up previous contents index
Next: A little more on Up: CARMA Continuum data Previous: CARMA Continuum data

CARMA test data and shell scripts

For this chapter there are 3 shell scripts available for study that with their comments go into more depth and show plotting example of a simple continuum observation. You will always be able to find these scripts, and their accompanying data, in ftp://ftp.astro.umd.edu/pub/carma/data

  1. simple0.csh: A very short 1 minute observation called ``fringetest'', used to show how the various calibration schemes can even dillute the signal of a strong quasar.

  2. simple1a.csh: a simple calibration pipeline, as we discussed before. The advantage of keeping all sources together in a single file is fewer files (and thus I/O, saving time) is needed and it is easier to check how well the calibration worked on any source in your track.


       1 #! /bin/csh -f
       2 #
       3 # extracted from c0319.1D_86GCRing.5.mir, originally observed at CARMA on 20 March 2009.
       4 # PI: Marc Pound and Farhad Yusef-Zadeh.
       5 #
       6 #
       7 # this script works mostly with one visibility file, and uses select= to work on selected data
       8 #
       9 # sources: 
      10 # --------
      11 # MWC349     flux (ignored here)
      12 # 3C345      passband
      13 # 1733-130   phase
      14 # GCRING     source
      15 
      16 
      17 # administration: getting the data
      18 
      19 set tar=../SgrA.mir.tar.gz
      20 tar -zxf $tar
      21 # set vis=$tar:t:r:r
      22 set vis=SgrA.mir
      23 
      24 # set an antpos file for baseline correction: two are available 090225 and 090331
      25 set antpos=$MIRCAT/baselines/carma/antpos.090331 
      26 
      27 # source names (we use the PURPOSE code from listobs: S, B, G)
      28 set sname=GCRING
      29 set bname=3C345
      30 set gname=1733-130
      31 
      32 # reference ants
      33 set bref=2
      34 set pref=2
      35 
      36 # work can start -------------------------------------------------------------------------
      37 
      38 # get a listing of what happened
      39 listobs vis=$vis log=listobs.log
      40 
      41 # select out only the useful astronomical data 
      42 rm -rf all.vis
      43 uvcat vis=$vis  select='-source(NOISE),-auto' out=all.vis
      44 
      45 # notice ant 1 has some issue
      46 # smauvplt vis=all.vis device=/xs axis=time,phase options=nocal,nopass
      47 uvflag vis=all.vis flagval=flag select="ant(1)"
      48 
      49 # baseline calibration
      50 rm -rf all_1.vis
      51 uvedit vis=all.vis    out=all_1.vis apfile=$antpos
      52 
      53 # linelength calibration
      54 rm -rf all_2.vis
      55 linecal vis=all_1.vis 
      56 #gpplt vis=all_1.vis yaxis=phase nxy=5,3 device=/xs options=wrap
      57 uvcat   vis=all_1.vis out=all_2.vis
      58 
      59 # smauvplt vis=all_2.vis device=/xs axis=time,phase options=nocal,nopass
      60 
      61 # bandpass calibration
      62 rm -rf all_3.vis 
      63 mfcal vis=all_2.vis refant=$bref select="source($bname)" interval=999
      64 #gpplt vis=all_2.vis yaxis=phase nxy=5,3 device=/xs options=bandpass
      65 #gpplt vis=all_2.vis yaxis=amp   nxy=5,3 device=/xs options=bandpass
      66 uvcat vis=all_2.vis out=all_3.vis options=nocal
      67 
      68 
      69 # gain calibration, looking quite nice now
      70 rm -rf all_4.vis 
      71 mselfcal vis=all_3.vis refant=$pref select="source($gname)" options=amp,apriori,noscale interval=5
      72 
      73 #gpplt vis=all_3.vis yaxis=phase nxy=5,3 device=/xs options=gains
      74 #gpplt vis=all_3.vis yaxis=amp   nxy=5,3 device=/xs options=gains
      75 
      76 puthd in=all_3.vis/interval value=0.1
      77 uvcat vis=all_3.vis out=all_4.vis 
      78 
      79 # should check flagged values in all_3 and all_4 and they should be the same
      80 # if the new interval is long enough to catch all inter- and extra-polations
      81 
      82 # map the calibrator
      83 
      84 rm -rf beam0 map0  model0 clean0
      85 invert vis=all_4.vis map=map0 beam=beam0 imsize=128 line=wide,1,1,2,2 select="source($gname)"
      86 clean map=map0 beam=beam0 out=model0
      87 restor map=map0 beam=beam0 model=model0 out=clean0
      88 
      89 # map the source
      90 
      91 rm -rf beam1 map1 model1 clean1
      92 invert vis=all_4.vis map=map1 beam=beam1 line=wide,1,1,2,2 "select=source($sname)" options=mosaic,double,systemp imsize=129
      93 mossdi map=map1 beam=beam1 out=model1
      94 restor map=map1 beam=beam1 model=model1 out=clean1
    

  3. simple1b.csh: breaking it up in different source files. This is the way the more complex calibration routines work. You will wind up with a lot more files this way.


       1 #! /bin/csh -f
       2 #
       3 # extracted from c0319.1D_86GCRing.5.mir, originally observed at CARMA on 20 March 2009.
       4 # PI: Marc Pound and Farhad Yusef-Zadeh.
       5 #
       6 #
       7 # this script works by copying over gain tables and applying them, not the simplest
       8 # of ways, but flexible in terms of the more complex calibration schemes that can occur.
       9 #
      10 # sources: 
      11 # --------
      12 # MWC349     flux (ignored here)
      13 # 3C345      passband
      14 # 1733-130   phase
      15 # GCRING     source
      16 
      17 
      18 # administration: getting the data
      19 
      20 set tar=../SgrA.mir.tar.gz
      21 tar -zxf $tar
      22 # set vis=$tar:t:r:r
      23 set vis=SgrA.mir
      24 
      25 # set an antpos file for baseline correction: two are available 090225 and 090331
      26 set antpos=$MIRCAT/baselines/carma/antpos.090331 
      27 
      28 # source names (we use the PURPOSE code from listobs: S, B, G)
      29 set sname=GCRING
      30 set bname=3C345
      31 set gname=1733-130
      32 
      33 # reference ants
      34 set bref=2
      35 set pref=2
      36 
      37 # work can start -------------------------------------------------------------------------
      38 
      39 # get a listing of what happened
      40 listobs vis=$vis log=listobs.log
      41 
      42 # select out only the useful astronomical data 
      43 rm -rf all.vis
      44 uvcat vis=$vis  select='-source(NOISE),-auto' out=all.vis
      45 
      46 # notice ant 1 has some issue
      47 # smauvplt vis=all.vis device=/xs axis=time,phase options=nocal,nopass
      48 uvflag vis=all.vis flagval=flag select="ant(1)"
      49 
      50 # baseline calibration
      51 rm -rf all_1.vis
      52 uvedit vis=all.vis    out=all_1.vis apfile=$antpos
      53 
      54 # linelength calibration
      55 rm -rf all_2.vis
      56 linecal vis=all_1.vis 
      57 #gpplt vis=all_1.vis yaxis=phase nxy=5,3 device=/xs options=wrap
      58 uvcat   vis=all_1.vis out=all_2.vis
      59 
      60 # now we split the full source (B,G,S) in pieces
      61 rm -rf b_1.vis g_1.vis s_1.vis
      62 uvcat vis=all_2.vis out=b_1.vis select="source($bname)"
      63 uvcat vis=all_2.vis out=g_1.vis select="source($gname)"
      64 uvcat vis=all_2.vis out=s_1.vis select="source($sname)"
      65 
      66 # bandpass calibration
      67 mfcal vis=b_1.vis refant=$bref interval=999
      68 #gpplt vis=b_1.vis yaxis=phase nxy=5,3 device=/xs options=bandpass
      69 #gpplt vis=b_1.vis yaxis=amp   nxy=5,3 device=/xs options=bandpass
      70 
      71 # and copy gains into G and S, and apply them
      72 rm -rf g_2.vis
      73 gpcopy vis=b_1.vis out=g_1.vis options=nocal,nopol
      74 uvcat  vis=g_1.vis out=g_2.vis
      75 
      76 rm -rf s_2.vis
      77 gpcopy vis=b_1.vis out=s_1.vis options=nocal,nopol
      78 uvcat  vis=s_1.vis out=s_2.vis
      79 
      80 
      81 # gain calibration, looking quite nice now
      82 mselfcal vis=g_2.vis refant=$pref options=amp,apriori,noscale interval=5
      83 
      84 #gpplt vis=g_2.vis yaxis=phase nxy=5,3 device=/xs options=gains
      85 #gpplt vis=g_2.vis yaxis=amp   nxy=5,3 device=/xs options=gains
      86 
      87 puthd in=g_2.vis/interval value=0.1
      88 
      89 rm -rf s_3.vis
      90 gpcopy vis=g_2.vis out=s_2.vis options=nopass,nopol
      91 uvcat  vis=s_2.vis out=s_3.vis
      92 
      93 # should check flagged values in s_2 and s_3 and they should be the same
      94 # if the new interval is long enough to catch all inter- and extra-polations
      95 
      96 # map the calibrator
      97 
      98 rm -rf beam0 map0  model0 clean0
      99 invert vis=g_2.vis map=map0 beam=beam0 imsize=128 line=wide,1,1,2,2 
     100 clean map=map0 beam=beam0 out=model0
     101 restor map=map0 beam=beam0 model=model0 out=clean0
     102 
     103 # map the source
     104 
     105 rm -rf beam1 map1 model1 clean1
     106 invert vis=s_3.vis map=map1 beam=beam1 line=wide,1,1,2,2 options=mosaic,double,systemp imsize=129
     107 mossdi map=map1 beam=beam1 out=model1
     108 restor map=map1 beam=beam1 model=model1 out=clean1
    

Figure 2.1: Flow diagram simple1a
\begin{figure}\begin{center}\epsfxsize =3cm\leavevmode\epsffile{simple1a.eps}
\end{center}
\end{figure}


next up previous contents index
Next: A little more on Up: CARMA Continuum data Previous: CARMA Continuum data
Peter
2009-10-05