pyprocar.procarparser package¶
Submodules¶
pyprocar.procarparser.procarparser module¶
-
class
pyprocar.procarparser.procarparser.
ProcarParser
(loglevel=30)[source]¶ Bases:
object
Parses a PROCAR file and store it in memory. It only deals with PROCAR files, that means no Fermi energy (UtilsProcar.FermiOutcar can help), and the reciprocal vectors should be supplied (if used, see UtilsProcar class).
Members:
- __init__(self, loglevel): The setup the variables internally, loglevel
sets the verbosity level ie: loglevel=logging.DEBUG for debugging. Its default is logging.WARNING
- readFile(self, procar=None, permissive=False, recLattice=None):
The only method of the API it load the file completely.
Arguments:
- procar=None: name of the PROCAR file, can be a gzipped file (the
extension is no required). The default covers a wide range of obvious alternatives.
- permissive=False: Set to True if the PROCAR file has problems reading
- the Kpoints (stupid Fortran), but in that case the
Kpoints mesh will be discarded. Future updates could allow it to handle other formating/corruption issues.
- `recLattice`=None: Reciprical Vectors, you want to provide them since not
all the paths on the BZ are the same.
Don’t use the other methods beggining with underscores “_”
Example: To read a PROCAR or PROCAR.gz file: >>> foo = ProcarParser() >>> foo.readFile()
To include the reciprocal vectors, and file name MyFirstPROCAR >>> outcarparser = UtilsProcar() >>> recLat = outcarparser.RecLatOutcar(args.outcar) >>> foo = ProcarParser() >>> foo.readFile(“MyFirstPROCAR”, recLat=recLat)
- Attributes
nspin
number of spin, default is 1.
- spd_orb
Methods
readFile
([procar, phase, permissive, recLattice])Reads and parses the whole PROCAR file.
readFile2
([procar, phase, permissive, …])Read file in a line by line manner.
-
property
nspin
¶ number of spin, default is 1.
-
readFile
(procar=None, phase=False, permissive=False, recLattice=None)[source]¶ Reads and parses the whole PROCAR file. This method is a sort of metamethod: it opens the file, reads the meta data and call the respective functions for parsing kpoints, bands, and projected data.
Args:
- -procar: The file name, if None or a directory, a suitable set
of defaults will be used. Default=None
- -permissive: turn on (or off) some features to deal with badly
written PROCAR files (stupid fortran), up to now just ignores the kpoints coordinates, which -as side effect- prevent he rigth space between kpoints. Default=False (off)
- -recLattice: a 3x3 array containing the reciprocal vectors, to
change the Kpoints from rec. coordinates to cartesians. Rarely given by hand, see UtilsProcar.RecLatProcar. If given, the kpoints will be converted from direct coordinates to cartesian ones. Default=None
-
readFile2
(procar=None, phase=False, permissive=False, recLattice=None, ispin=None)[source]¶ Read file in a line by line manner. Only used when the phase factor is in procar. (for vasp, lorbit=12)
-
property
spd_orb
¶