casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables
task_smoothcal.py
Go to the documentation of this file.
00001 import os
00002 from taskinit import *
00003 
00004 def smoothcal(vis,tablein,caltable,field,smoothtype,smoothtime):
00005         """ Smooth calibration solution(s) derived from one or more sources:
00006 
00007         Keyword arguments:
00008         vis -- Name of input visibility file (MS)
00009                 default: none; example: vis='ngc5921.ms'
00010         tablein -- Input calibration table (any type)
00011                 default: none; example: tablein='ngc5921.gcal'
00012         caltable -- Output calibration table (smoothed)
00013                 default: none; example: caltable='ngc5921_smooth.gcal'
00014         field -- subset of sources to select
00015                 default: '' means all; example: field='0319_415_1 3C286'
00016         smoothtype -- The smoothing filter to be used
00017                 default: 'median'; example: smoothtype='mean'
00018                 Options: 'median','mean'
00019         smoothtime -- Smoothing filter time (sec)
00020                 default: 60.0; example: smoothtime=10.
00021         """
00022 
00023         #Python script
00024         try:
00025                 casalog.origin('smoothcal')
00026                 if ((type(vis)==str) & (os.path.exists(vis))):
00027                         cb.open(filename=vis,compress=False,addcorr=False,addmodel=False)
00028                                
00029                 else:
00030                         raise Exception, 'Visibility data set not found - please verify the name'
00031 
00032                 cb.smooth(tablein=tablein,tableout=caltable,field=field,smoothtype=smoothtype,smoothtime=smoothtime)
00033                 cb.close()
00034 
00035         except Exception, instance:
00036                 print '*** Error ***',instance
00037                 cb.close()
00038                 raise Exception, instance
00039 
00040