casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables
browsetable.py
Go to the documentation of this file.
00001 #
00002 # This file was generated using xslt from its XML file
00003 #
00004 # Copyright 2009, Associated Universities Inc., Washington DC
00005 #
00006 import sys
00007 import os
00008 from  casac import *
00009 import string
00010 from taskinit import casalog
00011 #from taskmanager import tm
00012 import task_browsetable
00013 def browsetable(tablename='', mightedit=False, sortlist='', taql='', skipcols=''):
00014 
00015         """Browse a table (MS, calibration table, image)
00016     This task brings up a browser that can open and display any CASA table.
00017     The tablename can be specified at startup, or any table can be loaded after
00018     the browser comes up.
00019             
00020     Parameters:
00021     tablename -- Name of table file on disk (vis, calibration table, image)
00022                  default: none; example: tablename='ngc5921.ms'
00023     mightedit -- If True disable the filtering options (below) and allow
00024                  editing the table.  Warning: the GUI appears to ignore
00025                  whether the table tool is opened read-only - just be
00026                  aware that you should not edit filtered tables unless
00027                  you know what you are doing.
00028     sortlist  -- List of columns to sort by.
00029                  default: [] (none)
00030     taql      -- TaQL query string for prefiltering the table.
00031                  default: "" (none); example: taql="ANTENNA2 < 6"
00032     skipcols  -- Columns to NOT display.
00033                  default: [] (none); example: skipcols='feed1, feed2'    
00034             
00035     
00036     Some comments on using browsetable (see cookbook also):
00037     
00038      Most often you will browse a measurement set.  Either specify the vis name
00039      as the tablename, or when the browser comes up,
00040     
00041             click on <file> (upper left), then click on <open table>
00042     
00043      If you want to look at sub-tables, use the tab table keywords along the
00044      left side to bring up a panel with the sub-tables listed (Fig 3.8), then
00045      choose (left-click) a table and View.
00046     
00047      Note that one useful feature is that you can Edit any table and its
00048      contents. Use the Edit tab (to the right of the file tab).  Be careful
00049      with this, and make a backup copy of the table before editing!
00050     
00051      Use the Close Tables and Exit option from the Files menu to quit the
00052      casabrowser.
00053     
00054      To get a plot of two table values, click on tools, then click on plot 2D.
00055      For example, to get a u-v plot, in the Plotter Option Gui,
00056           set Rows:  0   to  <Large Number>
00057           X Axis:  UVW      Slice  (set 0)
00058           Y Axis:  UVW      Slice  (set 1)
00059           click 'Clear and Plot' on right.
00060     
00061      For visibility plots
00062           X Axis:  TIME
00063           Y Axis:  DATA     Slice Amplitude
00064           click 'Clear and Plot' on right.
00065        
00066        
00067 
00068         """
00069 
00070 #
00071 #    The following is work around to avoid a bug with current python translation
00072 #
00073         mytmp = {}
00074 
00075         mytmp['tablename'] = tablename
00076         mytmp['mightedit'] = mightedit
00077         mytmp['sortlist'] = sortlist
00078         mytmp['taql'] = taql
00079         mytmp['skipcols'] = skipcols
00080         pathname='file:///'+os.environ.get('CASAPATH').split()[0]+'/share/xml/'
00081         trec = casac.utils().torecord(pathname+'browsetable.xml')
00082 
00083         casalog.origin('browsetable')
00084         if trec.has_key('browsetable') and casac.utils().verify(mytmp, trec['browsetable']) :
00085             result = task_browsetable.browsetable(tablename, mightedit, sortlist, taql, skipcols)
00086 
00087         else :
00088           result = False
00089         return result