Closedown

This commit is contained in:
gac-x04sa
2018-10-30 16:12:45 +01:00
parent 532e93e8b9
commit 7228c88bfc
3 changed files with 2 additions and 22 deletions
-18
View File
@@ -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):
+1 -1
View File
@@ -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()
+1 -3
View File
@@ -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")