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_uvsub 00013 def uvsub(vis='', reverse=False): 00014 00015 """Subtract/add model from/to the corrected visibility data. 00016 Help for uvsub task 00017 00018 This function subtracts model visibility data from corrected visibility 00019 data leaving the residuals in the corrected data column. If the 00020 parameter 'reverse' is set true, the process is reversed. 00021 Please note the model visibility used is the one that has been saved in the MODEL_DATA of the MS and the 00022 CORRECTED_DATA column is the one that is modified. If no CORRECTED_DATA column exists in the MS, one will be created and 00023 a copy of the DATA column is saved in it before the uvsub operation selected is performed. uvsub does not modify the DATA column. 00024 00025 Keyword arguments: 00026 vis -- Name of input visibility file (MS) 00027 default: none; example: vis='ngc5921.ms' 00028 reverse -- Reverse the operation (add rather than subtract) 00029 default: False; example: reverse=true 00030 00031 uvsub(vis='ngc5921.ms', reverse=False) 00032 00033 00034 """ 00035 00036 # 00037 # The following is work around to avoid a bug with current python translation 00038 # 00039 mytmp = {} 00040 00041 mytmp['vis'] = vis 00042 mytmp['reverse'] = reverse 00043 pathname='file:///'+os.environ.get('CASAPATH').split()[0]+'/share/xml/' 00044 trec = casac.utils().torecord(pathname+'uvsub.xml') 00045 00046 casalog.origin('uvsub') 00047 if trec.has_key('uvsub') and casac.utils().verify(mytmp, trec['uvsub']) : 00048 result = task_uvsub.uvsub(vis, reverse) 00049 00050 else : 00051 result = False 00052 return result