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_importvla 00013 def importvla(archivefiles=[''], vis='', bandname='', frequencytol='150000.0Hz', project='', starttime='', stoptime='', applytsys=True, autocorr=False, antnamescheme='new', keepblanks=False, evlabands=False): 00014 00015 """Import VLA archive file(s) to a measurement set 00016 00017 Imports an arbitrary number of VLA archive-format data sets into 00018 a casa measurement set. If more than one band is present, they 00019 will be put in the same measurement set but in a separate spectral 00020 window. The task will handle old style and new style VLA (after 00021 July 2007) archive data and apply the tsys to the data and to 00022 the weights. 00023 00024 Keyword arguments: 00025 archivefiles -- Name of input VLA archive file(s) 00026 default: none. Must be supplied 00027 example: archivefiles = 'AP314_A959519.xp1' 00028 example: archivefiles=['AP314_A950519.xp1','AP314_A950519.xp2'] 00029 vis -- Name of output visibility file 00030 default: none. Must be supplied. 00031 example: vis='NGC7538.ms' 00032 Will not over-write existing ms of same name. 00033 A backup flag-file version 'Original' will be made in 00034 vis.flagversions. See help flagmanager 00035 bandname -- VLA Frequency band 00036 default: => '' = all bands 00037 example: bandname='K' 00038 Options: '4'=48-96 MHz,'P'=298-345 MHz,'L'=1.15-1.75 GHz, 00039 'C'=4.2-5.1 GHz,'X'=6.8-9.6 GHz,'U'=13.5-16.3 GHz, 00040 'K'=20.8-25.8 GHz,'Q'=38-51 GHz 00041 frequencytol -- Tolerance in frequency shift in making spectral windows 00042 default: => 150000 (Hz). For Doppler shifted data, <10000 Hz may 00043 may produce too many unnecessary spectral windows. 00044 example: frequencytol = 1500000.0 (units = Hz) 00045 project -- Project name to import from archive files: 00046 default: '' => all projects in file 00047 example: project='AL519' 00048 project = 'al519' or AL519 will work. Do not include 00049 leading zeros; project = 'AL0519' will not work. 00050 starttime -- Time after which data will be considered for importing 00051 default: '' => all: Date must be included. 00052 syntax: starttime = '2003/1/31/05:05:23' 00053 stoptime -- Time before which data will be considered for importing 00054 default: '' => all: Date must be included. 00055 syntax: stoptime = '2003/1/31/08:05:23' 00056 applytsys -- Apply data scaling and weight scaling by nominal 00057 sensitivity (~Tsys) 00058 default: True. Strongly recommended 00059 autocorr -- import autocorrelations to ms 00060 default: => False (no autocorrelations) 00061 antnamescheme -- 'old' or 'new' antenna names. 00062 default => 'new' gives antnenna names 00063 'VA04' or 'EA13 for VLA telescopse 04 and 13 (EVLA) 00064 'old' gives names '04' or '13' 00065 keepblanks -- Should sources with blank names be filled into the data base 00066 default => false. Do not fill 00067 These scans are tipping scans (as of June 1, 2009) and should not 00068 be filled in the visibility data set. 00069 evlabands -- Use the EVLA's center frequency and bandwidths for frequencies 00070 specified via wavelength or band. 00071 default => True. 00072 async -- Run asynchronously 00073 default = False; do not run asychronously 00074 00075 """ 00076 if type(archivefiles)==str: archivefiles=[archivefiles] 00077 00078 # 00079 # The following is work around to avoid a bug with current python translation 00080 # 00081 mytmp = {} 00082 00083 mytmp['archivefiles'] = archivefiles 00084 mytmp['vis'] = vis 00085 mytmp['bandname'] = bandname 00086 if type(frequencytol) == str : 00087 mytmp['frequencytol'] = casac.quanta().quantity(frequencytol) 00088 else : 00089 mytmp['frequencytol'] = frequencytol 00090 mytmp['project'] = project 00091 mytmp['starttime'] = starttime 00092 mytmp['stoptime'] = stoptime 00093 mytmp['applytsys'] = applytsys 00094 mytmp['autocorr'] = autocorr 00095 mytmp['antnamescheme'] = antnamescheme 00096 mytmp['keepblanks'] = keepblanks 00097 mytmp['evlabands'] = evlabands 00098 pathname='file:///'+os.environ.get('CASAPATH').split()[0]+'/share/xml/' 00099 trec = casac.utils().torecord(pathname+'importvla.xml') 00100 00101 casalog.origin('importvla') 00102 if trec.has_key('importvla') and casac.utils().verify(mytmp, trec['importvla']) : 00103 result = task_importvla.importvla(archivefiles, vis, bandname, frequencytol, project, starttime, stoptime, applytsys, autocorr, antnamescheme, keepblanks, evlabands) 00104 00105 else : 00106 result = False 00107 return result