casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables
calstat.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_calstat
00013 def calstat(caltable='', axis='amplitude', datacolumn='gain', useflags=True):
00014 
00015         """Displays statistical information on a calibration table
00016         This task returns statistical information about a column in a calibration table.
00017 
00018         The following values are computed: mean value, sum of values, sum of squared values,
00019         median, median absolute deviation, quartile, minimum, maximum,
00020         variance, standard deviation, root mean square.
00021 
00022         Keyword arguments:
00023 
00024         caltable -- Name of input calibration table
00025                   default: '', example: vis='ggtau.1mm.amp.gcal'
00026 
00027         axis -- Which data to analyze. The possible values are 'amp', 'amplitude', 'phase',
00028                 'real', 'imag', 'imaginary'. Also, the name of any real valued MS column can be 
00029                 given, e.g. TIME, POLY_COEFF_AMP, REF_ANT, ANTENNA1, FLAG, ...
00030 
00031                 default: 'amplitude'
00032                 axis='gain'
00033 
00034                 The phase of a complex number is in radians in the range [-pi; pi[.
00035 
00036 
00037         datacolumn -- Which data column to use if axis is 'amp', 'amplitude',
00038                       'phase', 'real', 'imag' or 'imaginary'.
00039                 default: 'gain'
00040                 datacolumn='gain'
00041 
00042         useflags -- Take MS flags into account (not implemented, this parameter 
00043                     has no effect!)
00044                 default: False
00045                 useflag=False
00046                 useflag=True
00047         If useflags=False, flagged values are included in the statistics.
00048         If useflags=True, any flagged values are not used in the statistics.
00049 
00050         """
00051 
00052 #
00053 #    The following is work around to avoid a bug with current python translation
00054 #
00055         mytmp = {}
00056 
00057         mytmp['caltable'] = caltable
00058         mytmp['axis'] = axis
00059         mytmp['datacolumn'] = datacolumn
00060         mytmp['useflags'] = useflags
00061         pathname='file:///'+os.environ.get('CASAPATH').split()[0]+'/share/xml/'
00062         trec = casac.utils().torecord(pathname+'calstat.xml')
00063 
00064         casalog.origin('calstat')
00065         if trec.has_key('calstat') and casac.utils().verify(mytmp, trec['calstat']) :
00066             result = task_calstat.calstat(caltable, axis, datacolumn, useflags)
00067 
00068         else :
00069           result = False
00070         return result