casa
$Rev:20696$
|
00001 import os 00002 from taskinit import * 00003 00004 00005 def listobs(vis=None, 00006 selectdata=None, 00007 spw=None, 00008 field=None, 00009 antenna=None, 00010 uvrange=None, 00011 timerange=None, 00012 correlation=None, 00013 scan=None, 00014 intent=None, 00015 feed=None, 00016 array=None, 00017 observation=None, 00018 verbose=None, 00019 listfile=None): 00020 00021 """List data set summary in the logger: 00022 00023 Lists following properties of a measurement set: 00024 scan list, field list, spectral window list with 00025 correlators, antenna locations, ms table information. 00026 00027 Keyword arguments: 00028 vis -- Name of input visibility file 00029 default: none. example: vis='ngc5921.ms' 00030 selectdata -- select data from the MS 00031 verbose -- level of detail 00032 verbose=True: (default); scan and antenna lists 00033 verbose=False: less information 00034 listfile -- save the output in a file 00035 default: none. Example: listfile="mylist.txt" 00036 00037 """ 00038 00039 casalog.origin('listobs') 00040 00041 # Python script 00042 # parameter_printvalues(arg_names,arg_values,arg_types) 00043 try: 00044 if (type(vis) == str) & os.path.exists(vis): 00045 ms.open(thems=vis) 00046 else: 00047 raise Exception, \ 00048 'Visibility data set not found - please verify the name' 00049 00050 sel = {} 00051 if (selectdata): 00052 sel['spw'] = spw 00053 sel['time'] = timerange 00054 sel['field'] = field 00055 sel['baseline'] = antenna 00056 sel['scan'] = scan 00057 sel['scanintent'] = intent 00058 sel['polarization'] = correlation 00059 sel['uvdist'] = uvrange 00060 sel['observation'] = str(observation) 00061 sel['array'] = array 00062 sel['feed'] = feed 00063 00064 # Select the data. Only-parse is set to false. 00065 ms.msselect(sel, False) 00066 00067 ms.summary(verbose=verbose, listfile=listfile) 00068 00069 ms.close() 00070 except Exception, instance: 00071 ms.close() 00072 print '*** Error ***', instance 00073 00074