Source
stopstr = "["+inspect.stack()[1][3]+"] Stopcode is " + str(ret['stopcode']) + " (" + self.verdict(ret['stopcode']==stopcode) + " : should be " + str(stopcode) + ")\n"
from __future__ import absolute_import
from __future__ import print_function
import os
import math
import shutil
import string
import time
import re
import numpy as np
import operator
from casatasks.private.casa_transition import is_CASA6
if is_CASA6:
from casatools import table, image, calibrater
_ia = image( )
_cb = calibrater( )
_tb = table( )
else:
from taskinit import *
table = tbtool
_ia = iatool()
_cb = cbtool()
_tb = tbtool()
'''
A set of helper functions for the tasks tclean
Summary...
'''
import time
import resource
class PerformanceMeasure():
def __init__(self):
self.t0=self.timestart()
self.t1=0.0
self.mem=0.0
def timestart(self):
self.t0 = time.time()
def gettime(self,label=""):
self.t1 = time.time()
return "'%s: time=%s'"%(label,self.t1-self.t0)
def getresource(self,label=""):
usage=resource.getrusage(resource.RUSAGE_SELF)
return '''%s: usertime=%s systime=%s mem=%s mb '''%(label,usage[0],usage[1], (usage[2]*resource.getpagesize())/1000000.0 )
##########################################
import os
import sys
import shutil
import numpy
import inspect
#from tasks import delmod
class TestHelpers():
def __init__(self):
self.epsilon = 0.05