Source
xxxxxxxxxx
result_bool = [(np.isclose(imlist[i].image_rms, value_compare[i], rtol=rtol, atol=atol, equal_nan=False), os.path.basename(imlist[i].image)) for i in [0,1]]
import os
import time
import datetime
import regression_utility as regutl
import sys, traceback
import numpy as np
import pipeline
pathname = os.environ.get('CASAPATH').split()[0]
rootdatapath = pathname+'/data/regression/pipeline/'
'''Initial VLA pipeline regression
B. Kent, May 2015
Update September 1, 2015
Update April 20, 2018
Update June 01, 2018
Update Feb 22, 2019 Added imaging statistics
'''
THISHOME = "working/"
startTime=0.0
endTime=0.0
startProc=0.0
endProc=0.0
regstate = True
# MIN_CASA_REVISION = 36095
def printmsg(logfile, msg):
print >>logfile, msg
print(msg)
return
def load_context(filename):
with open(filename, 'rb') as picklefile:
return pipeline.infrastructure.utils.pickle_load(picklefile)
#
EPS = 1e-5 # Logical "zero"
#
#--------------------------------------------------------------
#
def pipeline_regression():
global regstate
# global MIN_CASA_REVISION
#revision = int(casadef.subversion_revision)
#if MIN_CASA_REVISION > revision:
# msg = ('Minimum CASA revision for the pipeline is r%s, '
# 'got CASA %s (r%s).' % (MIN_CASA_REVISION,
# cu.version_info( ),
# casadef.subversion_revision))
# print msg
# regstate = False
# raise EnvironmentError(msg)
# ASDM = "/export/home/icarus_2/awells/CASA_stable/data/regression/foo/vla_pipeline_data/rawdata/13A-537.sb24066356.eb24324502.56514.05971091435"
ASDM = rootdatapath + "13A-537.sb24066356.eb24324502.56514.05971091435"
try:
import pipeline.recipes.hifv as hifv
except ImportError, e:
print(e)
# Check to see if the ASDM exists
if not os.path.exists(ASDM):
print("Unable to open ASDM ", ASDM)
regstate=False
raise IOError
else:
print("Using ", ASDM)
# Run the CASA VLA Pipeline standard recipe
try:
hifv.hifv([ASDM], importonly=False)
except Exception as e:
print(e)
regstage=False
def run():
'''Timing and running of main regression function
'''
global startTime, endTime, startProc, endProc, regstate;
startTime = time.time()
startProc = time.clock()
regstate = False