Closedown

This commit is contained in:
gac-x04sa
2018-10-31 08:58:27 +01:00
parent a6f9b964ab
commit 8ebd52ea34
2 changed files with 10 additions and 1 deletions

View File

@@ -7,4 +7,7 @@ detectors = [mythen, mythen.acquire_time, pixel, pixel.image_filename, image.int
pixel.set_threshold(40, 500, 8000, 100000)
pixel.show()
pixel.assert_ready()
tscan (detectors, 10, 0.1, before_read=trigger_detectors, after_read=save_metadata)
tscan (detectors, 10, 0.1, before_read=trigger_detectors, after_read=save_metadata)

View File

@@ -59,6 +59,8 @@ class Image(DeviceBase, Readable):
self.intensity = ImageIntensity(self)
self.matrix = ImageMatrix(self)
self.corrected_intensity = ImageCorrectedIntensity(self)
self.last_filename = None
self.last_image = None
def get_int(self, threshold1= None, threshold2= None, threshold3= None, threshold4= None, filename = None):
@@ -87,8 +89,12 @@ class Image(DeviceBase, Readable):
def get_image(self, filename = None):
if filename is None:
filename = self.pixel.get_image_filename()
if filename == self.last_filename:
return self.last_image
ret = img_read(filename, self.pixel.IMAGE_HEADER_LENGTH, self.pixel.PIX_XDIM, self.pixel.PIX_YDIM,self.pixel.PIX_COLOR_DEPTH)
ret = Convert.reshape(ret, self.pixel.PIX_YDIM, self.pixel.PIX_XDIM)
self.last_filename = filename
self.last_image = ret
return ret
def read(self):