Ejemplo n.º 1
0
 def executeControlledPlugins(self):
     """
     Execute all plugins under control: 
     """
     bAllFinished = False
     while not bAllFinished:
         #acquire all semaphores to be sure no plugins are under configuration !
         for sem in self.lstSem:
             with sem:
                 pass
         if self.queue.empty():
             self.synchronizePlugins()
             bAllFinished = self.queue.empty()
         else:
             while not self.queue.empty():
                 try:
                     plugin = self.queue.get()
                 except Exception:
                     self.WARNING(
                         "In EDPluginControlAlignStackv1_0, exception in self.queue.get()"
                     )
                     break
                 else:
                     #this is a hack to prevent thousands of threads to be launched at once.
                     with EDUtilsParallel.getSemaphoreNbThreads():
                         pass
                     plugin.execute()
             self.synchronizePlugins()
 def executeControlledPlugins(self):
     """
     Execute all plugins under control: 
     """
     bAllFinished = False
     while not bAllFinished:
         #acquire all semaphores to be sure no plugins are under configuration !
         for sem in self.lstSem:
             with sem:
                 pass
         if self.queue.empty():
             self.synchronizePlugins()
             bAllFinished = self.queue.empty()
         else:
             while not self.queue.empty():
                 try:
                     plugin = self.queue.get()
                 except Exception:
                     self.WARNING("In EDPluginControlAlignStackv1_0, exception in self.queue.get()")
                     break
                 else:
                     #this is a hack to prevent thousands of threads to be launched at once.
                     with EDUtilsParallel.getSemaphoreNbThreads():
                         pass
                     plugin.execute()
             self.synchronizePlugins()
Ejemplo n.º 3
0
 def integrate(self):
     if (self.integrator.getPyFAI() != self.integrator_config) or \
        (self.integrator.wavelength != self.experimentSetup.wavelength.value):
         self.screen("Resetting PyFAI integrator")
         self.integrator.setPyFAI(**self.integrator_config)
         self.integrator.wavelength = self.experimentSetup.wavelength.value
     with EDUtilsParallel.getSemaphoreNbThreads():
         img = fabio.open(self.normalizedImage)
         variance = img.next()
         q, I, std = self.integrator.saxs(data=img.data, nbPt=max(img.dim1, img.dim2),
                                    correctSolidAngle=True,
                                    variance=variance.data,
                                    dummy= -2, delta_dummy=1.1,
                                    method="splitBBox")
     return q, I, std
Ejemplo n.º 4
0
 def integrate(self):
     if (self.integrator.getPyFAI() != self.integrator_config) or \
        (self.integrator.wavelength != self.experimentSetup.wavelength.value):
         self.screen("Resetting PyFAI integrator")
         self.integrator.setPyFAI(**self.integrator_config)
         self.integrator.wavelength = self.experimentSetup.wavelength.value
     with EDUtilsParallel.getSemaphoreNbThreads():
         img = fabio.open(self.normalizedImage)
         variance = img.next()
         q, I, std = self.integrator.saxs(data=img.data, nbPt=max(img.dim1, img.dim2),
                                    correctSolidAngle=True,
                                    variance=variance.data,
                                    dummy= -2, delta_dummy=1.1,
                                    method="splitBBox")
     return q, I, std