casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables
listsdm.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_listsdm
00013 def listsdm(sdm=''):
00014 
00015         """Lists observation information present in an SDM directory.
00016 
00017         The listsdm task reads SDM XML tables, processes the
00018         observation information contained therein, and prints this
00019         information to the CASA log.  It will also return a dictionary
00020         keyed on scan number.  The dictionary contains the following
00021         information:
00022 
00023         'baseband'   list of baseband name(s)
00024         'chanwidth'  list of channel widths (Hz)
00025         'end'        observation end time (UTC)
00026         'field'      field ID
00027         'intent'     scan intent(s)
00028         'nchan'      list of number of channels
00029         'nsubs'      number of subscans
00030         'reffreq'    list of reference frequencies (Hz)
00031         'source'     source name
00032         'spws'       list of spectral windows
00033         'start'      observation start time (UTC)
00034         'timerange'  start time - end time range (UTC)
00035         
00036         Example:
00037 
00038         myscans = listsdm(sdm='AS1039_sb1382796_2_000.55368.51883247685')
00039 
00040         Prints information about the requested SDM to the CASA logger
00041         and returns a dictionary with scan information in 'myscans'.
00042 
00043         Keyword argument:
00044 
00045         sdm -- Name of input SDM directory.  
00046                example: sdm='AG836_sb1377811_1.55345.300883159725'
00047                 
00048   
00049         """
00050 
00051 #
00052 #    The following is work around to avoid a bug with current python translation
00053 #
00054         mytmp = {}
00055 
00056         mytmp['sdm'] = sdm
00057         pathname='file:///'+os.environ.get('CASAPATH').split()[0]+'/share/xml/'
00058         trec = casac.utils().torecord(pathname+'listsdm.xml')
00059 
00060         casalog.origin('listsdm')
00061         if trec.has_key('listsdm') and casac.utils().verify(mytmp, trec['listsdm']) :
00062             result = task_listsdm.listsdm(sdm)
00063 
00064         else :
00065           result = False
00066         return result