casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables
sdflagmanager.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_sdflagmanager
00013 def sdflagmanager(infile='', mode='list', versionname='', oldname='', comment='', merge='replace'):
00014 
00015         """ASAP SD task: enable list, save, restore, delete and rename flag version files
00016 
00017 
00018         These flag version files are copies of the flag column for a
00019         measurement set.  They can be restored to the data set to obtain
00020         a previous flag version.  It is wise to
00021         save a flagversion at the beginning or after serious editing.    
00022 
00023         Keyword arguments:
00024         infile -- Name of input SD dataset
00025                 default: ''. example: infile='ngc5921.asap'
00026         mode -- Flag version operation
00027                 default: 'list'; to list existing flagtables
00028                 'save' will save flag column from infile to a specified flag file
00029                 'restore' will place the specified flag file into infile
00030                 'delete' will delete specified flag file
00031                 'rename' will rename a specified flag file
00032 
00033             >>> mode expandable parameters             
00034                  versionname -- Flag version name
00035                          default: none; example: versionname='original_data'
00036                          No imbedded blanks in the versionname
00037                  comment -- Short description of a versionname, when mode is 'save' 
00038                             or 'rename'
00039                          default: ''; example: comment='Clip above 1.85'
00040                          comment = versionname
00041                  oldname -- When mode='rename', the flag file to rename
00042                  merge -- Merge operation
00043                          Options: 'or','and', but not recommended for now.
00044 
00045  
00046         """
00047 
00048 #
00049 #    The following is work around to avoid a bug with current python translation
00050 #
00051         mytmp = {}
00052 
00053         mytmp['infile'] = infile
00054         mytmp['mode'] = mode
00055         mytmp['versionname'] = versionname
00056         mytmp['oldname'] = oldname
00057         mytmp['comment'] = comment
00058         mytmp['merge'] = merge
00059         pathname='file:///'+os.environ.get('CASAPATH').split()[0]+'/share/xml/'
00060         trec = casac.utils().torecord(pathname+'sdflagmanager.xml')
00061 
00062         casalog.origin('sdflagmanager')
00063         if trec.has_key('sdflagmanager') and casac.utils().verify(mytmp, trec['sdflagmanager']) :
00064             result = task_sdflagmanager.sdflagmanager(infile, mode, versionname, oldname, comment, merge)
00065 
00066         else :
00067           result = False
00068         return result