pyprocar icon indicating copy to clipboard operation
pyprocar copied to clipboard

Inconsistent PDOS data in plotted figure and data file & export_data_file error

Open good-mood-everyday opened this issue 3 months ago • 2 comments

Dear developer, I found that the data in my plot from pyprocar is different from the data I extracted, and there's error when i use export_data_file in dosplot to extract data. The relevant files and figures are attached below.

pdos problem.zip

So I want to extract the DOS data at fermi energy. I used export_data_file='./dos_data.dat' to get the data, but it reports the following error:

Traceback (most recent call last):
  File "./plot_dos-atom-projection.py", line 10, in <module>
    pyprocar.dosplot(code='vasp',
  File "xxx/pyprocar/scripts/scriptDosplot.py", line 473, in dosplot
    file_basename, file_type = export_data_file.split(".")
ValueError: too many values to unpack (expected 2)

The relevant pyprocar script is following:

fig,ax = pyprocar.dosplot(code='vasp',
                          dirname='./',
                          mode='overlay_orbitals',
                          fermi=fermi,
                          elimit=[-2,2],
                          atoms=[5,6],
                           .....
                          export_data_file='./dos_data.dat')

Then I tried to write my own script (called open_pkl_file attached) to obtain data from the dos.pkl file. So in the data file extracted (pdos_data pyprocar.dat), Zr DOS value at $E_F$ is about 0.626. But in the plot, the Zr PDOS value is about 1. Because I'm not sure if my script to read data is 100% correct, I used vaspkit to obtain PDOS also to double check, and got the same value 0.626.

This inconsistency is present for all elements, but there's no problem with total DOS.

good-mood-everyday avatar Sep 08 '25 22:09 good-mood-everyday

Hey,

I just want to let you know this is on my to-do list. I will try to get to it as soon as possible. Hopefully today, schedule be willing.

lllangWV avatar Sep 10 '25 13:09 lllangWV

Dear Logan, I want to give an update there that the error of export_data_file is solved by replacing single quote ' by doubled ". I don't know why single quote works for other variables such as mode and code. But using double quote may always avoid such kind of error.

But I'm still not sure about the inconsistency. The data extracted indeed matches the plot (about 1.05), but it's different from data from both vaspkit and dos.pkl file (0.626). I'm aware that sum of PDOS is different from Total DOS, but I think this is unrelated to inconsistency here.

good-mood-everyday avatar Sep 13 '25 18:09 good-mood-everyday