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_listvis 00013 def listvis(vis='', options='ap', datacolumn='data', field='', spw='*', selectdata=False, antenna='', timerange='', correlation='', scan='', feed='', array='', observation='', uvrange='', average='', showflags=False, pagerows=50, listfile=''): 00014 00015 """List measurement set visibilities. 00016 00017 This task lists measurement set visibility data under a number of 00018 input selection conditions. The measurement set data columns that 00019 can be listed are: the raw data, float_data, corrected data, model data, 00020 and residual (corrected - model) data. 00021 00022 The output table format is dynamic. Field, Spectral Window, and 00023 Channel columns are not displayed if the column contents are uniform. 00024 For example, if "spw = '1'" is specified, the spw column will not be 00025 displayed. When a column is not displayed, a message is sent to the 00026 logger and terminal indicating that the column values are uniform and 00027 listing the uniform value. 00028 00029 Table column descriptions: 00030 00031 COLUMN NAME DESCRIPTION 00032 ----------- ----------- 00033 Date/Time Time stamp of data sample (YYMMDD/HH:MM:SS UT) 00034 Intrf Interferometer baseline (antenna names) 00035 UVDist uv-distance (units of wavelength) 00036 Fld Field ID (if more than 1) 00037 SpW Spectral Window ID (if more than 1) 00038 Chn Channel number (if more than 1) 00039 (Correlated Correlated polarizations (eg: RR, LL, XY) 00040 polarization) Sub-columns are: Amp, Phs, Wt, F 00041 Amp Visibility amplitude 00042 Phs Visibility phase (deg) 00043 Wt Weight of visibility measurement 00044 F Flag: 'F' = flagged datum; ' ' = unflagged 00045 UVW UVW coordinates (meters) 00046 00047 00048 Input Parameters: 00049 vis Name of input visibility file 00050 default: none; example: vis='ngc5921.ms' 00051 00052 options List options: default = 'ap' 00053 Not yet implemented for suboptions 00054 00055 datacolumn Visibility file data column: 00056 default = 'data': options are 00057 data, float_data, corrected, model, residual (corrected-model) 00058 00059 field Select data based on field id(s) or name(s) 00060 default: ''==>all; example: field='1' 00061 field='0~2' field ids inclusive from 0 to 2 00062 field='3C*' all field names starting with 3C 00063 00064 spw Select spectral window, channel to list 00065 default: '0:0' --> spw=0, chan=0 00066 spw='2:34' spectral window 2, channel 34 00067 00068 selectdata Toggle the following 7 selection parameters. 00069 default: False; example: selectdata=True 00070 If false, the following parameters are reset 00071 to default values. 00072 00073 antenna Select calibration data based on antenna 00074 default: ''-->all; examples: 00075 antenna = '5,6'; antenna index 5 and 6 solutions 00076 antenna = '05,06'; antenna names '05' and '06 solutions 00077 00078 timerange Select time range to list 00079 default: ''-->all; examples: 00080 timerange='10:37:50.1'; list data for this sampling interval 00081 timerange='<10:37:25'; list data before 10:37:25 00082 00083 correlation Select polarization correlations to list 00084 default: ''-->all; examples: 00085 correlation='RR LL'; list RR and LL correlations 00086 correlation='XX XY'; list XX and XY correlations 00087 00088 scan Select scans to list 00089 default: ''-->all; examples: 00090 scan='2'; list scan 2 00091 scan='>2'; list scan numbers greater than 2 00092 00093 feed (not yet implemented) 00094 00095 array (not yet implemented) 00096 00097 observation Select by observation ID(s). 00098 default: ''-->all; 00099 example: observation='0' (select obsID 0) 00100 00101 uvrange Select baseline lengths to list. 00102 default: ''--> all; examples: 00103 uvrange='<5kl'; less than 5 kilo-wavelengths 00104 Caution: Input units default to meters. 00105 Listed units are always wavelengths. 00106 00107 average (not yet implemented) 00108 00109 showflags (not yet implemented) 00110 00111 pagerows rows per page of listing 00112 default: 50; 0 --> do not paginate 00113 00114 listfile write output to disk; will not overwrite 00115 default: '' --> write to screen 00116 listfile = 'solutions.txt' 00117 00118 async Run asynchronously 00119 default = False; do not run asychronously 00120 00121 00122 """ 00123 00124 # 00125 # The following is work around to avoid a bug with current python translation 00126 # 00127 mytmp = {} 00128 00129 mytmp['vis'] = vis 00130 mytmp['options'] = options 00131 mytmp['datacolumn'] = datacolumn 00132 mytmp['field'] = field 00133 mytmp['spw'] = spw 00134 mytmp['selectdata'] = selectdata 00135 mytmp['antenna'] = antenna 00136 mytmp['timerange'] = timerange 00137 mytmp['correlation'] = correlation 00138 mytmp['scan'] = scan 00139 mytmp['feed'] = feed 00140 mytmp['array'] = array 00141 mytmp['observation'] = observation 00142 mytmp['uvrange'] = uvrange 00143 mytmp['average'] = average 00144 mytmp['showflags'] = showflags 00145 mytmp['pagerows'] = pagerows 00146 mytmp['listfile'] = listfile 00147 pathname='file:///'+os.environ.get('CASAPATH').split()[0]+'/share/xml/' 00148 trec = casac.utils().torecord(pathname+'listvis.xml') 00149 00150 casalog.origin('listvis') 00151 if trec.has_key('listvis') and casac.utils().verify(mytmp, trec['listvis']) : 00152 result = task_listvis.listvis(vis, options, datacolumn, field, spw, selectdata, antenna, timerange, correlation, scan, feed, array, observation, uvrange, average, showflags, pagerows, listfile) 00153 00154 else : 00155 result = False 00156 return result