Exemplo n.º 1
0
 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()
Exemplo n.º 2
0
    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')
Exemplo n.º 3
0
    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()
Exemplo n.º 4
0
    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()
Exemplo n.º 5
0
 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)
Exemplo n.º 6
0
    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')
Exemplo n.º 7
0
    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()
Exemplo n.º 8
0
    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()
Exemplo n.º 9
0
 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()
Exemplo n.º 10
0
 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()
Exemplo n.º 11
0
 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")
Exemplo n.º 12
0
 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()
Exemplo n.º 13
0
 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)
Exemplo n.º 14
0
 def preProcess(self, _edObject=None):
     """
     Pre-Process: Generate the script 
     """
     EDPluginExecProcessScript.preProcess(self)
     self.DEBUG("EDPluginExecCommandLinev10.preProcess")
     self.generateScript()
Exemplo n.º 15
0
    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')
Exemplo n.º 16
0
    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()
Exemplo n.º 17
0
 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()
Exemplo n.º 18
0
 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)
Exemplo n.º 19
0
 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)
Exemplo n.º 20
0
    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()
Exemplo n.º 21
0
 def preProcess(self, _edObject=None):
     """
     Pre-Process: Generate the script 
     """
     EDPluginExecProcessScript.preProcess(self)
     self.DEBUG("EDPluginExecCommandLinev10.preProcess")
     self.generateScript()
Exemplo n.º 22
0
 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()))
Exemplo n.º 23
0
 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()
Exemplo n.º 24
0
    def preProcess(self, _edObject=None):
        EDPluginExecProcessScript.preProcess(self)
        self.DEBUG("EDPluginExecDamaverv0_2.preProcess")

        self.checkDamaverPath()
        self.checkDamaverAutomaticInput()
        self.checkDamaverSymmetryInput()
        self.generateDamaverScript()
Exemplo n.º 25
0
 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)
Exemplo n.º 26
0
 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))
Exemplo n.º 27
0
    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))
Exemplo n.º 28
0
 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))
Exemplo n.º 29
0
 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()))
Exemplo n.º 30
0
 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()
Exemplo n.º 31
0
 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())
Exemplo n.º 32
0
    def preProcess(self, _edObject=None):
        EDPluginExecProcessScript.preProcess(self)
        self.DEBUG("EDPluginExecDamaverv0_3.preProcess")

        self.checkDamaverPath()
        self.checkDamaverAutomaticInput()
        self.checkDamaverSymmetryInput()
        self.generateDamaverScript()
Exemplo n.º 33
0
 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)
Exemplo n.º 34
0
 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)
Exemplo n.º 35
0
 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))
Exemplo n.º 36
0
    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')
Exemplo n.º 37
0
    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))
Exemplo n.º 38
0
 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)
Exemplo n.º 40
0
    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))
Exemplo n.º 41
0
 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))
Exemplo n.º 42
0
 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)
Exemplo n.º 43
0
 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))
Exemplo n.º 44
0
    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()
Exemplo n.º 45
0
 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()))
Exemplo n.º 46
0
    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=\"\" ")
Exemplo n.º 48
0
 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=\"\" ")
Exemplo n.º 49
0
 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()
Exemplo n.º 54
0
 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()