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_importgmrt 00013 def importgmrt(fitsfile='', flagfile='', vis=''): 00014 00015 """Convert a UVFITS file to a CASA visibility data set 00016 Convert a GMRT FITS file to a CASA visibility data set: 00017 00018 Keyword arguments: 00019 fitsfile -- Name of input UV FITS file 00020 default: none; example='3C273XC1.fits' 00021 flagfile -- List of files containing flagging information. 00022 default: none; example='3c273XC1.flag' 00023 example=['3c273Cc1_1.flag','3c273Cc2_1.flag','] 00024 vis -- Name of output visibility file (MS) 00025 default: none; example: vis='3C273XC1.ms' 00026 async -- Run asynchronously 00027 default = false; do not run asychronously 00028 00029 Note: Don't forget to flag autocorrections using 00030 taskname flagdata, autocorr = true 00031 00032 00033 """ 00034 00035 # 00036 # The following is work around to avoid a bug with current python translation 00037 # 00038 mytmp = {} 00039 00040 mytmp['fitsfile'] = fitsfile 00041 mytmp['flagfile'] = flagfile 00042 mytmp['vis'] = vis 00043 pathname='file:///'+os.environ.get('CASAPATH').split()[0]+'/share/xml/' 00044 trec = casac.utils().torecord(pathname+'importgmrt.xml') 00045 00046 casalog.origin('importgmrt') 00047 if trec.has_key('importgmrt') and casac.utils().verify(mytmp, trec['importgmrt']) : 00048 result = task_importgmrt.importgmrt(fitsfile, flagfile, vis) 00049 00050 else : 00051 result = False 00052 return result