pyprocar.procarselect package¶
Submodules¶
pyprocar.procarselect.procarselect module¶
-
class
pyprocar.procarselect.procarselect.
ProcarSelect
(ProcarData=None, deepCopy=True, loglevel=30, mode=None)[source]¶ Bases:
object
Reduces the dimensionality of the data making it uselful to plot bands.
The main data to manipulate is the projected electronic structure. Its shape original is:
spd[kpoint][band][ispin][atom][orbital].
The selection of components should be done in order, says, first “ispin”, then “atom”, and at last “orbital”.
Note: once any selection has been performed, the data itself changes. Say, if you want compare atom [0] and [1,2], you need two instances of this class.
Example to compare the bandstructure of two set of atoms >>>
Methods
selectAtoms
([value, fortran])value is a list with the values of Atoms to select.
selectIspin
([value, separate])value is a list with the values of Ispin to select.
selectOrbital
(value)value is a list with the values of orbital to select.
setData
(ProcarData[, deepCopy])The data from ProcarData is deepCopy-ed by default (ie: their elements are not modified by this class.
-
selectAtoms
(value=None, fortran=False)[source]¶ value is a list with the values of Atoms to select. The optional fortran argument indicates whether a c-like 0-based indexing (=False, default) or a fortran-like 1-based (=True) is provided in value.
Example: >>> foo = ProcarParser() >>> foo.readFile(“PROCAR”) >>> bar = ProcarSelect(foo) >>> bar.selectIspin([…]) >>> bar.selectAtoms([0,1,2]) #atom0+atom1+atom2
Note: this method should be called after select.Ispin
-
selectIspin
(value=None, separate=False)[source]¶ value is a list with the values of Ispin to select.
- UPDATE:
if separate == true, then spin = 0 corresponds to spin up and spin = 1 corresponds to spin down. If not, they give spin density and spin magnetization, respectively.
Example: >>> foo = ProcarParser() >>> foo.readFile(“PROCAR”) >>> bar = ProcarSelect(foo) >>> bar.selectIspin([0]) #just the density
-
selectOrbital
(value)[source]¶ value is a list with the values of orbital to select.
Example: >>> foo = ProcarParser() >>> foo.readFile(“PROCAR”) >>> bar = ProcarSelect(foo) >>> bar.selectIspin([…]) >>> bar.selectAtoms([…]) >>> bar.selectOrbital([-1]) #the last (tot) field
to select “p” orbitals just change the argument in the last line to [2,3,4] or as needed
Note: this method should be called after select.Ispin and select.Atoms
-
setData
(ProcarData, deepCopy=True)[source]¶ The data from ProcarData is deepCopy-ed by default (ie: their elements are not modified by this class.
Args:
- -ProcarData: is a ProcarParser instance (or anything with similar
functionality, duck typing)
-deepCopy=True: If false a shallow copy will be made (saves memory).
-