def pointTransform(self,x,y, check=0): """ illuminates a single point while performing a mapping transform function exists primarily for testing """ MF = self.MF coord = self.ccd_to_dmd(x,y) # TODO: # multiplying by 4 because of confusing SUBPIXEL stuff fix in image # generator # do all floats in FUTURE PI.py_illuminate_enable() PI.py_clear_framebuffer() PI.py_illuminate_point(coord[0],coord[1], MF.mask_number1) PI.py_illuminate_expose() # turn on the frame buffer if check == 1: img_array = PC.snapPtr(0.35,180,"spare") # just clobber the illumination point a = numpy.array([coord[0]]) b = numpy.array([coord[1]]) max_val = PI.py_illuminate_spot_find(img_array, a,b) if max_val < 100: print("point not found") # end if else: print("found(%d,%d)" % (a[0],b[0])) # end else PC.cameraClose() # also frees up image buffer memory
def getCameraImage(self): """ Causes a camera snap event to happen and returns the pointer to a image copied from the frame buffer skips loading from a file. """ MF = self.MF return PC.snapPtr( MF.ImageExposure,\ MF.ImageGain, \ MF.ImageColor, \ MF.ImageFilename)
def snapImage(self): """ A wrapper function that allows MappingFunctions.py to snap and save an image MappingFunctions should be instantiated before this gets called by calling illumInit() """ # snap an image with settings from the config file MF = self.MF return PC.snapPtr( MF.ImageExposure,\ MF.ImageGain, \ MF.ImageColor)