本文整理汇总了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()
示例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()
示例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()
示例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()