# Path: alis/alload.py
# def cpucheck(ncpu,curcpu=0,verbose=2):
# def usage(name):
# def optarg(pathname, argv=None, verbose=2):
# def set_params(lines, argflag, setstr="", verbose=None):
# def load_settings(fname,verbose=2):
#     def initialise():
# def check_argflag(argflag, curcpu=None):
# def load_input(slf, filename=None, textstr=None, updateself=True):
# def load_atomic(slf):
# def load_data(slf, datlines, data=None):
# def load_userdata(data, colspl, wfe, verbose=2):
# def load_datafile(filename, colspl, wfe, verbose=2, datatype="default"):
# def load_ascii(filename, colspl, wfe, wfek, verbose=2):
# def load_fits(filename, colspl, wfe, verbose=2, ext=0, datatype='default'):
# def load_model(slf, modlines, updateself=True):
# def load_links(slf, lnklines):
# def load_onefits(slf,loadname):
# def load_subpixels(slf, parin):
# def load_par_influence(slf, parin):
#     def inlinks(ivar):
# def get_binsize(wave, bintype="km/s", maxonly=True, verbose=2):
# def load_parinfo(slf):
# def load_tied(p, ptied=None, infl=None):
# def getis(string, ival, infl, retlhs=True):


import pdb
import os
import sys
import numpy as np
import matplotlib
import matplotlib.transforms as mtransforms
from matplotlib.lines import Line2D
from alis import alload
from alis import alis as alismain
        self._atom_lbl=[]
        self._atom_wvl=[]
        self._atom_fvl=[]
        self._atom_gam=[]
        self._molecule_atm=[]
        self._molecule_ion=[]
        self._molecule_lbl=[]
        self._molecule_wvl=[]
        self._molecule_fvl=[]
        self._molecule_gam=[]
        self.load_lines()

    def solar(self):
        elem = np.array(['H ', 'He','Li','Be','B ', 'C ', 'N ', 'O ', 'F ', 'Ne','Na','Mg','Al','Si','P ', 'S ', 'Cl','Ar','K ', 'Ca','Sc','Ti','V ', 'Cr','Mn','Fe','Co','Ni','Cu','Zn'])
        mass = np.array([1.0, 4.0, 7.0, 8.0, 11.0, 12.0,14.0,16.0,19.0,20.0,23.0,24.0,27.0,28.0,31.0,32.0,35.0,36.0,39.0,40.0,45.0,48.0,51.0,52.0,55.0,56.0,59.0,60.0,63.0,64.0])
        solr = np.array([12.0,10.93,3.26,1.30,2.79,8.43,7.83,8.69,4.42,7.93,6.26,7.56,6.44,7.51,5.42,7.14,5.23,6.40,5.06,6.29,3.05,4.91,3.95,5.64,5.48,7.47,4.93,6.21,4.25,4.63])
        solar = np.zeros(self._atom_atm.size)
        for i in range(elem.size):
            w = np.where(self._atom_atm==elem[i])
            solar[w] = solr[i]
        self.solar = solar
        return

    def load_lines(self, verbose=1):
        # Load the lines file
        print("Loading a list of atomic transitions...")
        alispath = __file__#"/".join(__file__.split("/")[:-2])#+"/data/atomic.dat"
        argflag = alload.optarg(alispath, verbose=verbose)
        slf = alismain.ClassMain(argflag, getinst=True)
        slf._argflag = argflag

# Path: alis/alload.py
# def cpucheck(ncpu,curcpu=0,verbose=2):
# def usage(name):
# def optarg(pathname, argv=None, verbose=2):
# def set_params(lines, argflag, setstr="", verbose=None):
# def load_settings(fname,verbose=2):
#     def initialise():
# def check_argflag(argflag, curcpu=None):
# def load_input(slf, filename=None, textstr=None, updateself=True):
# def load_atomic(slf):
# def load_data(slf, datlines, data=None):
# def load_userdata(data, colspl, wfe, verbose=2):
# def load_datafile(filename, colspl, wfe, verbose=2, datatype="default"):
# def load_ascii(filename, colspl, wfe, wfek, verbose=2):
# def load_fits(filename, colspl, wfe, verbose=2, ext=0, datatype='default'):
# def load_model(slf, modlines, updateself=True):
# def load_links(slf, lnklines):
# def load_onefits(slf,loadname):
# def load_subpixels(slf, parin):
# def load_par_influence(slf, parin):
#     def inlinks(ivar):
# def get_binsize(wave, bintype="km/s", maxonly=True, verbose=2):
# def load_parinfo(slf):
# def load_tied(p, ptied=None, infl=None):
# def getis(string, ival, infl, retlhs=True):


# Path: alis/prepfit/specplot.py
import pdb
import os
import sys
import numpy as np
import matplotlib
import matplotlib.transforms as mtransforms
from matplotlib.lines import Line2D
from alis import alload
from alis import alis as alismain

        self._atom_lbl=[]
        self._atom_wvl=[]
        self._atom_fvl=[]
        self._atom_gam=[]
        self._molecule_atm=[]
        self._molecule_ion=[]
        self._molecule_lbl=[]
        self._molecule_wvl=[]
        self._molecule_fvl=[]
        self._molecule_gam=[]
        self.load_lines()

    def solar(self):
        elem = np.array(['H ', 'He','Li','Be','B ', 'C ', 'N ', 'O ', 'F ', 'Ne','Na','Mg','Al','Si','P ', 'S ', 'Cl','Ar','K ', 'Ca','Sc','Ti','V ', 'Cr','Mn','Fe','Co','Ni','Cu','Zn'])
        mass = np.array([1.0, 4.0, 7.0, 8.0, 11.0, 12.0,14.0,16.0,19.0,20.0,23.0,24.0,27.0,28.0,31.0,32.0,35.0,36.0,39.0,40.0,45.0,48.0,51.0,52.0,55.0,56.0,59.0,60.0,63.0,64.0])
        solr = np.array([12.0,10.93,3.26,1.30,2.79,8.43,7.83,8.69,4.42,7.93,6.26,7.56,6.44,7.51,5.42,7.14,5.23,6.40,5.06,6.29,3.05,4.91,3.95,5.64,5.48,7.47,4.93,6.21,4.25,4.63])
        solar = np.zeros(self._atom_atm.size)
        for i in range(elem.size):
            w = np.where(self._atom_atm==elem[i])
            solar[w] = solr[i]
        self.solar = solar
        return

    def load_lines(self, verbose=1):
        # Load the lines file
        print("Loading a list of atomic transitions...")
        alispath = __file__#"/".join(__file__.split("/")[:-2])#+"/data/atomic.dat"
        argflag = alload.optarg(alispath, verbose=verbose)
        slf = alismain.ClassMain(argflag, getinst=True)
        slf._argflag = argflag

        atmdata = alload.load_atomic(slf)