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_conjugatevis 00013 def conjugatevis(vis='', spwlist="", outputvis='', overwrite=False): 00014 00015 """Change the sign of the phases in all visibility columns. 00016 Change the sign of the phases in all visibility columns 00017 00018 Keyword arguments: 00019 vis -- Name of input visibility file 00020 default: none; example='3C273XC1.ms' 00021 spwlist -- Select spectral window 00022 default: [] all spws will be conjugated; example: spw=[1,2] 00023 outputvis -- name of output visibility file 00024 default: 'conjugated_'+vis; example= 'conjugated.ms' 00025 overwrite -- Overwrite the outputvis if it exists 00026 default=False; example: overwrite=True 00027 00028 Example: 00029 00030 conjugatevis(vis='NGC253.ms', spwlist=[0,1], outputvis='NGC253-conj.ms') 00031 00032 Will conjugate all visibilities for spectral windows 0 and 1 and store the 00033 modified data in NGC253-conj.ms. 00034 00035 00036 """ 00037 00038 # 00039 # The following is work around to avoid a bug with current python translation 00040 # 00041 mytmp = {} 00042 00043 mytmp['vis'] = vis 00044 mytmp['spwlist'] = spwlist 00045 mytmp['outputvis'] = outputvis 00046 mytmp['overwrite'] = overwrite 00047 pathname='file:///'+os.environ.get('CASAPATH').split()[0]+'/share/xml/' 00048 trec = casac.utils().torecord(pathname+'conjugatevis.xml') 00049 00050 casalog.origin('conjugatevis') 00051 if trec.has_key('conjugatevis') and casac.utils().verify(mytmp, trec['conjugatevis']) : 00052 result = task_conjugatevis.conjugatevis(vis, spwlist, outputvis, overwrite) 00053 00054 else : 00055 result = False 00056 return result