TABLE OF CONTENTS
::pwtk::pdos_plot
SYNOPSIS
proc ::pwtk::pdos_plot {args} {
USAGE
pdos_plot ?-e E_FERMI|PWO_FILE? ?-xr XMIN:XMAX? ?-yr YMIN:YMAX? ?-yf YFORMAT? ?-lm LEFT_MARGIN? \ ?-t TERM? ?-s PX,PY? ?-o ORIENT? ?-v? pdosFileOrbitalL head
DESCRIPTION
Visualize the specified PDOS components as a "single-plot" with aid of Gnuplot.
ARGUMENTS
- pdosFileOrbitalL -- list of projwfc.x PDOS files and the corresponding orbital-expressions (see below)
- head -- head for the output generated $head.gp and $head.eps files
The structure of the pdosFileOrbitalL list is the following:
set pdosFileOrbitalL { pdosFile1 orbitalExpression1 pdosFile2 orbitalExpression2 pdosFile3 orbitalExpression3 ... ... }
EXAMPLE
set pdosFileOrbitalL { pdosFile1 {px + py - 2*pz} pdosFile2 {dxy + dxz + dyz - dx2-y2 - dz2} pdosFile3 px }
EXPLANATION
With the above example, a plot is generated for each {file orbitalExpression} pair, implying that three PDOSes are plotted: the first corresponds to px+py-2*pz orbital combination, the second to specified combination of d orbitals, and the third to the px orbital.
THE SYNTAX OF ORBITAL EXPRESSIONS
Orbital expressions are simple mathematical expressions involving orbital labels, defined in the ::pwtk::obitalIndex array (i.e. ldos, s, px,py,pz, dxy,dxz,dxy,dx2y2,dz2), where ldos stands for the sum of all components present in the PDOS file.
In addition to orbital labels, also group-orbitals can be used as defined in the ::pwtk::obitalGroup array. New group-orbitals can be defined with the ::pwtk::orbitalGroup command.
OPTIONS
- -e VALUE ... Fermi energy (either a floating-point number or a pw.x output file from where to grep the Fermi energy)
- -xr RANGE ... X-range for plots specified as XMIN:XMAX (where XMIN and XMAX are numbers)
- -yr RANGE ... Y-range for plots specified as YMIN:YMAX
- -yf format ... format for the Y-axis numbers (in C syntax)
- -lm MARGIN ... left-margin for PDOS plots (more digits on Y-axis require wider left-margin)
- -t TERM ... terminal to plot to (default = eps), possible terminals are those returned by ::pwtk::gp::pwtk_terminals (e.g., file-terminals: eps, pdf, svg, png; window-terminals: qt, wxt, x11).
- -s PX,PY ... terminal size, specified as size-x,size-y in pixels (default = 1200,800); ignored for EPS
- -o ORIENT ... page orientation for EPS (default = portrait); if -s is specified, this option is ignored
- -v ... visualize the generated plot (for file terminals)
Note that options are optional and any number of them can be specified.
RETURN VALUE
Filename of the created image (for file terminals) or the empty string (for window terminals).
SOURCE
set xdos PDOS set mode single printTitle "$xdos plotting" xdosParseOptions_ xdosGnuplotOptions_ # make a PDOS plot for each list element in $pdosLL # # filledcurves # set lt 1 foreach {pdos orbExpr} $pdosLL { set kres [pdos_kresolved $pdos] set spin [pdos_spin $pdos] set Ei [expr 1 + $kres] set using [gp_using_ $kres $spin $orbExpr up_i_] append plot " '$pdos' u (\$$Ei-Efermi):(\$$Ei-Efermi <= 0.0 ? $using : 0/0) not w filledcurve y1=0.0 lt $lt, \\\n" if { $spin } { set using [gp_using_ $kres $spin $orbExpr dw_i_] append plot " '$pdos' u (\$$Ei-Efermi):(\$$Ei-Efermi <= 0.0 ? -1*($using) : 0/0) not w filledcurve y1=0.0 lt $lt, \\\n" } incr lt } append plot " \\\n" # # lines # set lt 1 foreach {pdos orbExpr} $pdosLL { set kres [pdos_kresolved $pdos] set spin [pdos_spin $pdos] set Ei [expr 1 + $kres] set using [gp_using_ $kres $spin $orbExpr up_i_] set orb [regsub -all { +} $orbExpr {}]; # condensed orbital expression if { $lt > 1 } { append plot ", \\\n" } set title "$orb ($pdos)" append plot " '$pdos' u (\$$Ei-Efermi):($using) t '$title' w l lt $lt lw 2" if { $spin } { set using [gp_using_ $kres $spin $orbExpr dw_i_] append plot ", \\ '$pdos' u (\$$Ei-Efermi):(-1*($using)) not w l lt $lt lw 2" } incr lt } $gp plot $plot xdosExecGnuplot_ return $outputs }