Source
print >>logfile, "Res. Max = ",dMax, " Res. Var = ",dVar, " Res. Min = ",dMin, " Res. Mean = ",dMean;
import os
import time
import regression_utility as regutl
REGNAME = "pointing";
#MS = "pointingSquintPointing.ms"
MS = "pointingtest.ms";
MODELIMAGE = "pointingmodel50m.im";
EPJTABLE = "epjones2.tab";
EPJCACHE = "pointing.cf";
PASTEP = 360.0; # No. PA based conv. func. computation (takes longer)
INTEG = '30.0s';# Test VB integration as well in the solver loop
THISHOME = "./pointing_regression_data/"; # Local directory for scratch use
#
TOTALTIME = '*+1:0:0'; # Select only first 1hr worth of data to solve (keep run time small)
EPS = 1E-4; # Logical "zero"
TEMPLATEEPJ='template2.epj'; # The template EP-Jones table to check the results against.
#TEMPLATEEPJ='template_twoaxis.epj';
REPOSNAME = os.environ.get('CASAPATH').split()[0]+"/data/regression/"+REGNAME+'/';
#REPOSNAME = 'DataRepos/';
REUSELOCALREPOS = False;
#
#--------------------------------------------------------------
#
MYMS = THISHOME + MS;
MYIMAGE = THISHOME + MODELIMAGE;
MYTEMPLATEEPJ = THISHOME + TEMPLATEEPJ;
def pointing_reg():
if (REUSELOCALREPOS):
os.system("rm -rf " + THISHOME+EPJTABLE);
else:
os.system("rm -rf "+THISHOME);
os.mkdir(THISHOME);
os.system("cp -r " + REPOSNAME+MS + " " + MYMS);
os.system("cp -r " + REPOSNAME+MODELIMAGE + " " + MYIMAGE);
os.system("cp -r " + REPOSNAME+TEMPLATEEPJ + " " + MYTEMPLATEEPJ);
cb.setvi(old=True) # force old VI2
cb.open(MYMS);
cb.selectvis(time=TOTALTIME);
cb.setsolve(type = "EP",
t = INTEG,
table = THISHOME+EPJTABLE,
preavg = -1,
phaseonly = False,
append = False,
cfcache = THISHOME + EPJCACHE,
painc = PASTEP);
cb.setmodel(modelimage=MYIMAGE);
cb.solve();
#
#--------------------------------------------------------------
#
try:
startTime = time.time();
startProc = time.clock();
regstate = False;
#
#--------------------------------------------------------------
# Run the solver (and generate the subjective truth)