def publishPowerImage(self, imagedata, powimage): powdata = leginondata.AcquisitionFFTData(session=self.session, source=imagedata, image=powimage) # filename self.setImageFilename(powdata) # not raising publish event because there is not one yet self.publish(powdata, database=True) self.logger.info('Published power spectrum for image')
def processByLabel(self, label): ''' for each image in this session with the given label, calculate the FFT, until we find one that is already done ''' ## find images in this session with the given label iquery = leginondata.AcquisitionImageData(session=self.session, label=label) images = self.research(iquery, readimages=False) # start with first chronologically images.reverse() for im in images: if self.postprocess.isSet(): self.logger.info('stopping post processing') break ## find if there is already an FFT fquery = leginondata.AcquisitionFFTData(source=im) fft = self.research(fquery, readimages=False) if fft: continue self.publishPowerImage(im)