casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables
cvel+clean_test.py
Go to the documentation of this file.
00001 # wrapper script for the cvel and clean 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 the cvel() and clean() tasks: spectral regridding and transformation"
00012 
00013 pass_on = { "dataset_name" : "ANTEN_sort_hann_for_cvel_reg-thinned.ms" }
00014 
00015 a=inspect.stack()
00016 stacklevel=0
00017 for k in range(len(a)):
00018     if (string.find(a[k][1], 'ipython console') > 0):
00019         stacklevel=k
00020         break
00021 gl=sys._getframe(stacklevel).f_globals
00022 
00023 
00024 def data():
00025     ### return the data files that are needed by the regression script
00026     return [pass_on["dataset_name"]]
00027 
00028 def doCopy():
00029     ### return a list of the same length as that returned by data()
00030     ###   containing 0 if the corresponding file should be just linked
00031     ###   (i.e. is read-only)
00032     ###   or 1 if the corresponding file should be really copied to
00033     ###   the work directory
00034 
00035     return [0]
00036 
00037 def run( fetch=False ):
00038 
00039     #####fetch data
00040     if fetch:
00041         for f in data( ):
00042             copydata( f, os.getcwd( ) )
00043     
00044     #####locate the regression script
00045     try: 
00046         lepath=locatescript('cvel+clean_regression.py')
00047         print 'Script used is ',lepath
00048         execfile(lepath, gl, pass_on)
00049     except:
00050         print 'execution failed: ', sys.exc_info()
00051         raise
00052 ###return the images that will be templated and compared in future runs
00053     return []