casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables
task_delmod.py
Go to the documentation of this file.
00001 import os
00002 from taskinit import *
00003 from parallel.parallel_task_helper import ParallelTaskHelper
00004 
00005 def delmod(vis=None,otf=None,field=None,scr=None):
00006 
00007         casalog.origin('delmod')
00008 
00009         # Do the trivial parallelization
00010         if ParallelTaskHelper.isParallelMS(vis):
00011                 helper = ParallelTaskHelper('delmod', locals())
00012                 helper.go()
00013                 return
00014 
00015 
00016         #Python script
00017         try:
00018 
00019                 # only if vis exists...
00020                 if ((type(vis)==str) & (os.path.exists(vis))):
00021                         # ... and we are asked to do something...
00022                         # open without adding anything!
00023                         cb.open(vis,addcorr=False,addmodel=False)
00024                         cb.delmod(otf,field,scr)
00025                         cb.close()
00026                 else:
00027                         raise Exception, 'Visibility data set not found - please verify the name'
00028 
00029                 #write history
00030                 ms.open(vis,nomodify=False)
00031                 ms.writehistory(message='taskname = delmod',origin='delmod')
00032                 ms.writehistory(message='vis         = "'+str(vis)+'"',origin='delmod')
00033                 ms.writehistory(message='otf         = "'+str(otf)+'"',origin='delmod')
00034                 ms.writehistory(message='scr         = "'+str(scr)+'"',origin='delmod')
00035                 ms.close()
00036 
00037         except Exception, instance:
00038                 print '*** Error ***',instance