PDOS
- class conquest2a.pdos.pdos_l_processor(conquest_rundir: str | Path)
- get_pdos(atom: int) None
Method which clears the data, calls
get_pdos()on theatom, andl_map()in one go.- Parameters:
atom (
int) – The atom to get the PDOS for.- Raises:
ValueError – If the chosen atom to plot does not have a pDOS file, the method will abort without doing anything.
- l_map() None
Reads and stores the columns of an \(l\)-resolved PDOS file.
- plot_pdos(atomno: int, ang_mom: int, x1: float | None, x2: float | None, y1: float | None, y2: float | None, filename: str) None
Plots the \(l\) pDOS for an atom.
- Parameters:
atomno (
int) – The atom number as defined in the coordinates.ang_mom (
int) – The angular momentum value to plot.x1 (
float | None) – Lower energy limit. IfNone, defaults to the lowest energy in the data.x2 (
float | None) – Upper energy limit. IfNone, defaults to the highest energy in the data.y1 (
float | None) – Lower y-limity2 (
float | None) – Upper y-limitfilename (
str) – Filename of plot.
- class conquest2a.pdos.pdos_lm_processor(conquest_rundir: str | Path)
- get_pdos(atom: int) None
Method which clears the data, calls
get_pdos()on theatom, andlm_map()in one go.- Parameters:
atom (
int) – The atom to get the PDOS for.- Raises:
ValueError – If the chosen atom to plot does not have a pDOS file, the method will abort without doing anything.
- lm_map() None
Reads and stores the columns of an \(lm\)-resolved PDOS file.
For every \(l\), there are \(2l + 1\) columns of PDOS. These become the keys of a dictionary and will be accessed in the form
["l,m"].The values of this dictionary will be a list of NumPy arrays, ordered first by spin-up and then spin-down.
- plot_pdos(atomnos: list[int], orbitals: list[str], x1: float | None, x2: float | None, y1: float | None, y2: float | None, filename: str) None
Plots the \(l\) pDOS for an atom.
- Parameters:
atomnos (
int) – The atom numbers as defined in the coordinates, to plot.orbitals (
list[int]) – The orbitals to plot. These are a list of the keys in the dictionary.x1 (
float | None) – Lower energy limit. IfNone, defaults to the lowest energy in the data.x2 (
float | None) – Upper energy limit. IfNone, defaults to the highest energy in the data.y1 (
float | None) – Lower y-limity2 (
float | None) – Upper y-limitfilename (
str) – Filename of plot.
- class conquest2a.pdos.pdos_processor(conquest_rundir: str | Path, lm: Literal['lm', 'l', 't'] = 't')
Initialise generic PDOS processor class.
CONQUEST can produce a
DOS.datcontaining the total DOS and the local DOS, whichlm="t"will process. To process \(l\) and \(lm\)-resolved PDOS files, initialise an instance ofpdos_l_processorandpdos_lm_processorrespectively.- Parameters:
conquest_rundir (
string | Path) – String or Path to the directory containing the PDOS files generated from CONQUEST’s PostProcessing tool.lm (
Literal["lm", "l", "t"], optional) – Determines the file-processing mode. Defaults to"t".
- get_pdos(atom: int) None
Reads in the PDOS data of a file corresponding to an atom.
CONQUEST outputs pdos filenames pf the form
AtomNNNNNNNDOS_lm.datorAtomNNNNNNNDOS_l.datwhere NNNNNNN is a zero-padded atom number (as ordered in the coordinates file). This method is modified by the childrenpdos_l_processorandpdos_lm_processorfor their purposes.- Parameters:
atom (
int) – The atom to find and read in the PDOS for.- Raises:
ValueError – If the atom chosen does not have a PDOS file associated to it.
- locate_pdos_files() list[str]
Gets the paths to all PDOS files of the right type and stores it in a list.
- Returns:
List of all paths to PDOS files.
- Return type:
list[str]
- plot_pdos(*args, **kwargs) None
Method which plots the PDOS and LDOS inside DOS.dat.
- process_block(line: str) None
Extracts blocks, which are separated by
&on its own newline, for data processing.
- process_headers(line: str) None
Processes lines in PDOS output files starting with #
- Parameters:
line (
str) – line
- resolve_path() Path
Checks whether the directory containing files exists.
- Raises:
FileNotFoundError – Raises error if directory does not exist
- Returns:
Path to the directory
- Return type:
Path