pl.text(0.05,0.95,"min=%7.1e\nmax=%7.1e\nRMS=%7.1e\n%s" % (im_min,im_max,im_rms,imunit),transform = ax.transAxes,bbox=dict(facecolor='white', alpha=0.7),size="x-small",verticalalignment="top")
im,cb,ms,tb,me,ia,po,sm,cl,cs,rg,sl,dc,vp,msmd,fi,fn,imd,sdms=gentools(['im','cb','ms','tb','me','ia','po','sm','cl','cs','rg','sl','dc','vp','msmd','fi','fn','imd','sdms'])
def is_array_type(value):
array_type = [list, tuple, pl.ndarray]
if type(value) in array_type:
def get_taskstr(taskname, params):
Returns a task call string.
taskname : task name string
params : a dictionary of parameter (key) and value pairs.
get_taskstr('mytask', {'vis': 'foo.ms', 'factor': 2.0})
returns a string, 'mytask(vis='foo.ms', factor=2.0)'
for key, val in params.items():
out += (key + "=" + __get_str(val) + sep)
return ( out.rstrip(sep) + ")" )
if type(paramval) == str:
return ("'%s'" % paramval)
def __init__(self, maxval=100):
def generate(self,maxval):
n2 = int(log(float(maxval))/log(2.0) + 1) +1
n3 = int(log(float(maxval))/log(3.0) + 1) +1
n5 = int(log(float(maxval))/log(5.0) + 1) +1
itsnumbers=pl.zeros(n2*n3*n5)
composite=( 2.**i2 * 3.**i3 * 5.**i5 )
itsnumbers[n] = composite
while maxi<(n2*n3*n5) and itsnumbers[maxi]<=maxval: maxi=maxi+1
self.itsnumbers=pl.int64(itsnumbers[0:maxi])
if x>max(self.itsnumbers): self.generate(2*x)
n=self.itsnumbers.__len__()
while xi<n and self.itsnumbers[xi]<x: xi=xi+1
return self.itsnumbers[xi]
simutil contains methods to facilitate simulation.
To use these, create a simutil instance e.g.
CASA> from simutil import simutil