当前位置: 首页>>代码示例>>Python>>正文


Python DosPlotter.show方法代码示例

本文整理汇总了Python中pymatgen.electronic_structure.plotter.DosPlotter.show方法的典型用法代码示例。如果您正苦于以下问题:Python DosPlotter.show方法的具体用法?Python DosPlotter.show怎么用?Python DosPlotter.show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pymatgen.electronic_structure.plotter.DosPlotter的用法示例。


在下文中一共展示了DosPlotter.show方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: plot_dos

# 需要导入模块: from pymatgen.electronic_structure.plotter import DosPlotter [as 别名]
# 或者: from pymatgen.electronic_structure.plotter.DosPlotter import show [as 别名]
def plot_dos(args):
    v = Vasprun(args.filename[0])
    dos = v.complete_dos

    all_dos = OrderedDict()
    all_dos["Total"] = dos

    structure = v.final_structure

    if args.site:
        for i in range(len(structure)):
            site = structure[i]
            all_dos["Site " + str(i) + " " + site.specie.symbol] = \
                dos.get_site_dos(site)

    if args.element:
        syms = [tok.strip() for tok in args.element[0].split(",")]
        all_dos = {}
        for el, dos in dos.get_element_dos().items():
            if el.symbol in syms:
                all_dos[el] = dos
    if args.orbital:
        all_dos = dos.get_spd_dos()

    plotter = DosPlotter()
    plotter.add_dos_dict(all_dos)
    if args.file:
        plotter.get_plot().savefig(args.file[0])
    else:
        plotter.show()
开发者ID:czhengsci,项目名称:tscccommand,代码行数:32,代码来源:pmg_example.py

示例2: main

# 需要导入模块: from pymatgen.electronic_structure.plotter import DosPlotter [as 别名]
# 或者: from pymatgen.electronic_structure.plotter.DosPlotter import show [as 别名]
def main():
    parser = argparse.ArgumentParser(description='''Convenient DOS Plotter for Feff runs.
    Author: Alan Dozier
    Version: 1.0
    Last updated: April, 2013''')

    parser.add_argument('filename', metavar='filename', type=str, nargs=1,
                        help='ldos%% file set to plot')
    parser.add_argument('filename1', metavar='filename1', type=str, nargs=1,
                        help='feff.inp input file ')
    parser.add_argument('-s', '--site', dest='site', action='store_const',
                        const=True, help='plot site projected DOS')
    parser.add_argument('-e', '--element', dest='element', action='store_const',
                        const=True, help='plot element projected DOS')
    parser.add_argument('-o', '--orbital', dest="orbital", action='store_const',
                        const=True, help='plot orbital projected DOS')

    args = parser.parse_args()
    f = LDos.from_file(args.filename1[0], args.filename[0])
    dos = f.complete_dos

    all_dos = OrderedDict()
    all_dos['Total'] = dos

    structure = f.complete_dos.structure

    if args.site:
        for i, site in enumerate(structure):
            all_dos['Site ' + str(i) + " " + site.specie.symbol] = \
                dos.get_site_dos(site)
    if args.element:
        all_dos.update(dos.get_element_dos())
    if args.orbital:
        all_dos.update(dos.get_spd_dos())

    plotter = DosPlotter()
    plotter.add_dos_dict(all_dos)
    plotter.show()
开发者ID:ExpHP,项目名称:pymatgen,代码行数:40,代码来源:feff_plot_dos.py

示例3: main

# 需要导入模块: from pymatgen.electronic_structure.plotter import DosPlotter [as 别名]
# 或者: from pymatgen.electronic_structure.plotter.DosPlotter import show [as 别名]
def main():
    parser = argparse.ArgumentParser(
        description="""Convenient DOS Plotter for Feff runs.
    Author: Alan Dozier
    Version: 1.0
    Last updated: April, 2013"""
    )

    parser.add_argument("filename", metavar="filename", type=str, nargs=1, help="ldos%% file set to plot")
    parser.add_argument("filename1", metavar="filename1", type=str, nargs=1, help="feff.inp input file ")
    parser.add_argument("-s", "--site", dest="site", action="store_const", const=True, help="plot site projected DOS")
    parser.add_argument(
        "-e", "--element", dest="element", action="store_const", const=True, help="plot element projected DOS"
    )
    parser.add_argument(
        "-o", "--orbital", dest="orbital", action="store_const", const=True, help="plot orbital projected DOS"
    )

    args = parser.parse_args()
    f = LDos.from_file(args.filename1[0], args.filename[0])
    dos = f.complete_dos

    all_dos = OrderedDict()
    all_dos["Total"] = dos

    structure = f.complete_dos.structure

    if args.site:
        for i, site in enumerate(structure):
            all_dos["Site " + str(i) + " " + site.specie.symbol] = dos.get_site_dos(site)
    if args.element:
        all_dos.update(dos.get_element_dos())
    if args.orbital:
        all_dos.update(dos.get_spd_dos())

    plotter = DosPlotter()
    plotter.add_dos_dict(all_dos)
    plotter.show()
开发者ID:shyamd,项目名称:pymatgen,代码行数:40,代码来源:feff_plot_dos.py

示例4: OrderedDict

# 需要导入模块: from pymatgen.electronic_structure.plotter import DosPlotter [as 别名]
# 或者: from pymatgen.electronic_structure.plotter.DosPlotter import show [as 别名]
                    help='feff.inp input file ')
parser.add_argument('-s', '--site', dest='site', action='store_const',
                    const=True, help='plot site projected DOS')
parser.add_argument('-e', '--element', dest='element', action='store_const',
                    const=True, help='plot element projected DOS')
parser.add_argument('-o', '--orbital', dest="orbital", action='store_const',
                    const=True, help='plot orbital projected DOS')

args = parser.parse_args()
f = FeffLdos.from_file(args.filename1[0], args.filename[0])
dos = f.complete_dos

all_dos = OrderedDict()
all_dos['Total'] = dos

structure = f.complete_dos.structure

if args.site:
    for i in xrange(len(structure)):
        site = structure[i]
        all_dos['Site ' + str(i) + " " + site.specie.symbol] = \
            dos.get_site_dos(site)
if args.element:
    all_dos.update(dos.get_element_dos())
if args.orbital:
    all_dos.update(dos.get_spd_dos())

plotter = DosPlotter()
plotter.add_dos_dict(all_dos)
plotter.show()
开发者ID:thuwangming,项目名称:pymatgen,代码行数:32,代码来源:feff_plot_dos.py


注:本文中的pymatgen.electronic_structure.plotter.DosPlotter.show方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。