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 = MdfPlotter() 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)
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 = MdfPlotter() # 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)
def get_mdf_plotter(self): from abipy.electrons.bse import MdfPlotter plotter = MdfPlotter() for label, mdf in self: plotter.add_mdf(label, mdf.exc_mdf) return plotter