Example #1
0
 def process_frames(self, data):
     result = np.empty_like(data[0])
     unwarp.run(data[0], result)
     return result[self.new_slice]
 def filter_frames(self, data):
     result = np.empty_like(data[0])
     unwarp.run(data[0], result)
     return result[self.slice_list]
Example #3
0
 def filter_frames(self, data):
     print data[0].shape
     result = np.empty_like(data[0])
     unwarp.run(data[0], result)
     return result[self.slice_list]
 def process_frames(self, data):
     result = np.empty_like(data[0])
     unwarp.run(data[0], result)
     return result[self.new_slice]
Example #5
0
   inim3=np.ascontiguousarray(inimt.astype(np.float32))
   print "shape: ",inim3.shape
   outim=np.empty_like(inim3)
   return(inim3,outim)
#end of get_image_array

(inarray,outarray)=get_image_array()

#set the coefficients -- this coudl be rolled into setup with additional args?
unwarp.setcoeff(1,-1e-3,-6e-7,5e-10,-4e-13)
unwarp.setctr(1000,1000)

#call setup routine 
unwarp.setup(inarray,outarray)

unwarp.run(inarray,outarray)
#multiple calls so long as centre and parameters are fixed 
#could be different data solong as it is same type/size/etc
unwarp.run(inarray,outarray)


unwarp.cleanup()

print("Writing the files to /dls/i12/data/2015/cm12163-5/tmp/unwarptest/cython_out")
try:
   os.makedirs("/dls/i12/data/2015/cm12163-5/tmp/unwarptest/cython_out")
   print ("Creating Folder")
except:
   print ("Folder already exists")