TABLE OF CONTENTS
::pwtk::lobster::plot
SYNOPSIS
proc ::pwtk::lobster::plot {args} {
USAGE
::pwtk::lobster::plot ?-dir DIR? ?PLOTTING-OPTIONS? ?STANDARD-PLOTTING-OPTIONS? PROPERTY_INTERACTIONS_LIST ?HEAD? where PLOTTING-OPTIONS are: -xE -cohp+ -int -sumspin -fill -dt_dw DASHTYPE -ft_dw TRANSPARENCY For STANDARD-PLOTTING-OPTIONS, see: ::pwtk::plot
OPTION
- -dir DIR ... the lobster files are located in the DIR directory (i.e. DIR should be the same as used for ::pwtk::lobster_run)
PLOTTING OPTIONS
- -xE ... X-axis is the energy (default: Y-axis is the energy, i.e., traditional COOP/COHP plotting)
- -cohp+ ... plot COHP as +COHP (default = -COHP)
- -int ... plot also the integrated COHP, COOP...
- -sumspin ... plot the sum of spin-up & spin-down channels
- -fill ... use filledcurves for the COHP, COOP... plots
- -dt_dw DASHTYPE ... line dash-type specs for the spin-down channel, specified as solid_length,space_length pairs (default = 6,3)
- -ft_dw TRANSPARENCY ... filledcurve transparency factor (within [0,1]) for the spin-down channel (default = 0.25)
ARGUMENTS
- PROPERTY_INTERACTIONS_LIST ... specifies what to plot; it is a list containing the "property interactions" pairs (see below)
- HEAD ... (optional) the rootname for the plotting files
DESCRIPTION
This command plots the LOBSTER-calculated data using the following operations:
- Transformation of pertinent *CAR*.lobster files into *CAR*.dat datafiles suitable for Gnuplot plotting (the comments at the top of these *.dat files describe the contained data and their naming).
- Plotting of the specified data from the *CAR*.dat datafiles.
Which LOBSTER-calculated data to plot is specified with the PROPERTY_INTERACTIONS_LIST argument, which is a list consisting of the "property interactionList" pairs, where:
- "property" is the property to plot; its name stems from the rootname of the *CAR*.lobster or *CAR*.dat file (e.g., DOS, COOP, COHP, COBI, DOS.LSO, COHP.LCFO). For DOS plots, atom and orbital projected DOSes can be plotted by adding suffixes to the DOS string (see below).
- "interactionList" is the list of COXX interactions or PDOS components to plot. Individual interaction (component) is specified as 'iX', where X is the interger. Interaction can also be specified with a simple algebraic expression, e.g.:
(i1+i2+i3)/3.0+i4
Here is the PROPERTY_INTERACTIONS_LIST example:
set PROPERTY_INTERACTIONS_LIST { COHP {i0 (i1+i2+i3)/3.0} COOP {i0 (i1+i2+i3)/3.0} }
With such a specification, two COHP curves and two COOP curves would be plotted in a single plot with the first curve corresponding to 'i0' and the second to '(i1+i2+i3)/3.0'.
The meaning of the 'iX' strings is explained in the header of the transformed *CAR*.dat file (this transformation can also be achieved manually with the ::pwtk::lobster::datafy command). Here are two examples:
* header of the COHPCAR.dat file:
# ESCALE ; pCOHP file generated by LOBSTER. Energy is shifted such that the Fermi level lies at 0 eV. # non-shifted Emin = 3.10273e+00 eV, Emax = 1.91529e+01 eV, Efermi = 1.31341e+01 eV; npoints = 321 # nspin = 2 # number of interactions = 4 (including the Average) # iX indices of COHP interactions: # i0 = Average # i1 = No.1:Fe1->Ni2(2.513764596130672) # i2 = No.2:Fe1->Ni3(2.513764596130672) # i3 = No.3:Fe1->Ni4(2.513764596130672) * header of the DOSCAR.orbatom1.dat file:
# Projected DOS to atom 1 (Z= 26): 4s 4p_y 4p_z 4p_x 3d_xy 3d_yz 3d_z^2 3d_xz 3d_x^2-y^2 # Energy is shifted such that the Fermi level lies at 0 eV. # non-shifted Emin = 3.10273151 eV, Emax = 19.15288825 eV, Efermi = 13.13407947 eV; npoints = 321 # nspin = 2 # nproj = 10 (including the sum) # iX indices of DOS components: # i0 = sum # i1 = 4s # i2 = 4p_y # i3 = 4p_z # i4 = 4p_x # i5 = 3d_xy # i6 = 3d_yz # i7 = 3d_z^2 # i8 = 3d_xz # i9 = 3d_x^2-y^2
DOS plotting specifics
PWTK tranforms DOSCAR.lobster and DOSCAR.LSO.lobster files into the following *.dat files suitable for Gnuplot plotting:
- DOSCAR.dat --- file containing total DOS and total integrated DOS
- DOSCAR.atom.dat --- file containing total DOS and DOSes projected to each atom
- DOSCAR.orbatom1.dat, DOSCAR.orbatom2.dat... --- for each atom, atom-projected DOS and DOSes projected to individual atomic orbitals
while DOSCAR.LCFO.lobster is transformed into the following *.dat files:
- DOSCAR.LCFO.dat --- file containing total DOS and total integrated DOS
- DOSCAR.LCFO.frag.dat --- file containing total DOS and DOSes projected to each fragment
- DOSCAR.LCFO.orbfrag1.dat, DOSCAR.LCFO.orbfrag2.dat... --- for each fragment, fragment-projected DOS and DOSes projected to individual fragment orbitals
These files (i.e. their data) can be accessed in the PROPERTY_INTERACTIONS_LIST by specifying, e.g., DOS.atom, DOS.orbatom2, or DOS.LCFO.orbfrag1 as the property.
Summing atom and fragment DOSes
The DOSCAR.orbatomX.dat and DOSCAR.orbfragX.dat files can be summed with the ::pwtk::lobster::sumdos command. For example, to obtain the DOS projected to atoms 2, 3, 4, and 5, one can use:
::pwtk::lobster::sumdos 2-4,5 DOSCAR
which creates:
- DOSCAR.orbatom2-4,5.dat containing summed atomic and orbital PDOSes (if atoms 2-4,5 have compatible atomic orbitals)
or:
- DOSCAR.atom2-4,5.dat containing only summed atomic PDOS (if atoms 2-4,5 have incompatible atomic orbitals)
Analogously:
::pwtk::lobster::sumdos 2-4,5 DOSCAR.LCFO
creates either DOSCAR.orbfrag2-4,5.dat or DOSCAR.frag2-4,5.dat depending on whether fragments 2-4,5 have compatible fragment orbitals or not.
These files (i.e. their data) can be accessed in the PROPERTY_INTERACTIONS_LIST by specifying, e.g., DOS.atom2-4,5 or DOS.orbatom2-4,5 or DOS.LCFO.orbfrag2-4,5 as the property.
EXAMPLE
# plot two COOP and two COHP curves in a single plot, corresponding # to 'i0' and average of i1,i2,i3 interactions (i.e. (i1+i2+i3)/3.0) ::pwtk::lobster::plot -fill -xf '' { COOP {i0 (i1+i2+i3)/3.0} COHP {i0 (i1+i2+i3)/3.0} } # plot DOS projected to atom1, atom2, and the sum of atom1 and atom2 ::pwtk::lobster::plot -xE -fill -xf '' { DOS.atom i1 DOS.atom i2 DOS.atom i1+i2 } # plot DOS projected to atom1 and the sum of its sp orbitals and d orbitals ::pwtk::lobster::plot -xE -fill -xf '' { DOS.orbatom1 {i0 i1+i2+i3+i4 i5+i6+i7+i8+i9} } # N.B. to learn about the meaning of iX strings, run in the PWTK prompt: ::pwtk::lobster::datafy DOS # and look into the generated DOSCAR.orbatom1.dat file, i.e.: # i0 = sum # i1 = 4s # i2 = 4p_y # i3 = 4p_z # i4 = 4p_x # i5 = 3d_xy # i6 = 3d_yz # i7 = 3d_z^2 # i8 = 3d_xz # i9 = 3d_x^2-y^2
RETURN VALUE
Filename of the created Gnuplot plot (for file terminals) or the empty string (for window terminals).
SOURCE
printTitle "Plotting LOBSTER data" set type plot set arg1 FILE_INTERACTION_LIST xplotParseCmdline_ ::pwtk::eval_in_dir $opt(dir) { if { $opt(xE) } { ifset opt(yl) [label_ [lindex $FILE_INTERACTION_LIST 0] $opt(cohp+)] } else { ifset opt(xl) [label_ [lindex $FILE_INTERACTION_LIST 0] $opt(cohp+)] } set ax2 [expr { $opt(xE) ? "y2l" : "x2l" }] if { $opt(int) && $opt($ax2) eq {} } { set opt($ax2) "Integrated" } set font $::pwtk::gp::gp(font),[expr round(0.85*$::pwtk::gp::gp(fontSize))] set gp [::pwtk::gp::plot new -s $opt(s) $head.$opt(t)] $gp cmdlineOpts opt $gp set key "top left Left reverse samplen 1 noenhanced font '$font'" if { $opt(int) } { if { $opt(xE) } { $gp options { ytics nomirror y2tics { } } } else { $gp options { xtics nomirror x2tics { } } } } set fileL {} set datL {} $gp plot [plot_ opt fileL datL $FILE_INTERACTION_LIST] set result [::pwtk::gp::execDisplay_ $gp opt] } return $result }