• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

materialsproject / pymatgen / 3968792566

pending completion
3968792566

push

github

Shyue Ping Ong
Merge branch 'master' of github.com:materialsproject/pymatgen

600 of 600 new or added lines in 370 files covered. (100.0%)

80392 of 102009 relevant lines covered (78.81%)

0.79 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/pymatgen/cli/feff_plot_dos.py
1
#!/usr/bin/env python
2
# Copyright (c) Pymatgen Development Team.
3
# Distributed under the terms of the MIT License.
4

5
"""
×
6
Script to plot density of states (DOS) generated by an FEFF run
7
either by site, element, or orbital
8
"""
9

10
from __future__ import annotations
×
11

12
__author__ = "Alan Dozier"
×
13
__credits__ = "Anubhav Jain, Shyue Ping Ong"
×
14
__copyright__ = "Copyright 2012, The Materials Project"
×
15
__version__ = "1.0"
×
16
__maintainer__ = "Alan Dozier"
×
17
__email__ = "adozier@uky.edu"
×
18
__date__ = "April 7, 2012"
×
19

20
import argparse
×
21

22
from pymatgen.electronic_structure.plotter import DosPlotter
×
23
from pymatgen.io.feff.outputs import LDos
×
24

25

26
def main():
×
27
    """
28
    Main function.
29
    """
30
    parser = argparse.ArgumentParser(
×
31
        description="""Convenient DOS Plotter for Feff runs.
32
    Author: Alan Dozier
33
    Version: 1.0
34
    Last updated: April, 2013"""
35
    )
36

37
    parser.add_argument(
×
38
        "filename",
39
        metavar="filename",
40
        type=str,
41
        nargs=1,
42
        help="ldos%% file set to plot",
43
    )
44
    parser.add_argument("filename1", metavar="filename1", type=str, nargs=1, help="feff.inp input file ")
×
45
    parser.add_argument(
×
46
        "-s",
47
        "--site",
48
        dest="site",
49
        action="store_const",
50
        const=True,
51
        help="plot site projected DOS",
52
    )
53
    parser.add_argument(
×
54
        "-e",
55
        "--element",
56
        dest="element",
57
        action="store_const",
58
        const=True,
59
        help="plot element projected DOS",
60
    )
61
    parser.add_argument(
×
62
        "-o",
63
        "--orbital",
64
        dest="orbital",
65
        action="store_const",
66
        const=True,
67
        help="plot orbital projected DOS",
68
    )
69

70
    args = parser.parse_args()
×
71
    f = LDos.from_file(args.filename1[0], args.filename[0])
×
72
    dos = f.complete_dos
×
73

74
    all_dos = {}
×
75
    all_dos["Total"] = dos
×
76

77
    structure = f.complete_dos.structure
×
78

79
    if args.site:
×
80
        for i, site in enumerate(structure):
×
81
            all_dos[f"Site {i} {site.specie.symbol}"] = dos.get_site_dos(site)
×
82
    if args.element:
×
83
        all_dos.update(dos.get_element_dos())
×
84
    if args.orbital:
×
85
        all_dos.update(dos.get_spd_dos())
×
86

87
    plotter = DosPlotter()
×
88
    plotter.add_dos_dict(all_dos)
×
89
    plotter.show()
×
90

91

92
if __name__ == "__main__":
×
93
    main()
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc