# Path: pyDFTutils/vasp/vasp_dos.py
# def plot_all_ldos(filename='DOSCAR',ispin=2,ymin=-2.0,ymax=2.0,xmin=-15.0,xmax=5.0,element_types=None, has_f=False):
#     """
#     plot the local dos of all atoms.
#     """
#     symdict=get_symdict()
# 
#     if element_types is not None:
#         atom_nums=[x for x in list(symdict.keys()) if symnum_to_sym(x) in element_types]
#     else:
#         atom_nums=list(symdict.keys())
# 
#     if ispin==2:
#         if has_f:
#             sites=['s+','p+','d+','s-','p-','d-', 'f+', 'f-']
#         else:
#             sites=['s+','p+','d+','s-','p-','d-']
#     else:
#         if has_f:
#             sites=['s','p','d','f']
#         else:
#             sites=['s','p','d']
# 
#     if not os.path.exists('LDOS'):
#         os.mkdir('LDOS')
#     for atom_num in atom_nums:
#         copyfile(filename,'LDOS/DOSCAR')
#         plotldos_group([atom_num],sites,ymin=ymin,ymax=ymax,xmin=xmin,xmax=xmax,special_location=None,output='LDOS/%s_ldos.png'%atom_num)


from pyDFTutils.vasp.vasp_dos import plot_all_ldos
import argparse
#!/usr/bin/env python

def plot_ldos():
    parser=argparse.ArgumentParser(description='Plot the local dos')
    parser.add_argument('-f','--filename',type=str,help='DOSCAR filename',default='DOSCAR')
    parser.add_argument('-n','--ispin',type=int,help='number os spins, 1 or 2',default=2)
    parser.add_argument('-o','--output',type=str,help='output dir')
    parser.add_argument('--xmin',type=float,help='xmin',default=-15.0)
    parser.add_argument('--xmax',type=float,help='xmax',default=5.0)
    parser.add_argument('--ymin',type=float,help='ymin',default=-2.0)
    parser.add_argument('--ymax',type=float,help='xmax',default=2.0)

    args=parser.parse_args()


# Path: pyDFTutils/vasp/vasp_dos.py
# def plot_all_ldos(filename='DOSCAR',ispin=2,ymin=-2.0,ymax=2.0,xmin=-15.0,xmax=5.0,element_types=None, has_f=False):
#     """
#     plot the local dos of all atoms.
#     """
#     symdict=get_symdict()
# 
#     if element_types is not None:
#         atom_nums=[x for x in list(symdict.keys()) if symnum_to_sym(x) in element_types]
#     else:
#         atom_nums=list(symdict.keys())
# 
#     if ispin==2:
#         if has_f:
#             sites=['s+','p+','d+','s-','p-','d-', 'f+', 'f-']
#         else:
#             sites=['s+','p+','d+','s-','p-','d-']
#     else:
#         if has_f:
#             sites=['s','p','d','f']
#         else:
#             sites=['s','p','d']
# 
#     if not os.path.exists('LDOS'):
#         os.mkdir('LDOS')
#     for atom_num in atom_nums:
#         copyfile(filename,'LDOS/DOSCAR')
#         plotldos_group([atom_num],sites,ymin=ymin,ymax=ymax,xmin=xmin,xmax=xmax,special_location=None,output='LDOS/%s_ldos.png'%atom_num)


# Path: scripts/plotldos.py
from pyDFTutils.vasp.vasp_dos import plot_all_ldos
import argparse

#!/usr/bin/env python

def plot_ldos():
    parser=argparse.ArgumentParser(description='Plot the local dos')
    parser.add_argument('-f','--filename',type=str,help='DOSCAR filename',default='DOSCAR')
    parser.add_argument('-n','--ispin',type=int,help='number os spins, 1 or 2',default=2)
    parser.add_argument('-o','--output',type=str,help='output dir')
    parser.add_argument('--xmin',type=float,help='xmin',default=-15.0)
    parser.add_argument('--xmax',type=float,help='xmax',default=5.0)
    parser.add_argument('--ymin',type=float,help='ymin',default=-2.0)
    parser.add_argument('--ymax',type=float,help='xmax',default=2.0)

    args=parser.parse_args()


    plot_all_ldos(filename=args.filename,ispin=args.ispin,ymin=args.ymin,ymax=args.ymax,xmin=args.xmin,xmax=args.xmax, has_f=False)