diff --git a/script/device/Image.py b/script/device/Image.py index 8575fe0..de6709c 100644 --- a/script/device/Image.py +++ b/script/device/Image.py @@ -1,23 +1,5 @@ from shutil import copyfile -def img_get_int(fname, header, width, height, depth, x1,y1,x2,y2, bx1,by1,bx2,by2 ): - # read actual image file - import numpy - img = numpy.fromfile(fname, dtype=numpy.uint32) - img.shape = height, width - # signal roi - area_I = ( x2 - x1 + 1) * ( y2 - y1 + 1) - I_sum = img[y1:y2, x1:x2].sum() - thresh1_count = len(numpy.where(img>thres1)[0]) - thresh2_count = len(numpy.where(img>thres2)[0]) - thresh3_count = len(numpy.where(img>thres3)[0]) - thresh4_count = len(numpy.where(img>thres4)[0]) - - # background roi - I_sum_bgr = img[by1:by2, bx1:bx2].sum() - area_bgr= (bx2 - bx1 + 1) * (by2 - by1 + 1) - return (I_sum, area_I, thresh1_count, thresh2_count, thresh3_count, thresh4_count, I_sum_bgr, area_bgr) - class Image(DeviceBase, Readable): def __init__(self, name, pixel): diff --git a/script/device/Pixel.py b/script/device/Pixel.py index 69ca2e0..2b2a91e 100644 --- a/script/device/Pixel.py +++ b/script/device/Pixel.py @@ -222,7 +222,7 @@ class Pixel(DeviceBase, Readable, Readable.IntegerType): print " Image dimensions: %d x %d pixels (total = %d)" % (self.PIX_XDIM, self.PIX_YDIM, self.PIX_XDIM*self.PIX_YDIM) print " Threshold values: Thresh1 = %d, Thresh2 = %d, Thresh3 = %d, Thresh4 = %d" % (self.PIX_THRESH1,self.PIX_THRESH2,self.PIX_THRESH3,self.PIX_THRESH4) - print "\n\nThe current pixel detector status is:", pixel.get_status() + print "\n\nThe current pixel detector status is:", self.get_status() def doUpdate(self): self.get_status() diff --git a/script/local.py b/script/local.py index bd71bd3..405776a 100644 --- a/script/local.py +++ b/script/local.py @@ -28,12 +28,10 @@ def close_shutter(): shutter.write("Off") - +run("cpython/wrapper") run("device/Mythen") run("device/Pixel") run("device/Image") -run("cpython/wrapper") -