Пример #1
0
    def interpolation(self):
        """Function to interpolate data"""

        self.Q, self.I_Q = UtilityAnalysis.data_interpolation(
            self.orgQ, self.orgI_Q, self.ui.minQ.value(), self.ui.maxQ.value(),
            self.ui.interpolationPoints.value())

        self.Qbkg, self.Ibkg_Q = UtilityAnalysis.data_interpolation(
            self.orgQbkg, self.orgIbkg_Q, self.ui.minQ.value(),
            self.ui.maxQ.value(), self.ui.interpolationPoints.value())

        self.ui.rawDataPlot.canvas.ax.lines.pop(0)
        self.ui.rawDataPlot.canvas.ax.lines.pop(0)

        self.ui.rawDataPlot.canvas.ax.plot(self.Q, self.I_Q, "b", label="Data")
        self.ui.rawDataPlot.canvas.ax.legend()
        self.ui.rawDataPlot.canvas.draw()

        self.ui.rawDataPlot.canvas.ax.plot(self.Qbkg,
                                           self.Ibkg_Q,
                                           "g--",
                                           label="Bkg")
        self.ui.rawDataPlot.canvas.ax.legend()
        self.ui.rawDataPlot.canvas.draw()
Пример #2
0
    elementList = Utility.molToElemList(inputVariables["molecule"])
    elementParameters = Utility.read_parameters(
        elementList, inputVariables["elementParamsPath"])
    elementPosition = Utility.read_xyz_file(inputVariables["xyzPath"])

    Q, I_Q = Utility.read_file(inputVariables["dataFile"])
    Qbkg, Ibkg_Q = Utility.read_file(inputVariables["bkgFile"])

    # plt.plot(Q, I_Q)
    # plt.plot(Qbkg, Ibkg_Q)
    # plt.show

    #--------------------Preliminary calculation-------------------------------

    Q, I_Q = UtilityAnalysis.data_interpolation(Q, I_Q, inputVariables["minQ"],
                                                inputVariables["maxQ"],
                                                inputVariables["numPoints"])
    Qbkg, Ibkg_Q = UtilityAnalysis.data_interpolation(
        Qbkg, Ibkg_Q, inputVariables["minQ"], inputVariables["maxQ"],
        inputVariables["numPoints"])

    # plt.plot(Q, I_Q)
    # plt.plot(Qbkg, Ibkg_Q)
    # plt.show

    fe_Q, Ztot = MainFunctions.calc_eeff(elementList, Q, elementParameters)
    Iincoh_Q = MainFunctions.calc_Iincoh(elementList, Q, elementParameters)
    J_Q = MainFunctions.calc_JQ(Iincoh_Q, Ztot, fe_Q)
    Sinf = MainFunctions.calc_Sinf(elementList, fe_Q, Q, Ztot,
                                   elementParameters)
    dampingFunction = UtilityAnalysis.calc_dampingFunction(