def convertInputStep(self): """ Generated the input particles metadata expected by projection matching. And copy the generated file to be used as initial docfile for further iterations. """ from pyworkflow.em.packages.xmipp3 import writeSetOfParticles writeSetOfParticles(self.inputParticles.get(), self.selFileName, blockName=self.blockWithAllExpImages)
def applyCTF(self, setPartMd): writeSetOfParticles(self.partSet,setPartMd) md1 = xmipp.MetaData() md1.setColumnFormat(False) idctf = md1.addObject() _acquisition = self.partSet.getAcquisition() for part in self.partSet: baseFnCtf = self.proj.getTmpPath("kk")#self._getTmpPath("ctf_%d.param"%mic) md1.setValue(xmipp.MDL_CTF_SAMPLING_RATE, samplingRate, idctf) md1.setValue(xmipp.MDL_CTF_VOLTAGE, 200., idctf); ctf = part.getCTF() udefocus = ctf.getDefocusU() vdefocus = ctf.getDefocusV() angle = ctf.getDefocusAngle() md1.setValue(xmipp.MDL_CTF_DEFOCUSU, udefocus, idctf); md1.setValue(xmipp.MDL_CTF_DEFOCUSV, vdefocus, idctf); md1.setValue(xmipp.MDL_CTF_DEFOCUS_ANGLE, 180.0 * random.random(), idctf); md1.setValue(xmipp.MDL_CTF_CS, 2., idctf); md1.setValue(xmipp.MDL_CTF_Q0, 0.07, idctf); md1.setValue(xmipp.MDL_CTF_K, 1., idctf); md1.write(baseFnCtf) ##writeSetOfParticles(self.partSet, setPartMd) #apply ctf args = " -i %s"%setPartMd args += " -o %s"%self.proj.getTmpPath(setPartCtfName) args += " -f ctf %s"%baseFnCtf args += " --sampling %f"%samplingRate runXmippProgram("xmipp_transform_filter", args) args = " -i %s"%setPartMd args += " -o %s"%self.proj.getTmpPath(setPartCtfPosName) args += " -f ctfpos %s"%baseFnCtf args += " --sampling %f"%samplingRate runXmippProgram("xmipp_transform_filter", args)