def functionXMLout(_strXMLin, _strXMLout): """ This is an example of XMLout function ... it prints only the name of the file created @param _srXMLin: The XML string used to launch the job @type _strXMLin: python string with the input XML @param _strXMLout: The XML string retrieved job @type _strXMLout: python string with the output XML @return: None """ xsDataInputGridScreening = XSDataInputGridScreening.parseString(_strXMLin) strImagePath = xsDataInputGridScreening.getImageFile().getPath().getValue() EDVerbose.screen("Successful processing of image %s" % strImagePath) strResultText = "%40s " % os.path.basename(strImagePath) xsDataResultGridScreening = XSDataResultGridScreening.parseString(_strXMLout) fileNameParameters = xsDataResultGridScreening.getFileNameParameters() if fileNameParameters is None: strResultText += "%6s%10s%10s%6s" % ("NA", "NA", "NA","NA") else: strResultText += "%6s%10s%10s%6s" % ( fileNameParameters.getScanId1().getValue(), fileNameParameters.getMotorPosition1().getValue(), fileNameParameters.getMotorPosition2().getValue(), fileNameParameters.getScanId2().getValue(), ) imageQualityIndicators = xsDataResultGridScreening.getImageQualityIndicators() if imageQualityIndicators is None: strResultText += "%6s%6s%6s%6s%10s" % ("NA", "NA", "NA","NA", "NA") else: strMethod1Res = "%6s" % "NA" if imageQualityIndicators.getMethod1Res(): strMethod1Res = "%6.1f" % imageQualityIndicators.getMethod1Res().getValue() strMethod2Res = "%6s" % "NA" if imageQualityIndicators.getMethod2Res(): strMethod2Res = "%6.1f" % imageQualityIndicators.getMethod2Res().getValue() strSpotTotal = "%6s" % "NA" if imageQualityIndicators.getSpotTotal(): strSpotTotal = "%6d" % imageQualityIndicators.getSpotTotal().getValue() strGoodBraggCandidates = "%6s" % "NA" if imageQualityIndicators.getGoodBraggCandidates(): strGoodBraggCandidates = "%6d" % imageQualityIndicators.getGoodBraggCandidates().getValue() strTotalIntegratedSignal = "%10s" % "NA" if imageQualityIndicators.getTotalIntegratedSignal(): strTotalIntegratedSignal = "%10.0f" % imageQualityIndicators.getTotalIntegratedSignal().getValue() strResultText += strMethod1Res + strMethod2Res + strSpotTotal + strGoodBraggCandidates + strTotalIntegratedSignal if xsDataResultGridScreening.getMosaicity() is None: strResultText += "%6s" % "NA" else: strResultText += "%6.1f" % xsDataResultGridScreening.getMosaicity().getValue() if xsDataResultGridScreening.getRankingResolution() is None: strResultText += "%6s" % "NA" else: strResultText += "%6.1f" % xsDataResultGridScreening.getRankingResolution().getValue() strResultText += " " + xsDataResultGridScreening.getComment().getValue() writeToResultFile(strResultText)
def functionXMLerror(_strXMLin): """ @param _strXMLin: The XML string used to launch the job @type _strXMLin: python string with the input XML @return: None """ xsDataInputGridScreening = XSDataInputGridScreening.parseString(_strXMLin) strImagePath = xsDataInputGridScreening.getImagePath()[0].getPath().getValue() strResultText = os.path.dirname(strImagePath) + " " + os.path.basename(strImagePath) + " " strResultText = strResultText + "Processing failed." writeToResultFile(strResultText) return None
def testCheckParameters(self): strXMLInput = self.readAndParseFile(self.strPathToReferenceInput) xsDataInput = XSDataInputGridScreening.parseString(strXMLInput) edPluginExecCharacterisation = self.createPlugin() edPluginExecCharacterisation.setDataInput(xsDataInput) edPluginExecCharacterisation.checkParameters()