casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables
alma-m100-analysis.py
Go to the documentation of this file.
00001 # wrapper script for the ALMA M100 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 a complete ALMA SV data analysis (2 ASDMs from Sept 2011)"
00012 
00013 pass_on = { "asdm_dataset_name" : "uid___A002_X2a5c2f_X54",
00014             "asdm_dataset2_name" : "uid___A002_X2a5c2f_X220",
00015             "tsys_table" : 'cal-tsys_X54.fdm',
00016             "tsys_table2" : 'cal-tsys_X220.fdm',
00017             "mask1" : 'M100cont-orig.mask',
00018             "mask2" : 'M100line-orig.mask',
00019             "mask3" : 'test-M100line-orig.mask'
00020             }
00021 
00022 a=inspect.stack()
00023 stacklevel=0
00024 for k in range(len(a)):
00025     if (string.find(a[k][1], 'ipython console') > 0):
00026         stacklevel=k
00027         break
00028 gl=sys._getframe(stacklevel).f_globals
00029 
00030 def data():
00031     ### return the data files that are needed by the regression script
00032     return [pass_on["asdm_dataset_name"],
00033             pass_on["asdm_dataset2_name"],
00034             pass_on["tsys_table"],
00035             pass_on["tsys_table2"],
00036             pass_on["mask1"],
00037             pass_on["mask2"],
00038             pass_on["mask3"]
00039             ]
00040 
00041 def doCopy():
00042     ### return a list of the same length as that returned by data()
00043     ###   containing 0 if the corresponding file should be just linked
00044     ###   (i.e. is read-only)
00045     ###   or 1 if the corresponding file should be really copied to
00046     ###   the work directory
00047 
00048     return [0,0,1,1,1,1,1]
00049 
00050 def run( fetch=False ):
00051 
00052     #####fetch data
00053     if fetch:
00054         for f in data( ):
00055             copydata( f, os.getcwd( ) )
00056     
00057     #####locate the regression script
00058     try: 
00059         lepath=locatescript('alma-m100-analysis-regression.py')
00060         print 'Script used is ',lepath
00061         execfile(lepath, gl, pass_on)
00062     except:
00063         print 'execution failed: ', sys.exc_info()
00064         raise
00065 ###return the images that will be templated and compared in future runs
00066     return []