def save_plot_band_structure(self, filename, img_format="eps", units="thz", ylim=None): plotter = PhononBSPlotter(bs=self.phonon_band_structure_pymatgen) plotter.save_plot(filename, img_format=img_format, units=units, ylim=ylim)
def process_item(self, item): mp_id = item['mp-id'] self.logger.debug("Processing {}".format(mp_id)) decoder = MontyDecoder() ph_bs = decoder.process_decoded(item['ph_bs']) web_doc = ph_bs.as_phononwebsite() plotter = PhononBSPlotter(ph_bs) ylim = (0, max(py_.flatten_deep(plotter.bs_plot_data()['frequency']))) filelike = io.BytesIO() plotter.save_plot(filelike, ylim=ylim, img_format="png") image = Binary(filelike.getvalue()) filelike.close() return dict(mp_id=mp_id, web_doc=web_doc, image=image)
def plot_phonon_bands(self, filename = None, ylim=None, units='thz'): bs = get_ph_bs_symm_line(os.path.join(self.wd, self.dfpt_folder+'/band.yaml')) plotter = PhononBSPlotter(bs) if filename==None: filename = os.path.join(self.wd, self.dfpt_folder+'/'+self.kpath_name+'.eps') plotter.save_plot(filename, ylim=ylim, units=units)