casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables
delmod.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_delmod
00013 def delmod(vis='', otf=True, field='', scr=False):
00014 
00015         """Deletes model representations in the MS
00016 
00017       This utility task is to be used to delete the model visibility
00018       data representations in the MS.  The 'otf' representation is
00019       the new (as of v3.4) 'scratch-less' model data, stored as
00020       keywords in the MS header containing model data formation
00021       instructions.  It is generated by the setjy, ft, and clean
00022       tasks (usescratch=F), and if present, overrides the 
00023       old-fashioned MODEL_DATA column (if present).  If a user
00024       wishes to use the MODEL_DATA column _after_ having operated
00025       with the 'otf' representation, this task can be used
00026       to delete the 'otf' represenatation to make the MODEL_DATA
00027       column visible.  (Create the MODEL_DATA column by using
00028       usescratch=T in setjy, ft, or clean; or by running the
00029       clearcal task with addmodel=T.)
00030 
00031       If otf=T, specific fields can be selected for deletion
00032       using standard field selection semantics.  If field='',
00033       all fields' models will be deleted.
00034 
00035       For convenience, this method also provides a means for
00036       deleting the MODEL_DATA column by setting scr=T.  Note
00037       that it is not possible to delete the MODEL_DATA column
00038       per field.
00039 
00040       If otf=F and scr=F, delmod will provide a listing
00041       of the header field records.
00042 
00043 
00044  
00045         """
00046 
00047 #
00048 #    The following is work around to avoid a bug with current python translation
00049 #
00050         mytmp = {}
00051 
00052         mytmp['vis'] = vis
00053         mytmp['otf'] = otf
00054         mytmp['field'] = field
00055         mytmp['scr'] = scr
00056         pathname='file:///'+os.environ.get('CASAPATH').split()[0]+'/share/xml/'
00057         trec = casac.utils().torecord(pathname+'delmod.xml')
00058 
00059         casalog.origin('delmod')
00060         if trec.has_key('delmod') and casac.utils().verify(mytmp, trec['delmod']) :
00061             result = task_delmod.delmod(vis, otf, field, scr)
00062 
00063         else :
00064           result = False
00065         return result