def preProcess(self, _edObject=None): EDPluginExecProcessScript.preProcess(self) EDVerbose.DEBUG("EDPluginExecSaxsMacv1_0.preProcess") xsdIn = self.getDataInput() if xsdIn.getInputImage() is not None: self.inputImage = xsdIn.getInputImage().getPath().getValue() if not os.path.isfile(self.inputImage) and "%" not in self.inputImage: EDVerbose.WARNING("Input file %s does not exist ... try to go on anyway" % self.inputImage) self.inputImage = None if xsdIn.getOutputImage() is not None: self.outputImage = xsdIn.getOutputImage().getPath().getValue() if xsdIn.getFirstImage() is not None: self.firstImage = xsdIn.getFirstImage().getValue() if xsdIn.getLastImage() is not None: self.lastImage = xsdIn.getLastImage().getValue() if xsdIn.getOptions() is not None: self.options = xsdIn.getOptions().getValue() if xsdIn.getDummy() is not None: self.dummy = xsdIn.getDummy().getValue() if xsdIn.getIncrement() is not None: self.increment = xsdIn.getIncrement().getValue() if xsdIn.getAddConst() is not None: self.addConst = xsdIn.getAddConst().getValue() if xsdIn.getMultConst() is not None: self.multConst = xsdIn.getMultConst().getValue() #Create the command line to run the program self.generateSaxsMacCommand()
def preProcess(self): EDPluginExecProcessScript.preProcess(self) self.DEBUG('Truncate: preprocess') input_file = self.dataInput.input_file.value output_file = self.dataInput.output_file.value options = 'hklin {0} hklout {1}'.format(input_file, output_file) self.setScriptCommandline(options) self.DEBUG('command line options set to {0}'.format(options)) nres = self.dataInput.nres.value anom = self.dataInput.anom.value res = self.dataInput.res.value if res is None: res = 0 self.addListCommandExecution('nres {0}'.format(nres)) self.addListCommandExecution('truncate YES') self.addListCommandExecution('anomalous {0}'.format(anom)) self.addListCommandExecution('plot OFF') self.addListCommandExecution('labout F=F_xdsproc SIGF=SIGF_xdsproc') self.addListCommandExecution('falloff YES') self.addListCommandExecution('resolution 50 {0}'.format(res)) self.addListCommandExecution('PNAME foo') self.addListCommandExecution('DNAME foo') self.addListCommandExecution('end')
def preProcess(self, _edObject=None): EDPluginExecProcessScript.preProcess(self) EDVerbose.DEBUG("EDPluginExecDcrawv1_0.preProcess") self.__strRawFile = self.getDataInput().getRawImagePath().getPath().getValue() if self.getDataInput().getOutputPath() is not None: self.__strOutputFile = self.getDataInput().getOutputPath().getPath().getValue() if self.getDataInput().getExtractThumbnail() is not None: self.__bExtracThumbnail = (self.getDataInput().getExtractThumbnail().getValue() in [1, "true", "True", "TRUE", True]) ######################################################################## # This option is incompatible with all others ######################################################################## if self.__bExtracThumbnail is True: self.__bWBCamera = False self.__strOutputType = None #we cannot know what find of thumbnail is saved, can be jpeg, tiff or nothing ! else: if self.getDataInput().getExportTiff() is not None: self.__bExportTiff = (self.getDataInput().getExportTiff().getValue() in [1, "true", "True", "TRUE", True]) if self.__bExportTiff: self.__strOutputType = "tiff" if self.getDataInput().getWhiteBalanceAuto() is not None: self.__bWBAuto = (self.getDataInput().getWhiteBalanceAuto().getValue() in [1, "true", "True", "TRUE", True]) if self.__bWBAuto is True: self.__bWBCamera = False if self.getDataInput().getWhiteBalanceFromCamera() is not None: self.__bWBCamera = (self.getDataInput().getWhiteBalanceFromCamera().getValue() in [1, "true", "True", "TRUE", True]) if self.getDataInput().getLevelsFromCamera() is not None: self.__bLevelCamera = (self.getDataInput().getLevelsFromCamera().getValue() in [1, "true", "True", "TRUE", True]) if self.getDataInput().getInterpolationQuality() is not None: self.__iInterpolate = self.getDataInput().getInterpolationQuality().getValue() self.generateDcrawCommand()
def preProcess(self, _edObject=None): EDPluginExecProcessScript.preProcess(self) self.DEBUG("EDPluginBestv1_2.preProcess") self.setScriptLogFileName("best.log") self.setFileBestDat(os.path.join(self.getWorkingDirectory(), "bestfile.dat")) self.setFileBestPar(os.path.join(self.getWorkingDirectory(), "bestfile.par")) EDUtilsFile.writeFile(self.getFileBestDat(), self.getDataInput().getBestFileContentDat().getValue()) EDUtilsFile.writeFile(self.getFileBestPar(), self.getDataInput().getBestFileContentPar().getValue()) listBestFileContentHKL = self.getDataInput().getBestFileContentHKL() iterator = 0 for bestFileContentHKL in listBestFileContentHKL: iterator = iterator + 1 bestFileHKL = os.path.join(self.getWorkingDirectory(), "bestfile" + str(iterator) + ".hkl") self.listFileBestHKL.append(bestFileHKL) EDUtilsFile.writeFile(bestFileHKL, bestFileContentHKL.getValue()) if(self.getDataInput().getComplexity() is not None): self.setComplexity(self.getDataInput().getComplexity().getValue()) self.initializeCommands()
def preProcess(self, _edObject=None): EDPluginExecProcessScript.preProcess(self) self.DEBUG("EDPluginExecMtz2Variousv1_0.preProcess") xsDataInputRdfit = self.getDataInput() self.setScriptCommandline(self.generateCommands(xsDataInputRdfit)) self.addListCommandPostExecution("gle -device png -resolution 100 %s" % self.strScaleIntensityGleFile)
def preProcess(self): EDPluginExecProcessScript.preProcess(self) self.DEBUG('XdsToSca: preprocess') self.addInputLine('xdsfile {0}'.format(self.dataInput.hkl_file.path.value)) self.addInputLine('scafile {0}'.format(self.dataInput.sca_file.path.value)) self.addInputLine('end')
def preProcess(self, _edObject=None): EDPluginExecProcessScript.preProcess(self) self.DEBUG("EDPluginExecDammifv0_2.preProcess") if self.dataInput.order: self.name = "dammif-%s" % self.dataInput.order.value #I know I only modify the instance variable, not the class one self.generateDammifScript()
def preProcess(self, _edObject=None): """ """ EDPluginExecProcessScript.preProcess(self) self.setFileBestDat( os.path.join(self.getWorkingDirectory(), "bestfile.dat")) self.setFileBestPar( os.path.join(self.getWorkingDirectory(), "bestfile.par")) EDUtilsFile.writeFile( self.getFileBestDat(), self.getDataInput().getBestFileContentDat().getValue()) EDUtilsFile.writeFile( self.getFileBestPar(), self.getDataInput().getBestFileContentPar().getValue()) listBestFileContentHKL = self.getDataInput().getBestFileContentHKL() iterator = 0 for bestFileContentHKL in listBestFileContentHKL: iterator = iterator + 1 bestFileHKL = os.path.join(self.getWorkingDirectory(), "bestfile" + str(iterator) + ".hkl") self.listFileBestHKL.append(bestFileHKL) EDUtilsFile.writeFile(bestFileHKL, bestFileContentHKL.getValue()) if (self.getDataInput().getComplexity() is not None): self.setComplexity(self.getDataInput().getComplexity().getValue()) self.initializeCommands()
def preProcess(self, _edObject=None): EDPluginExecProcessScript.preProcess(self) self.DEBUG("EDPluginExecDataverv1_0.preProcess") self.lstInFiles = [i.path.value for i in self.dataInput.inputCurve] if self.dataInput.outputCurve is not None: self.strOutFile = self.dataInput.outputCurve.path.value self.generateCommandLine()
def preProcess(self, _edObject=None): EDPluginExecProcessScript.preProcess(self) self.DEBUG("EDPluginExecDatcmpv3_0.preProcess") self.listFiles = [i.path.value for i in self.getDataInput().inputCurve if os.path.isfile(i.path.value)] if len(self.listFiles) != 2: self.WARNING("You did not provide the right number of valid files !!! %s" % " ".join(self.listFiles)) self.generateDatcmpScript()
def preProcess(self, _edObject=None): EDPluginExecProcessScript.preProcess(self) self.DEBUG("EDPluginExecJesfv1_0.preProcess") numpyData = EDUtilsArray.xsDataToArray(self.dataInput.data) numpy.savetxt(os.path.join(self.getWorkingDirectory(), "spectra.dat"), numpyData) self.addListCommandExecution("spectra.dat")
def preProcess(self, _edObject=None): EDPluginExecProcessScript.preProcess(self) self.DEBUG("EDPluginExecDatcmpv1_0.preProcess") self.listFiles = [i.path.value for i in self.getDataInput().inputCurve if os.path.isfile(i.path.value)] if len(self.listFiles) != 2: self.WARNING("You did not provide the right number of valid files !!! %s" % " ".join(self.listFiles)) self.generateDatcmpScript()
def preProcess(self, _edObject=None): EDPluginExecProcessScript.preProcess(self) self.DEBUG("EDPluginExecMtz2Variousv1_0.preProcess") xsDataInputRdfit = self.getDataInput() self.setScriptCommandline(self.generateCommands(xsDataInputRdfit)) self.addListCommandPostExecution("gle -device png -resolution 100 %s" % self.strScaleIntensityGleFile) self.strScaleIntensityPlotPath = os.path.join(self.getWorkingDirectory(), self.strScaleIntensityPlot)
def preProcess(self, _edObject=None): """ Pre-Process: Generate the script """ EDPluginExecProcessScript.preProcess(self) self.DEBUG("EDPluginExecCommandLinev10.preProcess") self.generateScript()
def preProcess(self): EDPluginExecProcessScript.preProcess(self) self.DEBUG('Truncate: preprocess') input_file = self.dataInput.input_file.value output_file = self.dataInput.output_file.value options = 'hklin {0} hklout {1}'.format(input_file, output_file) self.setScriptCommandline(options) self.DEBUG('command line options set to {0}'.format(options)) nres = self.dataInput.nres.value anom = self.dataInput.anom.value res = self.dataInput.res.value if res is None: res = 0 self.addListCommandExecution('nres {0}'.format(nres)) self.addListCommandExecution('truncate YES') self.addListCommandExecution('anomalous {0}'.format(anom)) self.addListCommandExecution('plot OFF') self.addListCommandExecution('labout F=F_xdsproc SIGF=SIGF_xdsproc') self.addListCommandExecution('falloff YES') self.addListCommandExecution('resolution 50 {0}'.format(res)) self.addListCommandExecution('PNAME foo') self.addListCommandExecution('DNAME foo') self.addListCommandExecution('end')
def preProcess(self, _edObject=None): EDPluginExecProcessScript.preProcess(self) EDVerbose.DEBUG("EDPluginSPDCakev1_0.preProcess") # Check that the input data and correction images are present xsDataInputSPDCake = self.getDataInput() pathToInputFile = xsDataInputSPDCake.getInputFile().getPath().getValue() if (not os.path.exists(pathToInputFile)): strErrorMessage = EDMessage.ERROR_CANNOT_READ_FILE_02 % (self.getPluginName() + ".preProcess", pathToInputFile) EDVerbose.error(strErrorMessage) self.addErrorMessage(strErrorMessage) raise RuntimeError, strErrorMessage pathToDarkCurrentImageFile = xsDataInputSPDCake.getDarkCurrentImageFile().getPath().getValue() if (not os.path.exists(pathToDarkCurrentImageFile)): strErrorMessage = EDMessage.ERROR_CANNOT_READ_FILE_02 % (self.getPluginName() + ".preProcess", pathToDarkCurrentImageFile) EDVerbose.error(strErrorMessage) self.addErrorMessage(strErrorMessage) raise RuntimeError, strErrorMessage pathToFlatFieldImageFile = xsDataInputSPDCake.getFlatFieldImageFile().getPath().getValue() if (not os.path.exists(pathToFlatFieldImageFile)): strErrorMessage = EDMessage.ERROR_CANNOT_READ_FILE_02 % (self.getPluginName() + ".preProcess", pathToFlatFieldImageFile) EDVerbose.error(strErrorMessage) self.addErrorMessage(strErrorMessage) raise RuntimeError, strErrorMessage pathToSpatialDistortionFile = xsDataInputSPDCake.getSpatialDistortionFile().getPath().getValue() if (not os.path.exists(pathToSpatialDistortionFile)): strErrorMessage = EDMessage.ERROR_CANNOT_READ_FILE_02 % (self.getPluginName() + ".preProcess", pathToSpatialDistortionFile) EDVerbose.error(strErrorMessage) self.addErrorMessage(strErrorMessage) raise RuntimeError, strErrorMessage if xsDataInputSPDCake.getOutputDir() is not None: self.outputDir = xsDataInputSPDCake.getOutputDir().getPath().getValue() if not os.path.isdir(self.outputDir): os.makedirs(self.outputDir) self.generateSPDCommand()
def preProcess(self, _edObject=None): EDPluginExecProcessScript.preProcess(self) self.DEBUG("EDPluginExecDataverv1_0.preProcess") self.lstInFiles = [i.path.value for i in self.dataInput.inputCurve] if self.dataInput.outputCurve is not None: self.strOutFile = self.dataInput.outputCurve.path.value self.generateCommandLine()
def preProcess(self, _edObject=None): """ Sets up the phenix.xtriage command line, uncompress mtz file if necessary """ EDPluginExecProcessScript.preProcess(self, _edObject) self.DEBUG("EDPluginPhenixXtriagev1_1.preProcess...") # Check if we have a compressed mtz file... strPathMtz = self.dataInput.mtzFile.path.value if strPathMtz.endswith(".gz"): fIn = gzip.open(strPathMtz, "rb") fileContent = fIn.read() fIn.close() strMtzFileName = os.path.basename(strPathMtz).split(".gz")[0] self.strPathToLocalMtz = os.path.join(self.getWorkingDirectory(), strMtzFileName) fOut = open(self.strPathToLocalMtz, "wb") fOut.write(fileContent) fOut.close() strPathMtz = self.strPathToLocalMtz if self.dataInput.obsLabels is not None: strObsLabels = self.dataInput.obsLabels.value else: strObsLabels = "I,SIGI,merged" strCommandPhenixXtriage = "{0} obs={1}".format(strPathMtz, strObsLabels) # Necessary for Python 3 environment: self.addListCommandPreExecution("unset PYTHONPATH") self.setScriptCommandline(strCommandPhenixXtriage)
def preProcess(self, _edObject=None): self.setRequireCCP4(True) # GB: this sets dozor env from execProcessScriptSetupCCP4 config param EDPluginExecProcessScript.preProcess(self) self.DEBUG("EDPluginDozorv1_0.preProcess") xsDataInputDozor = self.getDataInput() # Retrieve config (if any) self.ix_min = self.config.get("ix_min") self.ix_max = self.config.get("ix_max") self.iy_min = self.config.get("iy_min") self.iy_max = self.config.get("iy_max") if self.ix_min is None or self.ix_max is None or self.iy_min is None or self.iy_max is None: # One configuration value is missing - use default values if xsDataInputDozor.detectorType.value == "pilatus2m": self.ix_min = self.ix_min_pilatus2m self.ix_max = self.ix_max_pilatus2m self.iy_min = self.iy_min_pilatus2m self.iy_max = self.iy_max_pilatus2m else: self.ix_min = self.ix_min_pilatus6m self.ix_max = self.ix_max_pilatus6m self.iy_min = self.iy_min_pilatus6m self.iy_max = self.iy_max_pilatus6m self.setScriptCommandline(" dozor.dat") strCommands = self.generateCommands(xsDataInputDozor) #self.createImageLinks(xsDataInputDozor) EDUtilsFile.writeFile(os.path.join(self.getWorkingDirectory(), "dozor.dat"), strCommands)
def preProcess(self, _edObject=None): EDPluginExecProcessScript.preProcess(self) self.DEBUG("EDPluginBestv1_3.preProcess") self.setScriptLogFileName("best.log") self.setFileBestDat( os.path.join(self.getWorkingDirectory(), "bestfile.dat")) self.setFileBestPar( os.path.join(self.getWorkingDirectory(), "bestfile.par")) EDUtilsFile.writeFile(self.getFileBestDat(), self.dataInput.bestFileContentDat.value) EDUtilsFile.writeFile(self.getFileBestPar(), self.dataInput.bestFileContentPar.value) listBestFileContentHKL = self.dataInput.getBestFileContentHKL() iterator = 0 for bestFileContentHKL in listBestFileContentHKL: iterator = iterator + 1 bestFileHKL = os.path.join(self.getWorkingDirectory(), "bestfile" + str(iterator) + ".hkl") self.listFileBestHKL.append(bestFileHKL) EDUtilsFile.writeFile(bestFileHKL, bestFileContentHKL.value) if self.dataInput.complexity is not None: self.setComplexity(self.dataInput.complexity.value) self.initializeCommands()
def preProcess(self, _edObject=None): """ Pre-Process: Generate the script """ EDPluginExecProcessScript.preProcess(self) self.DEBUG("EDPluginExecCommandLinev10.preProcess") self.generateScript()
def preProcess(self, _edObject=None): EDPluginExecProcessScript.preProcess(self) EDVerbose.DEBUG("EDPluginSTACv10.preProcess") xsPluginItem = self.getConfiguration() self.addListCommandPreExecution("export STACDIR=%s" % EDConfiguration.getStringParamValue(xsPluginItem, "STACDIR")) self.addListCommandPreExecution("export BCMDEF=%s" % EDConfiguration.getStringParamValue(xsPluginItem, "BCMDEF")) self.addListCommandPreExecution("export RUNDIR=%s" % self.getWorkingDirectory()) self.setScriptCommandline("stac.core.STAC_DNA_listener %s -%s/" % (self.getSTACcommand(), self.getWorkingDirectory()))
def preProcess(self, _edObject=None): EDPluginExecProcessScript.preProcess(self) self.DEBUG("EDPluginExecRsync.preProcess") self.strSource = self.dataInput.source.path.value self.strDestination = self.dataInput.destination.path.value if self.dataInput.options is not None: self.strOption = self.dataInput.options.value self.generateCommandLine()
def preProcess(self, _edObject=None): EDPluginExecProcessScript.preProcess(self) self.DEBUG("EDPluginExecDamaverv0_2.preProcess") self.checkDamaverPath() self.checkDamaverAutomaticInput() self.checkDamaverSymmetryInput() self.generateDamaverScript()
def preProcess(self, _edObject=None): EDPluginExecProcessScript.preProcess(self) self.DEBUG("EDPluginBackground3Dv1_0.preProcess") xsDataInputBackground3D = self.getDataInput() self.setScriptCommandline("background.dat") strCommands = self.generateCommands(xsDataInputBackground3D) self.createImageLinks(xsDataInputBackground3D) EDUtilsFile.writeFile(os.path.join(self.getWorkingDirectory(), "background.dat"), strCommands)
def preProcess(self): EDPluginExecProcessScript.preProcess(self) self.DEBUG('Uniqueify: preprocess') input_file = self.dataInput.input_file.value output_file = self.dataInput.output_file.value options = '{0} {1}'.format(input_file, output_file) self.setScriptCommandline(options) self.DEBUG('command line options set to {0}'.format(options))
def preProcess(self): EDPluginExecProcessScript.preProcess(self) data_input = self.getDataInput() self.high = data_input.high self.low = data_input.low self.addInputLine('RESOLUTION_SHELLS= %s %s' % (self.low, self.high))
def preProcess(self): EDPluginExecProcessScript.preProcess(self) self.DEBUG('Uniqueify: preprocess') input_file = self.dataInput.input_file.value output_file = self.dataInput.output_file.value options = '{0} {1}'.format(input_file, output_file) self.setScriptCommandline(options) self.DEBUG('command line options set to {0}'.format(options))
def preProcess(self, _edObject=None): EDPluginExecProcessScript.preProcess(self) self.DEBUG("EDPluginSTACv10.preProcess") xsPluginItem = self.getConfiguration() self.addListCommandPreExecution("export STACDIR=%s" % EDConfiguration.getStringParamValue(xsPluginItem, "STACDIR")) self.addListCommandPreExecution("export BCMDEF=%s" % EDConfiguration.getStringParamValue(xsPluginItem, "BCMDEF")) self.addListCommandPreExecution("export RUNDIR=%s" % self.getWorkingDirectory()) self.setScriptCommandline("stac.core.STAC_DNA_listener %s -%s/" % (self.getSTACcommand(), self.getWorkingDirectory()))
def preProcess(self, _edObject=None): EDPluginExecProcessScript.preProcess(self) self.DEBUG("EDPluginExecRsync.preProcess") self.strSource = self.dataInput.source.path.value self.strDestination = self.dataInput.destination.path.value if self.dataInput.options is not None: self.strOption = self.dataInput.options.value self.generateCommandLine()
def preProcess( self, _edObject = None ): EDPluginExecProcessScript.preProcess( self ) EDVerbose.DEBUG( "*** EDPluginExecDIMPLEMTZDUMPv10.preProcess") self.generateDIMPLEMTZDUMPCommands() if self.getDataInput().getOutputLogFile() != None: self.setScriptLogFileName(self.getDataInput().getOutputLogFile().getPath().getValue()) EDVerbose.DEBUG( "*** EDPluginExecDIMPLEPDBSETv10.preProcess - setting log file to: " \ + self.getScriptLogFileName())
def preProcess(self, _edObject=None): EDPluginExecProcessScript.preProcess(self) self.DEBUG("EDPluginExecDamaverv0_3.preProcess") self.checkDamaverPath() self.checkDamaverAutomaticInput() self.checkDamaverSymmetryInput() self.generateDamaverScript()
def preProcess(self, _edObject=None): EDPluginExecProcessScript.preProcess(self) self.DEBUG("EDPluginBackground3Dv1_0.preProcess") xsDataInputBackground3D = self.getDataInput() self.setScriptCommandline("background.dat") strCommands = self.generateCommands(xsDataInputBackground3D) self.createImageLinks(xsDataInputBackground3D) EDUtilsFile.writeFile(os.path.join(self.getWorkingDirectory(), "background.dat"), strCommands)
def preProcess(self, _edObject = None): EDPluginExecProcessScript.preProcess(self) self.DEBUG("EDPluginExecDimplev1_0.preProcess") xsDataInputDimple = self.getDataInput() strMtzFile = xsDataInputDimple.mtz.path.value strPdbFile = xsDataInputDimple.pdb.path.value self.strDimpleDir = os.path.join(self.getWorkingDirectory(), "dimple") self.setScriptCommandline(" " + strMtzFile + " " + strPdbFile + " " + self.strDimpleDir)
def preProcess(self, _edObject=None): EDPluginExecProcessScript.preProcess(self) self.DEBUG("EDPluginHTML2PDFv1_0.preProcess") xsDataInputHTML2PDF = self.getDataInput() if xsDataInputHTML2PDF.resultDirectory is None: resultDirectory = self.getWorkingDirectory() else: resultDirectory = xsDataInputHTML2PDF.resultDirectory.path.value self.setScriptCommandline(self.generateCommands(xsDataInputHTML2PDF, resultDirectory))
def preProcess(self): EDPluginExecProcessScript.preProcess(self) self.DEBUG('XdsToSca: preprocess') self.addInputLine('xdsfile {0}'.format( self.dataInput.hkl_file.path.value)) self.addInputLine('scafile {0}'.format( self.dataInput.sca_file.path.value)) self.addInputLine('end')
def preProcess(self, _edObject=None): EDPluginExecProcessScript.preProcess(self) self.DEBUG("EDPluginExecDammifv0_2.preProcess") if self.dataInput.order: self.name = "dammif-%s" % self.dataInput.order.value # I know I only modify the instance variable, not the class one self.generateDammifScript() # in order avoid 2 dammif starting at the same milisecond, we sleep for up to 64 ms time.sleep(1e-3 * (self.getId() % 64))
def preProcess(self, _edObject=None): EDPluginExecProcessScript.preProcess(self) self.DEBUG("EDPluginExecDatopv1_0.preProcess") self.outputFile = self.dataInput.outputCurve.path.value self.strOperation = self.dataInput.operation.value.replace("+", "ADD").replace("-", "SUB").replace("*", "MUL").replace("/", "DIV") self.lstInputFiles = [ i.path.value for i in self.dataInput.inputCurve] if self.dataInput.constant is not None: self.const = self.dataInput.constant.value self.generateCommandLineOptions()
def preProcess(self, _edObject=None): EDPluginExecProcessScript.preProcess(self) self.DEBUG("EDPluginExecCrystFELPostprocessv1_0.preProcess") self.mtz_filename = "%s_partialator_%s.mtz" % ( self.dataInput.baseFileName.value, self.dataInput.pointGroup.value) strCommandLine = self.generateCommandLine(self.dataInput) self.setScriptCommandline(strCommandLine)
def preProcess(self, _edObject=None): EDPluginExecProcessScript.preProcess(self) self.DEBUG("EDPluginExecDammifv0_2.preProcess") if self.dataInput.order: self.name = "dammif-%s" % self.dataInput.order.value # I know I only modify the instance variable, not the class one self.generateDammifScript() # in order avoid 2 dammif starting at the same milisecond, we sleep for up to 64 ms time.sleep(1e-3 * (self.getId() % 64))
def preProcess(self): EDPluginExecProcessScript.preProcess(self) self.DEBUG('Pointless: preprocess') if self.output_file is not None and self.input_file is not None: # TODO: ask Max why he forces the version to 6.2.0 options = 'xdsin {0} hklout {1}'.format(self.input_file, self.output_file) self.setScriptCommandline(options) self.DEBUG('command line options set to {0}'.format(options))
def preProcess(self, _edObject=None): EDPluginExecProcessScript.preProcess(self) self.DEBUG("EDPluginExecDimplev1_0.preProcess") xsDataInputDimple = self.getDataInput() strMtzFile = xsDataInputDimple.mtz.path.value strPdbFile = xsDataInputDimple.pdb.path.value self.strDimpleDir = os.path.join(self.getWorkingDirectory(), "dimple") self.setScriptCommandline(" " + strMtzFile + " " + strPdbFile + " " + self.strDimpleDir)
def preProcess(self): EDPluginExecProcessScript.preProcess(self) self.DEBUG('Pointless: preprocess') if self.output_file is not None and self.input_file is not None: # TODO: ask Max why he forces the version to 6.2.0 options = 'xdsin {0} hklout {1}'.format(self.input_file, self.output_file) self.setScriptCommandline(options) self.DEBUG('command line options set to {0}'.format(options))
def preProcess(self, _edObject=None): EDPluginExecProcessScript.preProcess(self) EDVerbose.DEBUG("*** EDPluginFIT2DCakev1_0.preProcess") # Check that the input data and correction images are present xsDataInputFIT2DCake = self.getDataInput() pyStrPathToInputFile = xsDataInputFIT2DCake.getInputFile().getPath( ).getValue() if (not os.path.exists(pyStrPathToInputFile)): strErrorMessage = EDMessage.ERROR_CANNOT_READ_FILE_02 % ( self.getPluginName() + ".preProcess", pyStrPathToInputFile) EDVerbose.error(strErrorMessage) self.addErrorMessage(strErrorMessage) raise RuntimeError, strErrorMessage pyStrPathToDarkCurrentImageFile = xsDataInputFIT2DCake.getDarkCurrentImageFile( ).getPath().getValue() if (not os.path.exists(pyStrPathToDarkCurrentImageFile)): strErrorMessage = EDMessage.ERROR_CANNOT_READ_FILE_02 % ( self.getPluginName() + ".preProcess", pyStrPathToDarkCurrentImageFile) EDVerbose.error(strErrorMessage) self.addErrorMessage(strErrorMessage) raise RuntimeError, strErrorMessage pyStrPathToFlatFieldImageFile = xsDataInputFIT2DCake.getFlatFieldImageFile( ).getPath().getValue() if (not os.path.exists(pyStrPathToFlatFieldImageFile)): strErrorMessage = EDMessage.ERROR_CANNOT_READ_FILE_02 % ( self.getPluginName() + ".preProcess", pyStrPathToFlatFieldImageFile) EDVerbose.error(strErrorMessage) self.addErrorMessage(strErrorMessage) raise RuntimeError, strErrorMessage pyStrPathToSpatialDistortionFile = xsDataInputFIT2DCake.getSpatialDistortionFile( ).getPath().getValue() if (not os.path.exists(pyStrPathToSpatialDistortionFile)): strErrorMessage = EDMessage.ERROR_CANNOT_READ_FILE_02 % ( self.getPluginName() + ".preProcess", pyStrPathToSpatialDistortionFile) EDVerbose.error(strErrorMessage) self.addErrorMessage(strErrorMessage) raise RuntimeError, strErrorMessage # Get path to Xvfb program pluginConfiguration = self.getConfiguration() if (pluginConfiguration is not None): self.m_strPathToXvfb = EDConfiguration.getStringParamValue( pluginConfiguration, self.m_strCONF_PATH_TO_XVFB) self.m_strArgumentsForXvfb = EDConfiguration.getStringParamValue( pluginConfiguration, self.m_strCONF_ARGUMENTS_FOR_XVFB) if (self.m_strPathToXvfb is None): strErrorMessage = EDMessage.ERROR_NO_PLUGIN_CONFIGURATION_ITEM_FOUND_02 % ( self.getPluginName() + ".preProcess", self.m_strCONF_PATH_TO_XVFB) EDVerbose.error(strErrorMessage) self.addErrorMessage(strErrorMessage) raise RuntimeError, strErrorMessage self.generateFIT2DCommands()
def preProcess(self, _edObject=None): EDPluginExecProcessScript.preProcess(self) self.DEBUG("EDPluginSTACv2_0.preProcess") self.addListCommandPreExecution("export STACDIR=%s" % self.config.get("STACDIR")) if (self.__pyStrBCMDEF is None): self.__pyStrBCMDEF = self.config.get("BCMDEF") self.DEBUG("EDPluginSTACv2_0.preProcess: BCMDEF set to %s" % self.__pyStrBCMDEF) self.addListCommandPreExecution("export BCMDEF=%s" % self.__pyStrBCMDEF) self.addListCommandPreExecution("export RUNDIR=%s" % self.getWorkingDirectory()) self.setScriptCommandline("stac.core.STAC_DNA_listener %s -%s/ %s" % (self.getSTACcommand(), self.getWorkingDirectory(), self.getSTACparams()))
def preProcess(self, _edObject=None): EDPluginExecProcessScript.preProcess(self) EDVerbose.DEBUG("*** EDPluginExecDIMPLEFREERFLAGv10.preProcess") self._hklin = self.getDataInput().getHKLIN().getPath().getValue() self._hklout = self.getDataInput().getHKLOUT().getPath().getValue() self.freer_flag_script() return
def preProcess(self, _edObject=None): """ Sets up the Labelit command line """ EDPluginExecProcessScript.preProcess(self, _edObject) EDVerbose.DEBUG("EDPluginDistlSignalStrengthv1_1.preProcess...") self.xsDataImage = self.getDataInput().getReferenceImage() strCommandLine = self.xsDataImage.getPath().getValue() self.setScriptCommandline(strCommandLine) self.addListCommandPreExecution("export PYTHONPATH=\"\" ")
def preProcess(self, _edObject=None): """ Sets up the Labelit command line """ EDPluginExecProcessScript.preProcess(self, _edObject) self.DEBUG("EDPluginDistlSignalStrengthv1_1.preProcess...") self.xsDataImage = self.getDataInput().getReferenceImage() strCommandLine = self.xsDataImage.getPath().getValue() self.setScriptCommandline(strCommandLine) self.addListCommandPreExecution("export PYTHONPATH=\"\" ")
def preProcess(self, _edObject=None): EDPluginExecProcessScript.preProcess(self) self.DEBUG("EDPluginExecSiftOffsetv1_0.preProcess") self.inputFiles = [ i.getPath().getValue() for i in self.getDataInput().getDescriptorFile() ] self.outFile = os.path.join(self.getWorkingDirectory(), EDPluginExecSiftOffsetv1_0.OUTPUT) self.generateAutopanoCommand()
def preProcess(self, _edObject=None): EDPluginExecProcessScript.preProcess(self) self.DEBUG("EDPluginExecSiftDescriptorv1_0.preProcess") self.strImage = self.getDataInput().getImage().getPath().getValue() if not os.path.isfile(self.strImage): strError = "Input image file does not exist: %s" % self.strImage self.ERROR(strError) self.setFailure() raise RuntimeError(strError) self.strKeys = os.path.join(self.getWorkingDirectory(), os.path.basename(self.strImage + ".keys.gz")) self.generateKeysCommand()
def preProcess(self, _edObject=None): """ Sets up the Labelit command line """ EDPluginExecProcessScript.preProcess(self, _edObject) self.DEBUG("EDPluginDistlSignalStrengthThinClientv1_1.preProcess...") self.xsDataImage = self.getDataInput().getReferenceImage() strCommandLine = self.xsDataImage.getPath().getValue() strCommandLine += " %s" % self.strHostName strCommandLine += " %d" % self.iPortNumber self.setScriptCommandline(strCommandLine) self.addListCommandPreExecution("export PYTHONPATH=\"\" ")
def preProcess(self, _edObject = None): EDPluginExecProcessScript.preProcess(self) EDVerbose.DEBUG("*** EDPluginExecDIMPLEFREERFLAGv10.preProcess") self._hklin = self.getDataInput().getHKLIN().getPath( ).getValue() self._hklout = self.getDataInput().getHKLOUT().getPath( ).getValue() self.freer_flag_script() return
def preProcess(self, _edObject=None): EDPluginExecProcessScript.preProcess(self) EDVerbose.DEBUG("EDPluginRaddosev10.preProcess") self.setScriptLogFileName("raddose.log") # Fix for bug 432: if flux is close to zero or negative failure if (self.getDataInput().getBeamFlux().getValue() < 0.1): strErrorMessage = "EDPluginRaddosev10.preProcess ERROR: Input flux is negative or close to zero. Execution of characterisation aborted." EDVerbose.ERROR(strErrorMessage) self.addErrorMessage(strErrorMessage) self.setFailure() else: self.initializeCommandExecution()
def preProcess(self, _edObject=None): EDPluginExecProcessScript.preProcess(self) self.DEBUG("EDPluginExecDamminv0_2.preProcess") if self.dataInput.name: self.__strProjectDesc = self.dataInput.name.value if self.dataInput.unit: unit = self.dataInput.unit.value.lower() if unit in ["a", "ang", "angstrom", "1", "1/a", "a^-1"]: self.__strAngleUnit = "1" if unit in ["nm", "nanom", "nanometer", "2", "1/nm", "nm^-1"]: self.__strAngleUnit = "2" self.generateDamminScript()