casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables
testconcat.py
Go to the documentation of this file.
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_testconcat
00013 def testconcat(vis=[''], testconcatvis='', freqtol='', dirtol='', copypointing=True):
00014 
00015         """Concatenate the subtables of several visibility data sets, not the MAIN bulk data.
00016 
00017 The list of data sets given in the vis argument are concatenated into an output
00018 data set in testconcatvis without the bulk data of the MAIN table.  
00019 This is useful for obtaining the information in the merged subtables without
00020 actually performing a time-consuming concatenation of the MAIN tables on disk.
00021 
00022 
00023 Keyword arguments:
00024 vis -- Name of input visibility files for which the subtables are to be combined
00025         default: none; example: vis = 'mydata.ms',
00026              vis=['src2.ms','ngc5921.ms','ngc315.ms']
00027 testconcatvis -- Name of MS that will contain the concatenated subtables
00028         default: none; example: testconcatvis='test.ms'
00029 
00030 freqtol -- Frequency shift tolerance for considering data to be in the same
00031            spwid.  The number of channels must also be the same.
00032         default: ''  do not combine unless frequencies are equal
00033         example: freqtol='10MHz' will not combine spwid unless they are
00034            within 10 MHz.
00035         Note: This option is useful to conbine spectral windows with very slight
00036            frequency differences caused by Doppler tracking, for example.
00037 
00038 dirtol -- Direction shift tolerance for considering data as the same field
00039         default: '' means always combine.
00040         example: dirtol='1.arcsec' will not combine data for a field unless
00041            their phase center differ by less than 1 arcsec.  If the field names
00042            are different in the input data sets, the name in the output data
00043            set will be the first relevant data set in the list.
00044 
00045 copypointing -- Make a proper copy of the POINTING subtable (can be time consuming).
00046                 If False, the result is an empty POINTING table.
00047          default: True
00048 
00049 
00050         """
00051         if type(vis)==str: vis=[vis]
00052 
00053 #
00054 #    The following is work around to avoid a bug with current python translation
00055 #
00056         mytmp = {}
00057 
00058         mytmp['vis'] = vis
00059         mytmp['testconcatvis'] = testconcatvis
00060         mytmp['freqtol'] = freqtol
00061         mytmp['dirtol'] = dirtol
00062         mytmp['copypointing'] = copypointing
00063         pathname='file:///'+os.environ.get('CASAPATH').split()[0]+'/share/xml/'
00064         trec = casac.utils().torecord(pathname+'testconcat.xml')
00065 
00066         casalog.origin('testconcat')
00067         if trec.has_key('testconcat') and casac.utils().verify(mytmp, trec['testconcat']) :
00068             result = task_testconcat.testconcat(vis, testconcatvis, freqtol, dirtol, copypointing)
00069 
00070         else :
00071           result = False
00072         return result