# Path: alis/almsgs.py
# class Colors:
# class msgs:
#     def disable(self):
#     def __init__(self):
#     def alisheader(self, prognm, verbose=2):
#     def signal_handler(self, signalnum, handler):
#     def error(self, msg, verbose=None):
#     def info(self, msg, verbose=None):
#     def warn(self, msg, verbose=None):
#     def test(self, msg, verbose=None):
#     def bug(self, msg, verbose=None):
#     def work(self, msg, verbose=None):
#     def input(self):
#     def newline(self,verbose=None):
#     def indent(self,verbose=None):
# 
# Path: alis/alfunc_base.py
# class Base :
#     def __init__(self, prgname="", getinst=False, atomic=None, verbose=2):
#     def call_CPU(self, x, p, ae='em', mkey=None, ncpus=1):
#         def model():
#     def call_GPU(self, x, p, ae='em'):
#     def adjust_fix(self, mp, cntr, jval, parj):
#     def adjust_lim(self, mp, cntr, jval, jind, parj):
#     def getminmax(self, par, fitrng, Nsig=5.0):
#     def load(self, instr, cntr, mp, specid):
#         def check_tied_param(ival, cntr, mps, iind):
#     def parin(self, i, par, parb):
#     def parout(self, params, mp, istart, level, errs=None, reletter=False, conv=None):
#     def set_pinfo(self, pinfo, level, mp, lnk, mnum):
#     def set_vars(self, p, level, mp, ival, wvrng=[0.0,0.0], spid='None', levid=None, nexbin=None, ddpid=None, getinfl=False):
#     def gtoef(self, num, fmt):
#     def tick_info(self, p, level, mp, ival, wvrng=[0.0,0.0], spid='None', levid=None):
# def call(prgname="",getfuncs=False,getinst=False,atomic=None,verbose=2):


import numpy as np
from alis import almsgs
from alis import alfunc_base
            elif mp['mtie'][ival][i] <= -2:
                if len(mp['mlnk']) == 0:
                    lnkprm = mp['mpar'][ival][i]
                else:
                    for j in range(len(mp['mlnk'])):
                        if mp['mlnk'][j][0] == mp['mtie'][ival][i]:
                            cmd = 'lnkprm = ' + mp['mlnk'][j][1]
                            namespace = dict({'p': p})
                            exec(cmd, namespace)
                            lnkprm = namespace['lnkprm']
                levadd += 1
            else:
                getid = level+levadd
                levadd+=1
            if lnkprm is None:
                params[i] = self.parin(i, p[getid], parb)
                if mp['mfix'][ival][i] == 0: parinf.append(getid)
            else:
                params[i] = lnkprm
        if ddpid is not None:
            if ddpid not in parinf: return []
        if nexbin is not None:
            if params[2] == 0.0: msgs.error("Cannot calculate "+self._idstr+" subpixellation -- width = 0.0")
            if nexbin[0] == "km/s": return params, int(round(parb['ap_2a']*nexbin[1]/(299792.458*params[2]) + 0.5))
            elif nexbin[0] == "A" : return params, int(round(nexbin[1]/params[2] + 0.5))
            else: msgs.bug("bintype "+nexbin[0]+" should not have been specified in model function: "+self._idstr, verbose=self._verbose)
        elif getinfl: return params, parinf
        else: return params



# Path: alis/almsgs.py
# class Colors:
# class msgs:
#     def disable(self):
#     def __init__(self):
#     def alisheader(self, prognm, verbose=2):
#     def signal_handler(self, signalnum, handler):
#     def error(self, msg, verbose=None):
#     def info(self, msg, verbose=None):
#     def warn(self, msg, verbose=None):
#     def test(self, msg, verbose=None):
#     def bug(self, msg, verbose=None):
#     def work(self, msg, verbose=None):
#     def input(self):
#     def newline(self,verbose=None):
#     def indent(self,verbose=None):
# 
# Path: alis/alfunc_base.py
# class Base :
#     def __init__(self, prgname="", getinst=False, atomic=None, verbose=2):
#     def call_CPU(self, x, p, ae='em', mkey=None, ncpus=1):
#         def model():
#     def call_GPU(self, x, p, ae='em'):
#     def adjust_fix(self, mp, cntr, jval, parj):
#     def adjust_lim(self, mp, cntr, jval, jind, parj):
#     def getminmax(self, par, fitrng, Nsig=5.0):
#     def load(self, instr, cntr, mp, specid):
#         def check_tied_param(ival, cntr, mps, iind):
#     def parin(self, i, par, parb):
#     def parout(self, params, mp, istart, level, errs=None, reletter=False, conv=None):
#     def set_pinfo(self, pinfo, level, mp, lnk, mnum):
#     def set_vars(self, p, level, mp, ival, wvrng=[0.0,0.0], spid='None', levid=None, nexbin=None, ddpid=None, getinfl=False):
#     def gtoef(self, num, fmt):
#     def tick_info(self, p, level, mp, ival, wvrng=[0.0,0.0], spid='None', levid=None):
# def call(prgname="",getfuncs=False,getinst=False,atomic=None,verbose=2):


# Path: alis/alfunc_gaussian.py
import numpy as np
from alis import almsgs
from alis import alfunc_base

            elif mp['mtie'][ival][i] <= -2:
                if len(mp['mlnk']) == 0:
                    lnkprm = mp['mpar'][ival][i]
                else:
                    for j in range(len(mp['mlnk'])):
                        if mp['mlnk'][j][0] == mp['mtie'][ival][i]:
                            cmd = 'lnkprm = ' + mp['mlnk'][j][1]
                            namespace = dict({'p': p})
                            exec(cmd, namespace)
                            lnkprm = namespace['lnkprm']
                levadd += 1
            else:
                getid = level+levadd
                levadd+=1
            if lnkprm is None:
                params[i] = self.parin(i, p[getid], parb)
                if mp['mfix'][ival][i] == 0: parinf.append(getid)
            else:
                params[i] = lnkprm
        if ddpid is not None:
            if ddpid not in parinf: return []
        if nexbin is not None:
            if params[2] == 0.0: msgs.error("Cannot calculate "+self._idstr+" subpixellation -- width = 0.0")
            if nexbin[0] == "km/s": return params, int(round(parb['ap_2a']*nexbin[1]/(299792.458*params[2]) + 0.5))
            elif nexbin[0] == "A" : return params, int(round(nexbin[1]/params[2] + 0.5))
            else: msgs.bug("bintype "+nexbin[0]+" should not have been specified in model function: "+self._idstr, verbose=self._verbose)
        elif getinfl: return params, parinf
        else: return params



class GaussianConstant(alfunc_base.Base) :