casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables
alma-ngc3256-analysis.py
Go to the documentation of this file.
00001 # wrapper script for the ALMA NGC3256 analysis regression test
00002 import sys
00003 import os
00004 import string
00005 from locatescript import copydata
00006 from locatescript import locatescript
00007 import inspect
00008 
00009 # Short description
00010 def description():
00011     return "Test of an ALMA SV data analysis (6 MSs from April 2011)"
00012 
00013 pass_on = { "tarfile_name" : "NGC3256_Band3_UnCalibratedMSandTablesForReduction.tgz"
00014             }
00015 
00016 a=inspect.stack()
00017 stacklevel=0
00018 for k in range(len(a)):
00019     if (string.find(a[k][1], 'ipython console') > 0):
00020         stacklevel=k
00021         break
00022 gl=sys._getframe(stacklevel).f_globals
00023 
00024 def data():
00025     ### return the data files that are needed by the regression script
00026     return [pass_on["tarfile_name"]
00027             ]
00028 
00029 def doCopy():
00030     ### return a list of the same length as that returned by data()
00031     ###   containing 0 if the corresponding file should be just linked
00032     ###   (i.e. is read-only)
00033     ###   or 1 if the corresponding file should be really copied to
00034     ###   the work directory
00035 
00036     return [0]
00037 
00038 def run( fetch=False ):
00039 
00040     #####fetch data
00041     if fetch:
00042         for f in data( ):
00043             copydata( f, os.getcwd( ) )
00044     
00045     #####locate the regression script
00046     try: 
00047         lepath=locatescript('alma-ngc3256-analysis-regression.py')
00048         print 'Script used is ',lepath
00049         execfile(lepath, gl, pass_on)
00050     except:
00051         print 'execution failed: ', sys.exc_info()
00052         raise
00053 ###return the images that will be templated and compared in future runs
00054     return []