def test_make_diele_func(test_data_files): v = Vasprun(test_data_files / "MgSe_absorption_vasprun_gamma.xml") o = Outcar(test_data_files / "MgSe_absorption_OUTCAR_gamma") actual = make_diele_func(v, o) # print(VaspBandEdgeProperties(v, o)) print(actual.diele_func_real) assert actual.energies[1] == 0.0407
def test_make_diele_func_2(test_data_files): v = Vasprun(test_data_files / "MgSe_absorption_vasprun_gamma.xml") o = Outcar(test_data_files / "MgSe_absorption_OUTCAR_gamma") actual = make_shifted_diele_func(make_diele_func(v, o), original_band_gap=1.997, shift=1.0) assert isinstance(actual.diele_func_imag[0], list) assert isinstance(actual.diele_func_imag[0][0], float)
def plot_absorption(args: Namespace): diele_func_data = make_diele_func(Vasprun(args.vasprun), Outcar(args.outcar), use_vasp_real=not args.calc_kk, ita=args.ita) plotter = AbsorptionCoeffMplPlotter(diele_func_data, yranges=args.y_ranges) plotter.construct_plot() plotter.plt.savefig(args.filename, format="pdf")
def test_make_diele_func_calc_real(test_data_files): v = Vasprun(test_data_files / "MgSe_absorption_vasprun_gamma.xml") o = Outcar(test_data_files / "MgSe_absorption_OUTCAR_gamma") actual = make_diele_func(v, o, use_vasp_real=False) print(actual.diele_func_real) assert actual.energies[1] == 0.0407
def actual_diele_func_data(test_data_files): v = Vasprun(test_data_files / "MgSe_absorption_vasprun.xml") o = Outcar(test_data_files / "MgSe_absorption_OUTCAR") return make_diele_func(v, o)