コード例 #1
0
ファイル: comparison.py プロジェクト: gmrigna/abipy
    def OnCompareButton(self, event):
        selected_files = self.panel.GetSelectedFilepaths()

        choice = self.plotter_cbox.GetValue()

        try:
            if choice == "ebands":
                plotter = ElectronBandsPlotter()

                for filepath in selected_files:
                    plotter.add_ebands_from_file(filepath)

                plotter.plot()

            elif choice == "edos":
                # Open dialog to ask the user the DOS parameters.
                dos_dialog = ElectronDosDialog(None)

                if dos_dialog.ShowModal() == wx.ID_OK:
                    p = dos_dialog.GetParams()

                    plotter = ElectronDosPlotter()

                    for filepath in selected_files:
                        plotter.add_edos_from_file(filepath, **p)

                    plotter.plot()

                dos_dialog.Destroy()

            elif choice == "mdf":
                plotter = MdfPlotter()

                for filepath in selected_files:
                    plotter.add_mdf_from_file(filepath, mdf_type="exc")

                plotter.plot()

            elif choice == "sigres":
                plotter = SigresPlotter()

                plotter.add_files(selected_files)

                plotter.plot_qpgaps()
                #plotter.plot_qpenes()

            else:
                awx.showErrorMessage(
                    self,
                    message="No function registered for choice %s" % choice)

        except Exception:
            awx.showErrorMessage(self)
コード例 #2
0
ファイル: sigresviewer.py プロジェクト: zbwang/abipy
    def OnQpEnesCompare(self, event):
        """Compare the QP energies reported in the SIGRES files."""
        # Instanciate the plotter and add the filepaths to the plotter.
        plotter = SigresPlotter()
        plotter.add_files(self.sigres_filepaths)

        # Plot the convergence of the QP energies.
        plotter.plot_qpenes(title="Convergence of QP energies", hspan=0.05)