Skip to content

Commit

Permalink
Switched behavior to allow qe and elk to automatically shift by fermi
Browse files Browse the repository at this point in the history
  • Loading branch information
lllangWV committed Jul 24, 2024
1 parent 595d3dc commit d1ee072
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pyprocar/scripts/scriptBandStructure2DHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ def __init__(self,
parser = io.Parser(code = code, dir = dirname)
self.ebs = parser.ebs

codes_with_scf_fermi = ['qe', 'elk']
if code in codes_with_scf_fermi and fermi is None:
fermi = self.ebs.efermi
if fermi is not None:
self.ebs.bands -= fermi
self.ebs.bands += fermi_shift
Expand Down
3 changes: 3 additions & 0 deletions pyprocar/scripts/scriptBandsplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ def bandsplot(
structure = parser.structure
kpath = parser.kpath

codes_with_scf_fermi = ['qe', 'elk']
if code in codes_with_scf_fermi and fermi is None:
fermi = ebs.efermi
if fermi is not None:
ebs.bands -= fermi
ebs.bands += fermi_shift
Expand Down
3 changes: 3 additions & 0 deletions pyprocar/scripts/scriptDosplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,9 @@ def dosplot(
dos = parser.dos
structure = parser.structure

codes_with_scf_fermi = ['qe', 'elk']
if code in codes_with_scf_fermi and fermi is None:
fermi = dos.efermi
if fermi is not None:
dos.energies -= fermi
dos.energies += fermi_shift
Expand Down
3 changes: 3 additions & 0 deletions pyprocar/scripts/scriptFermi2D.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ def fermi2D(
ebs = parser.ebs
structure = parser.structure

codes_with_scf_fermi = ['qe', 'elk']
if code in codes_with_scf_fermi and fermi is None:
fermi = ebs.efermi
if fermi is not None:
ebs.bands -= fermi
ebs.bands += fermi_shift
Expand Down

0 comments on commit d1ee072

Please sign in to comment.