casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables
listpartition.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_listpartition
00013 def listpartition(vis='', createdict=False, listfile=''):
00014 
00015         """List the summary of a multi-MS data set in the logger or in a file
00016 
00017        A multi-measurement set (MMS) is an MS that has been split into sub-MSs.
00018        An MMS contains a reference MS in the top directory and the sub-MSs are 
00019        located in a directory called SUBMSS inside the MMS directory.
00020        Example of a MS that was 'split' in two scans using the task partition: 
00021        
00022        > ls pScan.mms/
00023          SUBMSS/     table.dat   table.info
00024        
00025        > ls pScan.mms/SUBMSS/
00026          pScan.0000.ms/ pScan.0001.ms/
00027        
00028        
00029        The task lists the following properties of a multi-MS or MS:
00030        sub-MS name, scan, spw list, list of number of channels per spw, 
00031        number of rows for each scan and the size in disk. Example of logger output:
00032        
00033         Sub-MS         Scan  Spw               Nchan             Nrows   Size  
00034         pScan.0000.ms  31    [ 0  1  2  3  4]  [64 64 64 64 64]  8640    42M   
00035         pScan.0001.ms  30    [ 0  1  2  3  4]  [64 64 64 64 64]  8544    42M   
00036 
00037 
00038 
00039        Keyword arguments:
00040        vis -- Name of multi-MS or normal MS.
00041               default: ''. 
00042               example: vis='pScan.mms'
00043 
00044        createdict -- Create and return a dictionary containing scan summaries of each
00045                      sub-MS. 
00046               default: False
00047               
00048               If set to True, the returned dictionary will contain information from
00049               ms.getscansummary() and ms.getspectralwindowinfo(), with the addition of an 
00050               index as the top key and the sub-MS name.
00051               Example:
00052               
00053             {0: {'MS': 'pScan.0000.ms',
00054                  'scanId': {31: {'nchans': array([64, 64, 64, 64, 64]),
00055                                  'nrows': 8640,
00056                                  'spwIds': array([ 0,  1,  2,  3,  4])}},
00057                  'size': '42M'},
00058              1: {'MS': 'pScan.0001.ms',
00059                  'scanId': {30: {'nchans': array([64, 64, 64, 64, 64]),
00060                                  'nrows': 8544,
00061                                  'spwIds': array([ 0,  1,  2,  3,  4])}},
00062                  'size': '42M'}}
00063 
00064                     
00065        listfile -- Name of ASCII file to save output to. If empty, it will 
00066                    list on the logger/terminal.
00067               default: ''
00068               example: listfile='pscan.txt'
00069 
00070  
00071         """
00072 
00073 #
00074 #    The following is work around to avoid a bug with current python translation
00075 #
00076         mytmp = {}
00077 
00078         mytmp['vis'] = vis
00079         mytmp['createdict'] = createdict
00080         mytmp['listfile'] = listfile
00081         pathname='file:///'+os.environ.get('CASAPATH').split()[0]+'/share/xml/'
00082         trec = casac.utils().torecord(pathname+'listpartition.xml')
00083 
00084         casalog.origin('listpartition')
00085         if trec.has_key('listpartition') and casac.utils().verify(mytmp, trec['listpartition']) :
00086             result = task_listpartition.listpartition(vis, createdict, listfile)
00087 
00088         else :
00089           result = False
00090         return result