예제 #1
0
    def getDataMOSFLMNewmat(self, _strNewmatFileName=None):
        self.DEBUG("EDPluginMOSFLMv10.getDataMOSFLMNewmat")
        xsDataMOSFLMNewmat = None
        strNewmatFileName = None
        listOfListOfFloat = []
        if (_strNewmatFileName == None):
            strNewmatFileName = self.getNewmatFileName()
        else:
            strNewmatFileName = _strNewmatFileName
        strNewmat = None
        try:
            strNewmat = self.readProcessFile(strNewmatFileName)
        except:
            strError = self.readProcessErrorLogFile()
            if (strError is not None) and (strError != ""):
                strErrorMessage = "EDPluginMOSFLMv10.getDataMOSFLMNewmat: %s : error reading newmat file : %s" % \
                                (self.getClassName(), strError)
                self.error(strErrorMessage)
                self.addErrorMessage(strErrorMessage)
                self.setFailure()
            else:
                strErrorMessage = "EDPluginMOSFLMv10.getDataMOSFLMNewmat : Cannot read MOSFLM NEWMAT file : " + strNewmatFileName
                self.error(strErrorMessage)
                self.addErrorMessage(strErrorMessage)
                self.setFailure()
        #print strNewmat
        if (strNewmat is not None):
            listLine = strNewmat.split("\n")
            # Convert into list of lists of float
            for strLine in listLine:
                if not strLine.startswith("SYMM"):
                    listOfListOfFloat.append(self.splitStringIntoListOfFloats(strLine))
            # Fill in the data
            xsDataMOSFLMNewmat = XSDataMOSFLMNewmat()

            XSDataMatrixDoubleA = XSDataMatrixDouble()
            XSDataMatrixDoubleA.setM11(listOfListOfFloat[0][0])
            XSDataMatrixDoubleA.setM12(listOfListOfFloat[0][1])
            XSDataMatrixDoubleA.setM13(listOfListOfFloat[0][2])
            XSDataMatrixDoubleA.setM21(listOfListOfFloat[1][0])
            XSDataMatrixDoubleA.setM22(listOfListOfFloat[1][1])
            XSDataMatrixDoubleA.setM23(listOfListOfFloat[1][2])
            XSDataMatrixDoubleA.setM31(listOfListOfFloat[2][0])
            XSDataMatrixDoubleA.setM32(listOfListOfFloat[2][1])
            XSDataMatrixDoubleA.setM33(listOfListOfFloat[2][2])
            xsDataMOSFLMNewmat.setAMatrix(XSDataMatrixDoubleA)

            xsDataMOSFLMMissettingsAngles = XSDataMOSFLMMissettingsAngles()
            xsDataMOSFLMMissettingsAngles.setPhix(XSDataAngle(listOfListOfFloat[3][0]))
            xsDataMOSFLMMissettingsAngles.setPhiy(XSDataAngle(listOfListOfFloat[3][1]))
            xsDataMOSFLMMissettingsAngles.setPhiz(XSDataAngle(listOfListOfFloat[3][2]))
            xsDataMOSFLMNewmat.setMissettingAngles(xsDataMOSFLMMissettingsAngles)

            XSDataMatrixDoubleU = XSDataMatrixDouble()
            XSDataMatrixDoubleU.setM11(listOfListOfFloat[4][0])
            XSDataMatrixDoubleU.setM12(listOfListOfFloat[4][1])
            XSDataMatrixDoubleU.setM13(listOfListOfFloat[4][2])
            XSDataMatrixDoubleU.setM21(listOfListOfFloat[5][0])
            XSDataMatrixDoubleU.setM22(listOfListOfFloat[5][1])
            XSDataMatrixDoubleU.setM23(listOfListOfFloat[5][2])
            XSDataMatrixDoubleU.setM31(listOfListOfFloat[6][0])
            XSDataMatrixDoubleU.setM32(listOfListOfFloat[6][1])
            XSDataMatrixDoubleU.setM33(listOfListOfFloat[6][2])
            xsDataMOSFLMNewmat.setUMatrix(XSDataMatrixDoubleU)

            xsDataCellRefined = XSDataCell()
            xsDataCellRefined.setLength_a(XSDataLength(listOfListOfFloat[7][0]))
            xsDataCellRefined.setLength_b(XSDataLength(listOfListOfFloat[7][1]))
            xsDataCellRefined.setLength_c(XSDataLength(listOfListOfFloat[7][2]))
            xsDataCellRefined.setAngle_alpha(XSDataAngle(listOfListOfFloat[7][3]))
            xsDataCellRefined.setAngle_beta(XSDataAngle(listOfListOfFloat[7][4]))
            xsDataCellRefined.setAngle_gamma(XSDataAngle(listOfListOfFloat[7][5]))
            xsDataMOSFLMNewmat.setRefinedCell(xsDataCellRefined)

        return xsDataMOSFLMNewmat
예제 #2
0
    def getReferenceDataMOSFLMNewmat(self):

        xsDataMOSFLMNewmat = XSDataMOSFLMNewmat()

        XSDataMatrixDoubleA = XSDataMatrixDouble()
        XSDataMatrixDoubleA.setM11(-0.00826416)
        XSDataMatrixDoubleA.setM12(0.00885073)
        XSDataMatrixDoubleA.setM13(0.00937013)
        XSDataMatrixDoubleA.setM21(0.00126554)
        XSDataMatrixDoubleA.setM22(0.01251971)
        XSDataMatrixDoubleA.setM23(-0.00845341)
        XSDataMatrixDoubleA.setM31(-0.01484956)
        XSDataMatrixDoubleA.setM32(-0.00385867)
        XSDataMatrixDoubleA.setM33(-0.00593515)
        xsDataMOSFLMNewmat.setAMatrix(XSDataMatrixDoubleA)

        xsDataMOSFLMMissettingsAngles = XSDataMOSFLMMissettingsAngles()
        xsDataMOSFLMMissettingsAngles.setPhix(XSDataAngle(1.000))
        xsDataMOSFLMMissettingsAngles.setPhiy(XSDataAngle(2.000))
        xsDataMOSFLMMissettingsAngles.setPhiz(XSDataAngle(3.000))
        xsDataMOSFLMNewmat.setMissettingAngles(xsDataMOSFLMMissettingsAngles)

        XSDataMatrixDoubleU = XSDataMatrixDouble()
        XSDataMatrixDoubleU.setM11(-0.4849475)
        XSDataMatrixDoubleU.setM12(0.5598049)
        XSDataMatrixDoubleU.setM13(0.6718960)
        XSDataMatrixDoubleU.setM21(0.0742629)
        XSDataMatrixDoubleU.setM22(0.7918670)
        XSDataMatrixDoubleU.setM23(-0.6061614)
        XSDataMatrixDoubleU.setM31(-0.8713845)
        XSDataMatrixDoubleU.setM32(-0.2440595)
        XSDataMatrixDoubleU.setM33(-0.4255866)
        xsDataMOSFLMNewmat.setUMatrix(XSDataMatrixDoubleU)

        xsDataCellRefined = XSDataCell()
        xsDataCellRefined.setLength_a(XSDataLength(54.8079))
        xsDataCellRefined.setLength_b(XSDataLength(59.0751))
        xsDataCellRefined.setLength_c(XSDataLength(66.9736))
        xsDataCellRefined.setAngle_alpha(XSDataAngle(91.0000))
        xsDataCellRefined.setAngle_beta(XSDataAngle(92.0000))
        xsDataCellRefined.setAngle_gamma(XSDataAngle(93.0000))
        xsDataMOSFLMNewmat.setRefinedCell(xsDataCellRefined)

        return xsDataMOSFLMNewmat
예제 #3
0
    def getDataMOSFLMNewmat(self, _strNewmatFileName=None):
        self.DEBUG("EDPluginMOSFLMv10.getDataMOSFLMNewmat")
        xsDataMOSFLMNewmat = None
        strNewmatFileName = None
        listOfListOfFloat = []
        if (_strNewmatFileName == None):
            strNewmatFileName = self.getNewmatFileName()
        else:
            strNewmatFileName = _strNewmatFileName
        strNewmat = None
        try:
            strNewmat = self.readProcessFile(strNewmatFileName)
        except:
            strError = self.readProcessErrorLogFile()
            if (strError is not None) and (strError != ""):
                strErrorMessage = "EDPluginMOSFLMv10.getDataMOSFLMNewmat: %s : error reading newmat file : %s" % \
                                (self.getClassName(), strError)
                self.error(strErrorMessage)
                self.addErrorMessage(strErrorMessage)
                self.setFailure()
            else:
                strErrorMessage = "EDPluginMOSFLMv10.getDataMOSFLMNewmat : Cannot read MOSFLM NEWMAT file : " + strNewmatFileName
                self.error(strErrorMessage)
                self.addErrorMessage(strErrorMessage)
                self.setFailure()
        # print strNewmat
        if (strNewmat is not None):
            listLine = strNewmat.split("\n")
            # Convert into list of lists of float
            for strLine in listLine:
                if not strLine.startswith("SYMM"):
                    listOfListOfFloat.append(
                        self.splitStringIntoListOfFloats(strLine))
            # Fill in the data
            xsDataMOSFLMNewmat = XSDataMOSFLMNewmat()

            XSDataMatrixDoubleA = XSDataMatrixDouble()
            XSDataMatrixDoubleA.setM11(listOfListOfFloat[0][0])
            XSDataMatrixDoubleA.setM12(listOfListOfFloat[0][1])
            XSDataMatrixDoubleA.setM13(listOfListOfFloat[0][2])
            XSDataMatrixDoubleA.setM21(listOfListOfFloat[1][0])
            XSDataMatrixDoubleA.setM22(listOfListOfFloat[1][1])
            XSDataMatrixDoubleA.setM23(listOfListOfFloat[1][2])
            XSDataMatrixDoubleA.setM31(listOfListOfFloat[2][0])
            XSDataMatrixDoubleA.setM32(listOfListOfFloat[2][1])
            XSDataMatrixDoubleA.setM33(listOfListOfFloat[2][2])
            xsDataMOSFLMNewmat.setAMatrix(XSDataMatrixDoubleA)

            xsDataMOSFLMMissettingsAngles = XSDataMOSFLMMissettingsAngles()
            xsDataMOSFLMMissettingsAngles.setPhix(
                XSDataAngle(listOfListOfFloat[3][0]))
            xsDataMOSFLMMissettingsAngles.setPhiy(
                XSDataAngle(listOfListOfFloat[3][1]))
            xsDataMOSFLMMissettingsAngles.setPhiz(
                XSDataAngle(listOfListOfFloat[3][2]))
            xsDataMOSFLMNewmat.setMissettingAngles(
                xsDataMOSFLMMissettingsAngles)

            XSDataMatrixDoubleU = XSDataMatrixDouble()
            XSDataMatrixDoubleU.setM11(listOfListOfFloat[4][0])
            XSDataMatrixDoubleU.setM12(listOfListOfFloat[4][1])
            XSDataMatrixDoubleU.setM13(listOfListOfFloat[4][2])
            XSDataMatrixDoubleU.setM21(listOfListOfFloat[5][0])
            XSDataMatrixDoubleU.setM22(listOfListOfFloat[5][1])
            XSDataMatrixDoubleU.setM23(listOfListOfFloat[5][2])
            XSDataMatrixDoubleU.setM31(listOfListOfFloat[6][0])
            XSDataMatrixDoubleU.setM32(listOfListOfFloat[6][1])
            XSDataMatrixDoubleU.setM33(listOfListOfFloat[6][2])
            xsDataMOSFLMNewmat.setUMatrix(XSDataMatrixDoubleU)

            xsDataCellRefined = XSDataCell()
            xsDataCellRefined.setLength_a(XSDataLength(
                listOfListOfFloat[7][0]))
            xsDataCellRefined.setLength_b(XSDataLength(
                listOfListOfFloat[7][1]))
            xsDataCellRefined.setLength_c(XSDataLength(
                listOfListOfFloat[7][2]))
            xsDataCellRefined.setAngle_alpha(
                XSDataAngle(listOfListOfFloat[7][3]))
            xsDataCellRefined.setAngle_beta(
                XSDataAngle(listOfListOfFloat[7][4]))
            xsDataCellRefined.setAngle_gamma(
                XSDataAngle(listOfListOfFloat[7][5]))
            xsDataMOSFLMNewmat.setRefinedCell(xsDataCellRefined)

        return xsDataMOSFLMNewmat
    def createDataMOSFLMOutputIndexing(self):
        EDVerbose.DEBUG("EDPluginMOSFLMIndexingv10.createDataMOSFLMOutputIndexing")
        xsDataMOSFLMOutputIndexing = XSDataMOSFLMOutputIndexing()
        # Read Newmat file
        xsDataMOSFLMNewmat = self.getDataMOSFLMNewmat()
        if (xsDataMOSFLMNewmat is None):
            strError = "MOSFLM indexing error : No solution was obtained!"
            EDVerbose.ERROR(strError)
            self.setFailure()
        else:
            xsDataMOSFLMOutputIndexing.setRefinedNewmat(xsDataMOSFLMNewmat)
            # Then read the XML file
            strDnaTablesXML = self.readProcessFile(self.getScriptBaseName() + "_dnaTables.xml")
            xsDataDnaTables = dna_tables.parseString(strDnaTablesXML)

            listXSTableMosaicityEstimation = EDUtilsTable.getTableListFromTables(xsDataDnaTables, "mosaicity_estimation")
            dMosaicityValueSum = 0.0
            nValues = 0
            for xsTableMosaicityEstimation in listXSTableMosaicityEstimation:
                for xsListMosaicity in EDUtilsTable.getListsFromTable(xsTableMosaicityEstimation, "mosaicity"):
                    dMosaicityValue = float(EDUtilsTable.getItemFromList(xsListMosaicity, "value").getValueOf_())
                    dMosaicityValueSum += dMosaicityValue
                    nValues += 1
            xsDataFloatMosaicityEstimation = XSDataFloat()
            xsDataFloatMosaicityEstimation.setValue(dMosaicityValueSum / nValues)
            xsDataMOSFLMOutputIndexing.setMosaicityEstimation(xsDataFloatMosaicityEstimation)

            xsTableRefinement = EDUtilsTable.getTableFromTables(xsDataDnaTables, "refinement")
            if (xsTableRefinement is None):
                strError = "MOSFLM indexing error : No solution was refined!"
                EDVerbose.ERROR(strError)
                self.setFailure()
            else:
                xsListDeviations = EDUtilsTable.getListsFromTable(xsTableRefinement, "deviations")[0]
                dDeviationAngular = float(EDUtilsTable.getItemFromList(xsListDeviations, "angular").getValueOf_())
                dDeviationPositional = float(EDUtilsTable.getItemFromList(xsListDeviations, "positional").getValueOf_())
                xsDataMOSFLMOutputIndexing.setDeviationAngular(XSDataAngle(dDeviationAngular))
                xsDataMOSFLMOutputIndexing.setDeviationPositional(XSDataLength(dDeviationPositional))
                xsListResults = EDUtilsTable.getListsFromTable(xsTableRefinement, "results")[0]
                dDetectorDistance = float(EDUtilsTable.getItemFromList(xsListResults, "detector_distance").getValueOf_())
                xsDataMOSFLMOutputIndexing.setRefinedDistance(XSDataLength(dDetectorDistance))
                xsListParameters = EDUtilsTable.getListsFromTable(xsTableRefinement, "parameters")[0]
                iSpotsUsed = int(EDUtilsTable.getItemFromList(xsListParameters, "used").getValueOf_())
                iSpotsTotal = int(EDUtilsTable.getItemFromList(xsListParameters, "out_of").getValueOf_())
                xsDataMOSFLMOutputIndexing.setSpotsUsed(XSDataInteger(iSpotsUsed))
                xsDataMOSFLMOutputIndexing.setSpotsTotal(XSDataInteger(iSpotsTotal))

                xsTableSolutionRefinement = EDUtilsTable.getTableFromTables(xsDataDnaTables, "solution_refinement")
                xsListParameters = EDUtilsTable.getListsFromTable(xsTableSolutionRefinement, "selection")[0]
                iSelectedSolutionNumber = int(EDUtilsTable.getItemFromList(xsListParameters, "number").getValueOf_())
                xsDataMOSFLMOutputIndexing.setSelectedSolutionNumber(XSDataInteger(iSelectedSolutionNumber))
                strSelectedSolutionSpaceGroup = (EDUtilsTable.getItemFromList(xsListParameters, "spacegroup").getValueOf_())
                xsDataMOSFLMOutputIndexing.setSelectedSolutionSpaceGroup(XSDataString(strSelectedSolutionSpaceGroup))
                iSelectedSolutionSpaceGroupNumber = int(EDUtilsTable.getItemFromList(xsListParameters, "spacegroup_number").getValueOf_())
                xsDataMOSFLMOutputIndexing.setSelectedSolutionSpaceGroupNumber(XSDataInteger(iSelectedSolutionSpaceGroupNumber))

                xsTableAutoIndexSolutions = EDUtilsTable.getTableFromTables(xsDataDnaTables, "autoindex_solutions")
                xsListsSolution = xsTableAutoIndexSolutions.getList()
                for xsListSolution in xsListsSolution:
                    xsDataMOSFLMIndexingSolution = XSDataMOSFLMIndexingSolution()
                    xsDataCell = XSDataCell()
                    iSolutionNumber = int(EDUtilsTable.getItemFromList(xsListSolution, "index").getValueOf_())
                    xsDataMOSFLMIndexingSolution.setIndex(XSDataInteger(iSolutionNumber))
                    iPenalty = int(EDUtilsTable.getItemFromList(xsListSolution, "penalty").getValueOf_())
                    xsDataMOSFLMIndexingSolution.setPenalty(XSDataInteger(iPenalty))
                    strLattice = (EDUtilsTable.getItemFromList(xsListSolution, "lattice").getValueOf_())
                    xsDataMOSFLMIndexingSolution.setLattice(XSDataString(strLattice))
                    dA = float(EDUtilsTable.getItemFromList(xsListSolution, "a").getValueOf_())
                    xsDataCell.setLength_a(XSDataLength(dA))
                    dB = float(EDUtilsTable.getItemFromList(xsListSolution, "b").getValueOf_())
                    xsDataCell.setLength_b(XSDataLength(dB))
                    dC = float(EDUtilsTable.getItemFromList(xsListSolution, "c").getValueOf_())
                    xsDataCell.setLength_c(XSDataLength(dC))
                    dAlpha = float(EDUtilsTable.getItemFromList(xsListSolution, "alpha").getValueOf_())
                    xsDataCell.setAngle_alpha(XSDataAngle(dAlpha))
                    dBeta = float(EDUtilsTable.getItemFromList(xsListSolution, "beta").getValueOf_())
                    xsDataCell.setAngle_beta(XSDataAngle(dBeta))
                    dGamma = float(EDUtilsTable.getItemFromList(xsListSolution, "gamma").getValueOf_())
                    xsDataCell.setAngle_gamma(XSDataAngle(dGamma))
                    xsDataMOSFLMIndexingSolution.setCell(xsDataCell)
                    xsDataMOSFLMOutputIndexing.addPossibleSolutions(xsDataMOSFLMIndexingSolution)

                xsTableBeamRefinement = EDUtilsTable.getTableFromTables(xsDataDnaTables, "beam_refinement")
                xsDataMOSFLMBeamPositionRefined = XSDataMOSFLMBeamPosition()
                xsDataMOSFLMBeamPositionShift = XSDataMOSFLMBeamPosition()
                dInitialBeamX = 0.0
                dInitialBeamY = 0.0
                dRefinedBeamX = 0.0
                dRefinedBeamY = 0.0
                xsListInitialBeam = EDUtilsTable.getListsFromTable(xsTableBeamRefinement, "initial_beam")[0]
                fInitialBeamPositionX = float(EDUtilsTable.getItemFromList(xsListInitialBeam, "x").getValueOf_())
                fInitialBeamPositionY = float(EDUtilsTable.getItemFromList(xsListInitialBeam, "y").getValueOf_())
                xsListRefinedBeam = EDUtilsTable.getListsFromTable(xsTableBeamRefinement, "refined_beam")[0]
                fRefinedBeamPositionX = float(EDUtilsTable.getItemFromList(xsListRefinedBeam, "x").getValueOf_())
                fRefinedBeamPositionY = float(EDUtilsTable.getItemFromList(xsListRefinedBeam, "y").getValueOf_())
                xsDataMOSFLMBeamPositionRefined.setX(XSDataLength(fRefinedBeamPositionX))
                xsDataMOSFLMBeamPositionRefined.setY(XSDataLength(fRefinedBeamPositionY))
                xsDataMOSFLMBeamPositionShift.setX(XSDataLength(fInitialBeamPositionX - fRefinedBeamPositionX))
                xsDataMOSFLMBeamPositionShift.setY(XSDataLength(fInitialBeamPositionY - fRefinedBeamPositionY))
                xsDataMOSFLMOutputIndexing.setRefinedBeam(xsDataMOSFLMBeamPositionRefined)
                xsDataMOSFLMOutputIndexing.setBeamShift(xsDataMOSFLMBeamPositionShift)

        return xsDataMOSFLMOutputIndexing
    def createDataMOSFLMOutputIndexing(self):
        self.DEBUG("EDPluginMOSFLMIndexingv10.createDataMOSFLMOutputIndexing")
        xsDataMOSFLMOutputIndexing = XSDataMOSFLMOutputIndexing()
        # Read Newmat file
        xsDataMOSFLMNewmat = self.getDataMOSFLMNewmat()
        if (xsDataMOSFLMNewmat is None):
            strError = "MOSFLM indexing error : No solution was obtained!"
            self.ERROR(strError)
            self.setFailure()
        else:
            xsDataMOSFLMOutputIndexing.setRefinedNewmat(xsDataMOSFLMNewmat)
            # Then read the XML file
            strDnaTablesXML = self.readProcessFile(self.getScriptBaseName() +
                                                   "_dnaTables.xml")
            xsDataDnaTables = dna_tables.parseString(strDnaTablesXML)

            listXSTableMosaicityEstimation = EDUtilsTable.getTableListFromTables(
                xsDataDnaTables, "mosaicity_estimation")
            dMosaicityValueSum = 0.0
            nValues = 0
            for xsTableMosaicityEstimation in listXSTableMosaicityEstimation:
                for xsListMosaicity in EDUtilsTable.getListsFromTable(
                        xsTableMosaicityEstimation, "mosaicity"):
                    dMosaicityValue = float(
                        EDUtilsTable.getItemFromList(xsListMosaicity,
                                                     "value").getValueOf_())
                    dMosaicityValueSum += dMosaicityValue
                    nValues += 1
            xsDataFloatMosaicityEstimation = XSDataFloat()
            xsDataFloatMosaicityEstimation.setValue(dMosaicityValueSum /
                                                    nValues)
            xsDataMOSFLMOutputIndexing.setMosaicityEstimation(
                xsDataFloatMosaicityEstimation)

            xsTableRefinement = EDUtilsTable.getTableFromTables(
                xsDataDnaTables, "refinement")
            if (xsTableRefinement is None):
                strError = "MOSFLM indexing error : No solution was refined!"
                self.ERROR(strError)
                self.setFailure()
            else:
                xsListDeviations = EDUtilsTable.getListsFromTable(
                    xsTableRefinement, "deviations")[0]
                dDeviationAngular = float(
                    EDUtilsTable.getItemFromList(xsListDeviations,
                                                 "angular").getValueOf_())
                dDeviationPositional = float(
                    EDUtilsTable.getItemFromList(xsListDeviations,
                                                 "positional").getValueOf_())
                xsDataMOSFLMOutputIndexing.setDeviationAngular(
                    XSDataAngle(dDeviationAngular))
                xsDataMOSFLMOutputIndexing.setDeviationPositional(
                    XSDataLength(dDeviationPositional))
                xsListResults = EDUtilsTable.getListsFromTable(
                    xsTableRefinement, "results")[0]
                dDetectorDistance = float(
                    EDUtilsTable.getItemFromList(
                        xsListResults, "detector_distance").getValueOf_())
                xsDataMOSFLMOutputIndexing.setRefinedDistance(
                    XSDataLength(dDetectorDistance))
                xsListParameters = EDUtilsTable.getListsFromTable(
                    xsTableRefinement, "parameters")[0]
                iSpotsUsed = int(
                    EDUtilsTable.getItemFromList(xsListParameters,
                                                 "used").getValueOf_())
                iSpotsTotal = int(
                    EDUtilsTable.getItemFromList(xsListParameters,
                                                 "out_of").getValueOf_())
                xsDataMOSFLMOutputIndexing.setSpotsUsed(
                    XSDataInteger(iSpotsUsed))
                xsDataMOSFLMOutputIndexing.setSpotsTotal(
                    XSDataInteger(iSpotsTotal))

                xsTableSolutionRefinement = EDUtilsTable.getTableFromTables(
                    xsDataDnaTables, "solution_refinement")
                xsListParameters = EDUtilsTable.getListsFromTable(
                    xsTableSolutionRefinement, "selection")[0]
                iSelectedSolutionNumber = int(
                    EDUtilsTable.getItemFromList(xsListParameters,
                                                 "number").getValueOf_())
                xsDataMOSFLMOutputIndexing.setSelectedSolutionNumber(
                    XSDataInteger(iSelectedSolutionNumber))
                strSelectedSolutionSpaceGroup = (EDUtilsTable.getItemFromList(
                    xsListParameters, "spacegroup").getValueOf_())
                xsDataMOSFLMOutputIndexing.setSelectedSolutionSpaceGroup(
                    XSDataString(strSelectedSolutionSpaceGroup))
                iSelectedSolutionSpaceGroupNumber = int(
                    EDUtilsTable.getItemFromList(
                        xsListParameters, "spacegroup_number").getValueOf_())
                xsDataMOSFLMOutputIndexing.setSelectedSolutionSpaceGroupNumber(
                    XSDataInteger(iSelectedSolutionSpaceGroupNumber))

                xsTableAutoIndexSolutions = EDUtilsTable.getTableFromTables(
                    xsDataDnaTables, "autoindex_solutions")
                xsListsSolution = xsTableAutoIndexSolutions.getList()
                for xsListSolution in xsListsSolution:
                    xsDataMOSFLMIndexingSolution = XSDataMOSFLMIndexingSolution(
                    )
                    xsDataCell = XSDataCell()
                    iSolutionNumber = int(
                        EDUtilsTable.getItemFromList(xsListSolution,
                                                     "index").getValueOf_())
                    xsDataMOSFLMIndexingSolution.setIndex(
                        XSDataInteger(iSolutionNumber))
                    iPenalty = int(
                        EDUtilsTable.getItemFromList(xsListSolution,
                                                     "penalty").getValueOf_())
                    xsDataMOSFLMIndexingSolution.setPenalty(
                        XSDataInteger(iPenalty))
                    strLattice = (EDUtilsTable.getItemFromList(
                        xsListSolution, "lattice").getValueOf_())
                    xsDataMOSFLMIndexingSolution.setLattice(
                        XSDataString(strLattice))
                    dA = float(
                        EDUtilsTable.getItemFromList(xsListSolution,
                                                     "a").getValueOf_())
                    xsDataCell.setLength_a(XSDataLength(dA))
                    dB = float(
                        EDUtilsTable.getItemFromList(xsListSolution,
                                                     "b").getValueOf_())
                    xsDataCell.setLength_b(XSDataLength(dB))
                    dC = float(
                        EDUtilsTable.getItemFromList(xsListSolution,
                                                     "c").getValueOf_())
                    xsDataCell.setLength_c(XSDataLength(dC))
                    dAlpha = float(
                        EDUtilsTable.getItemFromList(xsListSolution,
                                                     "alpha").getValueOf_())
                    xsDataCell.setAngle_alpha(XSDataAngle(dAlpha))
                    dBeta = float(
                        EDUtilsTable.getItemFromList(xsListSolution,
                                                     "beta").getValueOf_())
                    xsDataCell.setAngle_beta(XSDataAngle(dBeta))
                    dGamma = float(
                        EDUtilsTable.getItemFromList(xsListSolution,
                                                     "gamma").getValueOf_())
                    xsDataCell.setAngle_gamma(XSDataAngle(dGamma))
                    xsDataMOSFLMIndexingSolution.setCell(xsDataCell)
                    xsDataMOSFLMOutputIndexing.addPossibleSolutions(
                        xsDataMOSFLMIndexingSolution)

                xsTableBeamRefinement = EDUtilsTable.getTableFromTables(
                    xsDataDnaTables, "beam_refinement")
                xsDataMOSFLMBeamPositionRefined = XSDataMOSFLMBeamPosition()
                xsDataMOSFLMBeamPositionShift = XSDataMOSFLMBeamPosition()
                dInitialBeamX = 0.0
                dInitialBeamY = 0.0
                dRefinedBeamX = 0.0
                dRefinedBeamY = 0.0
                xsListInitialBeam = EDUtilsTable.getListsFromTable(
                    xsTableBeamRefinement, "initial_beam")[0]
                fInitialBeamPositionX = float(
                    EDUtilsTable.getItemFromList(xsListInitialBeam,
                                                 "x").getValueOf_())
                fInitialBeamPositionY = float(
                    EDUtilsTable.getItemFromList(xsListInitialBeam,
                                                 "y").getValueOf_())
                xsListRefinedBeam = EDUtilsTable.getListsFromTable(
                    xsTableBeamRefinement, "refined_beam")[0]
                fRefinedBeamPositionX = float(
                    EDUtilsTable.getItemFromList(xsListRefinedBeam,
                                                 "x").getValueOf_())
                fRefinedBeamPositionY = float(
                    EDUtilsTable.getItemFromList(xsListRefinedBeam,
                                                 "y").getValueOf_())
                xsDataMOSFLMBeamPositionRefined.setX(
                    XSDataLength(fRefinedBeamPositionX))
                xsDataMOSFLMBeamPositionRefined.setY(
                    XSDataLength(fRefinedBeamPositionY))
                xsDataMOSFLMBeamPositionShift.setX(
                    XSDataLength(fInitialBeamPositionX -
                                 fRefinedBeamPositionX))
                xsDataMOSFLMBeamPositionShift.setY(
                    XSDataLength(fInitialBeamPositionY -
                                 fRefinedBeamPositionY))
                xsDataMOSFLMOutputIndexing.setRefinedBeam(
                    xsDataMOSFLMBeamPositionRefined)
                xsDataMOSFLMOutputIndexing.setBeamShift(
                    xsDataMOSFLMBeamPositionShift)
        # Path to log file
        xsDataMOSFLMOutputIndexing.setPathToLogFile(
            XSDataFile(
                XSDataString(
                    os.path.join(self.getWorkingDirectory(),
                                 self.getScriptLogFileName()))))
        return xsDataMOSFLMOutputIndexing
    def getReferenceDataMOSFLMNewmat(self):

        xsDataMOSFLMNewmat = XSDataMOSFLMNewmat()

        XSDataMatrixDoubleA = XSDataMatrixDouble()
        XSDataMatrixDoubleA.setM11(-0.00826416)
        XSDataMatrixDoubleA.setM12(0.00885073)
        XSDataMatrixDoubleA.setM13(0.00937013)
        XSDataMatrixDoubleA.setM21(0.00126554)
        XSDataMatrixDoubleA.setM22(0.01251971)
        XSDataMatrixDoubleA.setM23(-0.00845341)
        XSDataMatrixDoubleA.setM31(-0.01484956)
        XSDataMatrixDoubleA.setM32(-0.00385867)
        XSDataMatrixDoubleA.setM33(-0.00593515)
        xsDataMOSFLMNewmat.setAMatrix(XSDataMatrixDoubleA)

        xsDataMOSFLMMissettingsAngles = XSDataMOSFLMMissettingsAngles()
        xsDataMOSFLMMissettingsAngles.setPhix(XSDataAngle(1.000))
        xsDataMOSFLMMissettingsAngles.setPhiy(XSDataAngle(2.000))
        xsDataMOSFLMMissettingsAngles.setPhiz(XSDataAngle(3.000))
        xsDataMOSFLMNewmat.setMissettingAngles(xsDataMOSFLMMissettingsAngles)

        XSDataMatrixDoubleU = XSDataMatrixDouble()
        XSDataMatrixDoubleU.setM11(-0.4849475)
        XSDataMatrixDoubleU.setM12(0.5598049)
        XSDataMatrixDoubleU.setM13(0.6718960)
        XSDataMatrixDoubleU.setM21(0.0742629)
        XSDataMatrixDoubleU.setM22(0.7918670)
        XSDataMatrixDoubleU.setM23(-0.6061614)
        XSDataMatrixDoubleU.setM31(-0.8713845)
        XSDataMatrixDoubleU.setM32(-0.2440595)
        XSDataMatrixDoubleU.setM33(-0.4255866)
        xsDataMOSFLMNewmat.setUMatrix(XSDataMatrixDoubleU)

        xsDataCellRefined = XSDataCell()
        xsDataCellRefined.setLength_a(XSDataLength(54.8079))
        xsDataCellRefined.setLength_b(XSDataLength(59.0751))
        xsDataCellRefined.setLength_c(XSDataLength(66.9736))
        xsDataCellRefined.setAngle_alpha(XSDataAngle(91.0000))
        xsDataCellRefined.setAngle_beta(XSDataAngle(92.0000))
        xsDataCellRefined.setAngle_gamma(XSDataAngle(93.0000))
        xsDataMOSFLMNewmat.setRefinedCell(xsDataCellRefined)

        return xsDataMOSFLMNewmat