Ejemplo n.º 1
0
    def OnMdfCompare(self, event):
        """Compare multiple averaged macroscopic dielectric functions"""
        mdf_type = self.getMdfType()
        cplx_mode = self.getCplxMode()

        if mdf_type == "ALL":
            return awx.showErrorMessage(self, "ALL is not supported by Compare. Please use EXC, RPA, GWRPA")

        plotter = MDF_Plotter()
        for path, mdf_file in zip(self.mdf_filepaths, self.mdf_files_list):
            label = os.path.relpath(path)
            mdf = mdf_file.get_mdf(mdf_type)
            plotter.add_mdf(label, mdf)

        plotter.plot(cplx_mode, qpoint=None)
Ejemplo n.º 2
0
    def onCompareSpectraQ(self, event):
        """
        Compare different MDF(q) spectra (provided that we have multiple tabs in the notebook).
        This callback is executed when MdfQpointsPanel fires CompareSpectraQEvent.
        """
        qpoint = event.qpoint
        mdf_type = self.getMdfType()
        cplx_mode = self.getCplxMode()

        if mdf_type == "ALL":
            return awx.showErrorMessage(self, "ALL is not supported by Compare. Please use EXC, RPA, GWRPA")

        plotter = MDF_Plotter()
                                                                            
        # Extract the type of MDF we are interested in
        for path, mdf_file in zip(self.mdf_filepaths, self.mdf_files_list):
            label = os.path.relpath(path)
            mdf = mdf_file.get_mdf(mdf_type)
            plotter.add_mdf(label, mdf)

        plotter.plot(cplx_mode, qpoint=qpoint)