pyprocar.utilsprocar package¶
Submodules¶
pyprocar.utilsprocar.scriptFermi3D module¶
pyprocar.utilsprocar.utilsprocar module¶
-
class
pyprocar.utilsprocar.utilsprocar.
UtilsProcar
(loglevel=30)[source]¶ Bases:
object
This class store handy methods that do not fit any other place
members:
- -Openfile: Tries to open a File, it has suitable values for PROCARs
and can handle gzipped files
- -MergeFiles: concatenate two or more PROCAR files taking care of
metadata and kpoint indexes. Useful for splitted bandstructures calculation.
-FermiOutcar: it greps the Fermi Energy from a given outcar file.
-RecLatOutcar: it greps the reciprocal lattice from the outcar.
Methods
FermiOutcar
(filename)Just finds all E-fermi fields in the outcar file and keeps the last one (if more than one found).
MergeFiles
(inFiles, outFile[, gzipOut])Concatenate two or more PROCAR files.
OpenFile
([FileName])Tries to open a File, it has suitable values for PROCAR and can handle gzipped files
ProcarRepair
(infilename, outfilename)It Tries to repair some stupid problems due the stupid fixed format of the stupid fortran.
RecLatOutcar
(filename)Finds and return the reciprocal lattice vectors, if more than one set present, it return just the last one.
-
FermiOutcar
(filename)[source]¶ Just finds all E-fermi fields in the outcar file and keeps the last one (if more than one found).
Args: -filename: the file name of the outcar to be readed
-
MergeFiles
(inFiles, outFile, gzipOut=False)[source]¶ Concatenate two or more PROCAR files. This methods takes care of the k-indexes.
Useful when large number of K points have been calculated in different PROCARs.
Args: -inFiles: an iterable with files to be concatenated
-outFile: a string with the outfile name.
-gzipOut: whether gzip or not the outout file.
Warning: spin polarized case is not Ok!
-
OpenFile
(FileName=None)[source]¶ Tries to open a File, it has suitable values for PROCAR and can handle gzipped files
Example:
>>> foo = UtilsProcar.Openfile() Tries to open "PROCAR", then "PROCAR.gz"
>>> foo = UtilsProcar.Openfile("../bar") Tries to open "../bar". If it is a directory, it will try to open "../bar/PROCAR" and if fails again "../bar/PROCAR.gz"
>>> foo = UtilsProcar.Openfile("PROCAR-spd.gz") Tries to open a gzipped file "PROCAR-spd.gz"
If unable to open a file, it raises a “IOError” exception.
-
ProcarRepair
(infilename, outfilename)[source]¶ It Tries to repair some stupid problems due the stupid fixed format of the stupid fortran.
Up to now it only separes k-points as the following: k-point 61 : 0.00000000-0.50000000 0.00000000 … to k-point 61 : 0.00000000 -0.50000000 0.00000000 …
But as I found new stupid errors they should be fixed here.