casa
$Rev:20696$
|
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_flagmanager 00013 def flagmanager(vis='', mode='list', versionname='', oldname='', comment='', merge='replace'): 00014 00015 """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. On running importvla, a flag 00021 version call 'Original' is automatically produced. It is wise to 00022 save a flagversion at the beginning or after serious editing. 00023 00024 Keyword arguments: 00025 vis -- Name of input visibility file 00026 default: none. example: vis='ngc5921.ms' 00027 mode -- Flag version operation 00028 default: 'list'; to list existing flagtables 00029 'save' will save flag column from vis to a specified flag file 00030 'restore' will place the specified flag file into vis 00031 'delete' will delete specified flag file 00032 'rename' will rename a specified flag file 00033 versionname -- Flag version name 00034 default: none; example: versionname='original_data' 00035 No imbedded blanks in the versionname 00036 comment -- Short description of a versionname, when mode is 'save' or 'rename' 00037 default: ''; example: comment='Clip above 1.85' 00038 comment = versionname 00039 oldname -- When mode='rename', the flag file to rename 00040 merge -- Merge operation 00041 Options: 'or','and', but not recommended for now. 00042 00043 00044 """ 00045 00046 # 00047 # The following is work around to avoid a bug with current python translation 00048 # 00049 mytmp = {} 00050 00051 mytmp['vis'] = vis 00052 mytmp['mode'] = mode 00053 mytmp['versionname'] = versionname 00054 mytmp['oldname'] = oldname 00055 mytmp['comment'] = comment 00056 mytmp['merge'] = merge 00057 pathname='file:///'+os.environ.get('CASAPATH').split()[0]+'/share/xml/' 00058 trec = casac.utils().torecord(pathname+'flagmanager.xml') 00059 00060 casalog.origin('flagmanager') 00061 if trec.has_key('flagmanager') and casac.utils().verify(mytmp, trec['flagmanager']) : 00062 result = task_flagmanager.flagmanager(vis, mode, versionname, oldname, comment, merge) 00063 00064 else : 00065 result = False 00066 return result