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_importuvfits 00013 def importuvfits(fitsfile='', vis='', antnamescheme='old'): 00014 00015 """Convert a UVFITS file to a CASA visibility data set 00016 Convert a UVFITS 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 vis -- Name of output visibility file (MS) 00022 default = none; example: vis='3C273XC1.ms' 00023 antnamescheme -- Naming scheme for VLA/JVLA/CARMA antennas 00024 default = old; 00025 old: Antenna name is a number, '04' 00026 This option exists for backwards compatibility 00027 but can lead to ambiguous results when antenna 00028 indices are used for data selection. 00029 new: Antenna name is not a number, e.g., 'VA04' or 'EA04' 00030 With this scheme, data selection via 00031 antenna names and indices is non-ambiguous. 00032 async -- Run asynchronously 00033 default = false; do not run asychronously 00034 00035 Note: Don't forget to flag autocorrections using 00036 taskname flagdata, autocorr = true 00037 00038 00039 """ 00040 00041 # 00042 # The following is work around to avoid a bug with current python translation 00043 # 00044 mytmp = {} 00045 00046 mytmp['fitsfile'] = fitsfile 00047 mytmp['vis'] = vis 00048 mytmp['antnamescheme'] = antnamescheme 00049 pathname='file:///'+os.environ.get('CASAPATH').split()[0]+'/share/xml/' 00050 trec = casac.utils().torecord(pathname+'importuvfits.xml') 00051 00052 casalog.origin('importuvfits') 00053 if trec.has_key('importuvfits') and casac.utils().verify(mytmp, trec['importuvfits']) : 00054 result = task_importuvfits.importuvfits(fitsfile, vis, antnamescheme) 00055 00056 else : 00057 result = False 00058 return result