예제 #1
0
 def __init__(self, name, model, var=None, const=None):
     if const is None:
         const = {}
     if var is None:
         var = {}
     keys = var.keys() + const.keys()
     keys.sort()
     if keys != ['amp', 'x', 'y']:
         print "Not all parameters defined!", keys
         df
     self.keys = keys
     self.values = {}
     self.vmap = {}
     self.ispix = False
     for key in var.keys():
         self.values[key] = None
         self.vmap[var[key]] = key
     for key in const.keys():
         self.values[key] = const[key]
     if type(model) == type([]):
         GM.__init__(self, model)
     else:
         PM.__init__(self, model)
         self.ispix = True
     self.setValues()
     self.name = name
     self.convolve = None
예제 #2
0
    def __init__(self, name, model, pars):
        if "amp" not in pars.keys():
            pars["amp"] = 1.0
        self.keys = pars.keys()
        self.keys.sort()
        if self.keys != ["amp", "x", "y"]:
            import sys

            print "Not all (or too many) parameters were defined!"
            print self.keys
            sys.exit()
        if type(model) == type([]):
            GM.__init__(self, model)
        else:
            PM.__init__(self, model)
        self.vmap = {}
        self.pars = pars
        for key in self.keys:
            try:
                v = self.pars[key].value
                self.vmap[key] = self.pars[key]
            except:
                self.__setattr__(key, self.pars[key])
        self.setPars()
        self.name = name
예제 #3
0
파일: SBModels.py 프로젝트: bnord/LensPop
 def __init__(self,name,model,var=None,const=None):
     if const is None:
         const = {}
     if var is None:
         var = {}
     keys = var.keys()+const.keys()
     keys.sort()
     if keys!=['amp','x','y']:
         print "Not all parameters defined!",keys
         df
     self.keys = keys
     self.values = {}
     self.vmap = {}
     self.ispix = False
     for key in var.keys():
         self.values[key] = None
         self.vmap[var[key]] = key
     for key in const.keys():
         self.values[key] = const[key]
     if type(model)==type([]):
         GM.__init__(self,model)
     else:
         PM.__init__(self,model)
         self.ispix = True
     self.setValues()
     self.name = name
     self.convolve = None 
예제 #4
0
def babah():
    for key in var.keys():
        self.values[key] = None
        self.vmap[var[key]] = key
    for key in const.keys():
        self.values[key] = const[key]
    if type(model) == type([]):
        GM.__init__(self, model)
    else:
        PM.__init__(self, model)
        self.ispix = True
    self.setValues()
    self.name = name
    self.convolve = None
예제 #5
0
def babah():
        for key in var.keys():
            self.values[key] = None
            self.vmap[var[key]] = key
        for key in const.keys():
            self.values[key] = const[key]
        if type(model)==type([]):
            GM.__init__(self,model)
        else:
            PM.__init__(self,model)
            self.ispix = True
        self.setValues()
        self.name = name
        self.convolve = None 
예제 #6
0
 def __init__(self,name,model,pars):
     if 'amp' not in pars.keys():
         pars['amp'] = 1.
     self.keys = pars.keys()
     self.keys.sort()
     if self.keys!=['amp','x','y']:
         import sys
         print 'Not all (or too many) parameters were defined!'
         print self.keys
         sys.exit()
     GM.__init__(self,model)
     self.vmap = {}
     self.pars = pars
     for key in self.keys:
         try:
             v = self.pars[key].value
             self.vmap[key] = self.pars[key]
         except:
             self.__setattr__(key,self.pars[key])
     self.setPars()
     self.name = name
예제 #7
0
 def __init__(self,name,model,pars):
     if 'amp' not in pars.keys():
         pars['amp'] = 1.
     self.keys = pars.keys()
     self.keys.sort()
     if self.keys!=['amp','x','y']:
         import sys
         print 'Not all (or too many) parameters were defined!'
         print self.keys
         sys.exit()
     if type(model)==type([]):
         GM.__init__(self,model)
     else:
         PM.__init__(self,model)
     self.vmap = {}
     self.pars = pars
     for key in self.keys:
         try:
             v = self.pars[key].value
             self.vmap[key] = self.pars[key]
         except:
             self.__setattr__(key,self.pars[key])
     self.setPars()
     self.name = name
예제 #8
0
 def pixeval(self, xc, yc, dummy1=None, dummy2=None, **kwargs):
     if self.ispix == True:
         return PM.pixeval(self, xc, yc)
     else:
         return GM.pixeval(self, xc, yc)
예제 #9
0
 def pixeval(self, xc, yc, dummy1=None, dummy2=None, **kwargs):
     if self.ispix == True:
         return PM.pixeval(self, xc, yc)
     else:
         return GM.pixeval(self, xc, yc)