casa
$Rev:20696$
|
00001 ######################################################################## 00002 # Task to print a summary of the content of an SDM dataset 00003 # 00004 # v1.0: 2012.02.13, M. Caillat 00005 # 00006 import os 00007 from taskinit import * 00008 00009 def asdmsummary(asdm=None): 00010 """Prints a description of the content of an SDM dataset to the CASA logger. 00011 00012 Keyword argument: 00013 00014 asdm -- Name of the input SDM directory. 00015 00016 """ 00017 00018 try: 00019 casalog.origin('asdmsummary') 00020 theexecutable = 'asdmSummary' 00021 execute_string = theexecutable + ' ' + '--logfile \"' +casalog.logfile() +'\"'+ ' ' + asdm 00022 # execute_string = theexecutable + ' ' + asdm 00023 casalog.post('Running ' + execute_string) 00024 exitcode = os.system(execute_string) >> 8 00025 if exitcode != 0 : 00026 casalog.post(theexecutable+' terminated with exit code '+str(exitcode), 'SEVERE') 00027 raise Exception, "Error while trying to produce a summary of '+" + asdm + "'." 00028 except Exception, instance: 00029 print '*** Error ***', instance 00030 00031 00032