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_listobs 00013 def listobs(vis='', selectdata=True, spw='', field='', antenna='', uvrange='', timerange='', correlation='', scan='', intent='', feed='', array='', observation='', verbose=True, listfile=''): 00014 00015 """List the summary of a data set in the logger or in a file 00016 00017 List the summary information of a data set in the logger or in a file, based on 00018 a data selection. Only rows can be selected and printed. No in-row selection is 00019 possible (channel or correlation). Refer to the task listvis to list visibilites. 00020 00021 Lists the following properties of a measurement set: 00022 scan list, field list, spectral window list with 00023 correlators, antenna locations, ms table information. 00024 00025 Keyword arguments: 00026 vis -- Name of input visibility file 00027 default: none. example: vis='ngc5921.ms' 00028 00029 selectdata -- Select a subset of data for flagging 00030 default: False 00031 options: True,False 00032 The summary listing will only apply to the specified selection. 00033 00034 antenna -- Select data based on baseline 00035 default: '' (all); example: antenna='5&6' baseline 5-6 00036 antenna='5&6;7&8' #baseline 5-6 and 7-8 00037 antenna='5' # all cross-correlation baselines between antenna 5 and all other available 00038 antennas 00039 antenna='5,6' # all baselines with antennas 5 and 6 00040 antenna='1&&1' # only the auto-correlation baselines for antenna 1 00041 antenna='1&&*' # cross and auto-correlation baselines between antenna 1 00042 and all other available antennas 00043 antenna='1~7&&&' # only the auto-correlation baselines for antennas in range 1~7 00044 spw -- Select data based on spectral window and channels 00045 default: '' (all); example: spw='1' 00046 spw='<2' #spectral windows less than 2 00047 spw='>1' #spectral windows greater than 1 00048 correlation -- Correlation types 00049 default: '' (all); 00050 example: correlation='RR LL' 00051 field -- Select data based on field id(s) or name(s) 00052 default: '' (all); example: field='1' 00053 field='0~2' # field ids inclusive from 0 to 2 00054 field='3C*' # all field names starting with 3C 00055 uvrange -- Select data within uvrange (default units meters) 00056 default: '' (all); example: 00057 uvrange='0~1000klambda'; uvrange from 0-1000 kilo-lamgda 00058 uvrange='>4klamda';uvranges greater than 4 kilo-lambda 00059 uvrange='0~1000km'; uvrange in kilometers 00060 timerange -- Select data based on time range: 00061 default = '' (all); example, 00062 timerange = 'YYYY/MM/DD/hh:mm:ss~YYYY/MM/DD/hh:mm:ss' 00063 Note: YYYY/MM/DD can be dropped as needed: 00064 timerange='09:14:0~09:54:0' # this time range 00065 timerange='09:44:00' # data within one integration of time 00066 timerange='>10:24:00' # data after this time 00067 timerange='09:44:00+00:13:00' #data 13 minutes after time 00068 scan -- Select data based on scan number 00069 default: '' (all); example: scan='>3' 00070 intent -- Select data based on observation intent 00071 default: '' (all); example: intent='*CAL*,*BAND*' 00072 feed -- Selection based on the feed - NOT IMPLEMENTED YET 00073 array -- Selection based on the antenna array 00074 observation -- Selection based on the observation ID 00075 default: '' (all); example: observation='1' or observation=1 00076 00077 00078 verbose -- level of detail 00079 verbose=True: (default); scan and antenna lists 00080 verbose=False: less information 00081 00082 listfile -- name of disk file to write output. 00083 default: None. Example: listfile='list.txt' 00084 00085 00086 The 'Int (s)' column is the average of the MS's INTERVAL column 00087 for each scan, so in a time-averaged MS 'Int' = 9.83s more likely 00088 means 5 10s integrations and 1 9s integration (timebin) than 6 00089 9.83s integrations. 00090 00091 """ 00092 00093 # 00094 # The following is work around to avoid a bug with current python translation 00095 # 00096 mytmp = {} 00097 00098 mytmp['vis'] = vis 00099 mytmp['selectdata'] = selectdata 00100 mytmp['spw'] = spw 00101 mytmp['field'] = field 00102 mytmp['antenna'] = antenna 00103 mytmp['uvrange'] = uvrange 00104 mytmp['timerange'] = timerange 00105 mytmp['correlation'] = correlation 00106 mytmp['scan'] = scan 00107 mytmp['intent'] = intent 00108 mytmp['feed'] = feed 00109 mytmp['array'] = array 00110 mytmp['observation'] = observation 00111 mytmp['verbose'] = verbose 00112 mytmp['listfile'] = listfile 00113 pathname='file:///'+os.environ.get('CASAPATH').split()[0]+'/share/xml/' 00114 trec = casac.utils().torecord(pathname+'listobs.xml') 00115 00116 casalog.origin('listobs') 00117 if trec.has_key('listobs') and casac.utils().verify(mytmp, trec['listobs']) : 00118 result = task_listobs.listobs(vis, selectdata, spw, field, antenna, uvrange, timerange, correlation, scan, intent, feed, array, observation, verbose, listfile) 00119 00120 else : 00121 result = False 00122 return result