def upgradeLeginonDB(self):
         if not self.leginon_dbupgrade.columnExists('SessionData', 'frame path'):
                 return
         sessions = leginondata.SessionData().query()
         for sessiondata in sessions:
                 if sessiondata['frame path']:
                         continue
                 imagepath = sessiondata['image path']
                 if not imagepath:
                         continue
                 framepath = ddinfo.getRawFrameSessionPathFromImagePath(imagepath)
                 self.leginon_dbupgrade.updateColumn('SessionData', 'frame path',"'"+framepath+"'",'`DEF_id`=%d' % sessiondata.dbid,True)
 def upgradeLeginonDB(self):
     if not self.leginon_dbupgrade.columnExists('SessionData',
                                                'frame path'):
         return
     sessions = leginondata.SessionData().query()
     for sessiondata in sessions:
         if sessiondata['frame path']:
             continue
         imagepath = sessiondata['image path']
         if not imagepath:
             continue
         framepath = ddinfo.getRawFrameSessionPathFromImagePath(imagepath)
         self.leginon_dbupgrade.updateColumn(
             'SessionData', 'frame path', "'" + framepath + "'",
             '`DEF_id`=%d' % sessiondata.dbid, True)
 def getRawFrameDirFromImage(self,imagedata):
         if self.getRawFrameType() == 'singles':
                 return super(GatanK2Processing,self).getRawFrameDirFromImage(imagedata)
         '''
         K2 raw frames are now saved as image stack for feeding into gpu program.
         RawFrameDir here is now actually the filename with mrc extension.
         '''
         # strip off DOS path in rawframe directory name 
         rawframename = imagedata['camera']['frames name'].split('\\')[-1]
         if not rawframename:
                 apDisplay.printWarning('No Raw Frame Saved for %s' % imagedata['filename'])
         # raw frames are saved in a subdirctory of image path
         imagepath = imagedata['session']['image path']
         rawframe_basepath = ddinfo.getRawFrameSessionPathFromImagePath(imagepath)
         # frame stackfile is image filename plus '.frames.mrc'
         rawframedir = os.path.join(rawframe_basepath,'%s.frames.mrc' % imagedata['filename'])
         if not self.waitForPathExist(rawframedir,30):
                 apDisplay.printError('Raw Frame Dir %s does not exist.' % rawframedir)
         return rawframedir
Ejemplo n.º 4
0
 def getRawFrameDirFromImage(self, imagedata):
     if self.getRawFrameType() == 'singles':
         return super(GatanK2Processing,
                      self).getRawFrameDirFromImage(imagedata)
     '''
             K2 raw frames are now saved as image stack for feeding into gpu program.
             RawFrameDir here is now actually the filename with mrc extension.
             '''
     # strip off DOS path in rawframe directory name
     rawframename = imagedata['camera']['frames name'].split('\\')[-1]
     if not rawframename:
         apDisplay.printWarning('No Raw Frame Saved for %s' %
                                imagedata['filename'])
     # raw frames are saved in a subdirctory of image path
     imagepath = imagedata['session']['image path']
     rawframe_basepath = ddinfo.getRawFrameSessionPathFromImagePath(
         imagepath)
     # frame stackfile is image filename plus '.frames.mrc'
     rawframedir = os.path.join(rawframe_basepath,
                                '%s.frames.mrc' % imagedata['filename'])
     if not self.waitForPathExist(rawframedir, 30):
         apDisplay.printError('Raw Frame Dir %s does not exist.' %
                              rawframedir)
     return rawframedir