Python Links

Python, IPython, matplotlib links provided on the left.

Startup

bash-2.05b$ casapy
_______________________________________________
Available tools:

   cb (calibrater)       im (imager)
   ms (MS)               tb (table)
   mp (MS plot)          tp (table plot)

_______________________________________________
Available tasks:

  imager: clean, feather, invert, mosaic, (wproj)

_______________________________________________

type 'exp tool' or 'exp tool.function' for help


CASA [1]:
Some key interface differences between casa (python) and aips++ (glish) for those familiar with AIPS++.

  • No tool constructors (more data-centric).
  • No ':=' or ';' needed.
  • On-line help (exp)
  • CNTRL-C
  • Memory usage
    • casa 27M footprint (c.f. aips++ 103M starting)
    • pre-loading imager, calibrater, ms, and imager tasks (adds 1M to startup)
  • Startup time (casa: 1.9s (ballista), aips++: 10.1s (ballista))
  • Performance (approx. 15% faster on *tested* scripts)
  • Python is 0-based. Awkward but uniform. MS selection solves much of this.
  • Error handling (loquacious versus laconic)
    glish
    
    : Caught an exception! Event type=run exception=RecordInterface: field
             FLAG_LEVEL is unknown
             File:   servers.g, Line 1009
             Stack:    .(), ms.g line 419
             .()
    
    python
    
    Exception Reported: RecordInterface: field FLAG_LEVEL is unknown
    

For glish-users

  • Detailed functionality has been migrated over and is usable nearly identically as before.
    Python imaging
    im.open('ngc5921_src.split.ms')
    im.setdata(mode='channel',nchan=[46],start=[1],step=[1],fieldid=[0])
    im.setimage(nx=256,ny=256,cellx=quantity(15.,'arcsec'),celly=quantity(15.,'arcsec'),mode='channel',nchan=46,fieldid=0)
    im.weight(type='briggs',rmode='norm',robust=0.5)
    im.clean(algorithm='hogbom',niter=6000,gain=0.1,threshold=quantity(8.,'mJy'),model=['ngc5921_py.model'],image=['ngc5921_py.image'],residual=['ngc5921_py.residual'],mask=[''])
    
    Glish imaging
    im:=imager('ngc5921_src.split.ms')
    im.setdata(mode='channel',nchan=46,start=1,step=1,fieldid=1)                    
    im.setimage(nx=256,ny=256,cellx='15arcsec',celly='15arcsec',mode='channel',nchan=46,fieldid=1)
    im.weight(type='briggs',rmode='norm',robust=0.5)
    im.clean(algorithm='hogbom',niter=6000,gain=0.1,threshold='8mJy',model='gtest2.model',image='gtest2.image',residual='gtest2.residual',mask='')
    
  • Glish records -> Python dictionaries
    • dict.keys()
    • dict.sort()
    • dict.has_key('keyname')
    • dict.values()
    • dict['keyname']
    • del dict['keyname']
  • range specifications
    CASA [11]: range(4,7)
      Out[11]: [4, 5, 6]
    
    CASA [12]: range(1,3)
      Out[12]: [1, 2]
    
    CASA [13]: range(4,7)+range(55,60)
      Out[13]: [4, 5, 6, 55, 56, 57, 58, 59]
    
  • quantities (for now)
    CASA [4]: quan=quantity(5.,'km/s')
    
    CASA [5]: quan.value
      Out[5]: 5.0
    
    CASA [6]: quan.units
      Out[6]: 'km/s'
    
    
    Functionality Update:
    • Previously, parts of imager completed; calibrater stubbed
    • Now:
      imager      30 methods,  8 untested, 6 not implemented, 1 abort, 0 fail
      calibrater  16 methods,  1 untested, 3 not implemented, 0 abort, 1 fail
      ms          29 methods,  6 untested; 3 not implemented, 0 abort, 3 fail
      tables      stubbed
      tableplot   stubbed
      msplot      stubbed
      ---
      autoflag    started
      measures    started
      
    • help system enabled with argument information
      In [1]: exp im.setdata
          Set the data parameters selection for subsequent processing :
            mode      = velocity
            nchan     = [ 1 ]
            start     = [ 0 ]
            step      = [ 1 ]
            mstart    = { value=0.0, units=km/s }
            mstep     = { value=0.0, units=km/s }
            spwid     = [ 0 ]
            fieldid   = [ 0 ]
            msselect
            async     = false
          ----------------------------------------
      

    Example Reduction:

    • NGC 5921
    • All regression tests being ported

    Tasks:

    • Focus area for Focus Group!

    Why Matplotlib?

    • interface (zoom, cursor, etc)
    • many point rendering
    • publication quality (many formats bmp, eps, jpg, png, ps, svg)
    • use TeX labelling

    To Do:

    • complete functionality for initial release
    • improved logging
    • matplotlib
    • documentation
    • ----
    • interface working group in spring (March?)

    Please send any comments or questions about CASA or AIPS++ to aips2-requests@nrao.edu

    Copyright © 1995-2000,2001,2002,2003,2004 Associated Universities Inc., Washington, D.C.

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

    Modified on Wednesday, 02-Sep-2009 08:40:43 MDT