当前位置: 首页>>代码示例>>Python>>正文


Python ArithmeticModel.__init__方法代码示例

本文整理汇总了Python中sherpa.models.ArithmeticModel.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python ArithmeticModel.__init__方法的具体用法?Python ArithmeticModel.__init__怎么用?Python ArithmeticModel.__init__使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sherpa.models.ArithmeticModel的用法示例。


在下文中一共展示了ArithmeticModel.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from sherpa.models import ArithmeticModel [as 别名]
# 或者: from sherpa.models.ArithmeticModel import __init__ [as 别名]
    def __init__(self, name='normal'):

        self.sigma = Parameter(name, 'sigma', 1., alwaysfrozen=True)
        self.x0 = Parameter(name, 'x0', 1., alwaysfrozen=True)
        self.norm = Parameter(name, 'norm', 1., alwaysfrozen=True)

        ArithmeticModel.__init__(self, name, (self.sigma, self.x0, self.norm))
开发者ID:ChandraCXC,项目名称:pyblocxs,代码行数:9,代码来源:stats.py

示例2: __init__

# 需要导入模块: from sherpa.models import ArithmeticModel [as 别名]
# 或者: from sherpa.models.ArithmeticModel import __init__ [as 别名]
 def __init__(self, name='simple_overfilling'):
      self.amplitude = Parameter(name, 'amplitude', c0, min=0) # p[0], calibration constant
      self.Ck = Parameter(name,'Ck', 1, min=0) # p[1], telescope efficiency parameter
      # self.b = Parameter(name, 'b', 2, min=1, max=3) # p[2], range factor
      # self.Cb = Parameter(name, 'Cb', 1) # background noise
      # ArithmeticModel.__init__(self, name, (self.amplitude, self.Ck, self.Cb))
      ArithmeticModel.__init__(self, name, (self.amplitude, self.Ck))
开发者ID:Woodstonelee,项目名称:misc,代码行数:9,代码来源:CalibrationEst_Correction_nsf.py

示例3: __init__

# 需要导入模块: from sherpa.models import ArithmeticModel [as 别名]
# 或者: from sherpa.models.ArithmeticModel import __init__ [as 别名]
    def __init__(self, coord, energies, name='cube-model', use_psf=True, exposure=None, psf=None, spatial_model=None,
                 spectral_model=None, select_region=False, index_selected_region=None):
        from scipy import signal
        self.spatial_model = spatial_model
        self.spectral_model = spectral_model
        self.use_psf = use_psf
        self.exposure = exposure
        self.psf = psf
        self._fftconvolve = signal.fftconvolve
        xx = coord.data.lon.degree
        yy = coord.data.lat.degree
        self.xx_lo = xx[0:-1, 1:]
        self.xx_hi = xx[0:-1, 0:-1]
        self.yy_lo = yy[0:-1, 0:-1]
        self.yy_hi = yy[1:, 0:-1]
        self.ee_lo = energies[:-1]
        self.ee_hi = energies[1:]
        self.select_region = select_region
        self.index_selected_region = index_selected_region

        # Fix spectral ampl parameter
        spectral_model.ampl = 1
        spectral_model.ampl.freeze()

        pars = []
        for _ in spatial_model.pars + spectral_model.pars:
            setattr(self, _.name, _)
            pars.append(_)

        self._spatial_pars = slice(0, len(spatial_model.pars))
        self._spectral_pars = slice(len(spatial_model.pars), len(pars))
        ArithmeticModel.__init__(self, name, pars)
开发者ID:mirca,项目名称:gammapy,代码行数:34,代码来源:sherpa_.py

示例4: __init__

# 需要导入模块: from sherpa.models import ArithmeticModel [as 别名]
# 或者: from sherpa.models.ArithmeticModel import __init__ [as 别名]
    def __init__(self, name='myplexpcutoff'):
        self.Eo = Parameter(name, 'Eo', 1, frozen=True, units='keV')  # p[0] Normalized at 1 TeV by default
        self.beta = Parameter(name, 'beta', 1e-1, min=1e-3, max=10, units='1/TeV')  # p[1]
        self.gamma = Parameter(name, 'gamma', 2, min=-1, max=5)  # p[2]
        self.No = Parameter(name, 'No', 1e-11, min=1e-15, max=1e-5, units='1/cm^2/s/TeV')  # p[3]

        ArithmeticModel.__init__(self, name, (self.Eo, self.beta, self.gamma, self.No))
开发者ID:JonathanDHarris,项目名称:gammapy,代码行数:9,代码来源:plexpcutoff.py

示例5: __init__

# 需要导入模块: from sherpa.models import ArithmeticModel [as 别名]
# 或者: from sherpa.models.ArithmeticModel import __init__ [as 别名]
 def __init__(self, name='normshell2d'):
     self.xpos = Parameter(name, 'xpos', 0)
     self.ypos = Parameter(name, 'ypos', 0)
     self.ampl = Parameter(name, 'ampl', 1) # misnomer ... this is really the integral
     self.r0 = Parameter(name, 'r0', 1, 0)
     self.width = Parameter(name, 'width', 0.1, 0)
     ArithmeticModel.__init__(self, name, (self.xpos, self.ypos, self.ampl, self.r0, self.width))
开发者ID:Cadair,项目名称:gammapy,代码行数:9,代码来源:models.py

示例6: __init__

# 需要导入模块: from sherpa.models import ArithmeticModel [as 别名]
# 或者: from sherpa.models.ArithmeticModel import __init__ [as 别名]
 def __init__(self, name='simple_overfilling'):
      # p[0]
      self.c0= Parameter(name, 'c1', 1) 
      #p[1]
      self.c1 = Parameter(name, 'c2', 1)
      #p[2]
      self.c2=Parameter(name,'c3',1) #extra parameter
      ArithmeticModel.__init__(self, name, (self.c0,self.c1,self.c2))
开发者ID:Woodstonelee,项目名称:misc,代码行数:10,代码来源:DWEL_Range_Study.py

示例7: __init__

# 需要导入模块: from sherpa.models import ArithmeticModel [as 别名]
# 或者: from sherpa.models.ArithmeticModel import __init__ [as 别名]
 def __init__(self, name='ecpl'):
     self.gamma = Parameter(name, 'gamma', 2, min=-10, max=10)
     self.ref = Parameter(name, 'ref', 1, frozen=True)
     self.ampl = Parameter(name, 'ampl', 1, min=0)
     self.cutoff = Parameter(name, 'cutoff', 1, min=0, units='1/TeV')
     ArithmeticModel.__init__(self, name, (self.gamma, self.ref, self.ampl,
                                           self.cutoff))
     self._use_caching = True
     self.cache = 10
开发者ID:OlgaVorokh,项目名称:gammapy,代码行数:11,代码来源:sherpa_models.py

示例8: __init__

# 需要导入模块: from sherpa.models import ArithmeticModel [as 别名]
# 或者: from sherpa.models.ArithmeticModel import __init__ [as 别名]
    def __init__(self, gp_model):
        self.gp_model = gp_model
        self.parts = (self,)
        modelname = 'GP' + gp_model.__class__.__name__

        sherpa_pars = []
        for par in gp_model.parameters.parameters:
            sherpa_pars.append(par.to_sherpa())

        ArithmeticModel.__init__(self, modelname, sherpa_pars)
开发者ID:mirca,项目名称:gammapy,代码行数:12,代码来源:sherpa.py

示例9: __init__

# 需要导入模块: from sherpa.models import ArithmeticModel [as 别名]
# 或者: from sherpa.models.ArithmeticModel import __init__ [as 别名]
    def __init__(self, name='cube-model', spatial_model=None, spectral_model=None):
        self.spatial_model = spatial_model
        self.spectral_model = spectral_model

        # Fix spectral ampl parameter
        spectral_model.ampl = 1
        spectral_model.ampl.freeze()

        pars = []
        for _ in spatial_model.pars + spectral_model.pars:
            setattr(self, _.name, _)
            pars.append(_)

        self._spatial_pars = slice(0, len(spatial_model.pars))
        self._spectral_pars = slice(len(spatial_model.pars), len(pars))
        ArithmeticModel.__init__(self, name, pars)
开发者ID:astrofrog,项目名称:gammapy,代码行数:18,代码来源:sherpa_.py

示例10: __init__

# 需要导入模块: from sherpa.models import ArithmeticModel [as 别名]
# 或者: from sherpa.models.ArithmeticModel import __init__ [as 别名]
    def __init__(self, fit):
        self.fit = fit
        
        sherpa_name = 'sherpa_model'
        par_list = list()
        for par in self.fit.model.parameters.parameters:
            sherpa_par = par.to_sherpa(modelname='source')
            #setattr(self, name, sherpa_par)
            par_list.append(sherpa_par)

        if fit.stat != 'wstat' and self.fit.background_model is not None:
            for par in self.fit.background_model.parameters.parameters:
                sherpa_par = par.to_sherpa(modelname='background')
                #setattr(self, name, sherpa_par)
                par_list.append(sherpa_par)

        ArithmeticModel.__init__(self, sherpa_name, par_list)
        self._use_caching = True
        self.cache = 10
开发者ID:mirca,项目名称:gammapy,代码行数:21,代码来源:sherpa_utils.py

示例11: __init__

# 需要导入模块: from sherpa.models import ArithmeticModel [as 别名]
# 或者: from sherpa.models.ArithmeticModel import __init__ [as 别名]
    def __init__(self, name='proton'):
        # First precompute some quantities
        self.Ep_min = 1e-1  # TeV
        self.Ep_max = 1e5  # TeV
        self.nbins = 300
        self.lEp_min = np.log10(self.Ep_min)
        self.lEp_max = np.log10(self.Ep_max)
        self.Ep = np.logspace(self.lEp_min, self.lEp_max, self.nbins)
        self.lbsize = (self.lEp_max - self.Ep_min) / self.nbins
        self.Fgam = None
        self.EG = None
        self.EP = None
        self.ncalc = 0

        # Instantiate parameters
        self.Eo = Parameter(name, 'Eo', 10, frozen=True, units='TeV')  # p[0] Normalized at 10 TeV by default
        self.beta = Parameter(name, 'beta', 1., min=1e-3, max=1e4, units='1/PeV')  # p[1]
        self.gamma = Parameter(name, 'gamma', 2.2, min=-1, max=5)  # p[2]
        self.ampl = Parameter(name, 'ampl', 1e-11, min=1e-15, max=1e15, units='1/cm^2/s/TeV')  # p[3]
        self.Einf = Parameter(name, 'Einf', 1, frozen=True, units='TeV')  # p[4] 1 TeV by default
        self.Esup = Parameter(name, 'Esup', 100, frozen=True, units='TeV')  # p[5] 100 TeV by default

        ArithmeticModel.__init__(self, name, (self.Eo, self.beta, self.gamma, self.ampl, self.Einf, self.Esup))
开发者ID:astrofrog,项目名称:gammapy,代码行数:25,代码来源:proton.py

示例12: __init__

# 需要导入模块: from sherpa.models import ArithmeticModel [as 别名]
# 或者: from sherpa.models.ArithmeticModel import __init__ [as 别名]
  def __init__(self, name='simple_overfilling'):
	  self.C0 = Parameter(name, 'C0', 1, min=1)
	  self.C1 = Parameter(name, 'C1', 1, min=1)
	  self.C2 = Parameter(name, 'C2', 1, min=0)
	  self.b = Parameter(name, 'b', 2, min=1, max=3)
	  ArithmeticModel.__init__(self, name, (self.C0, self.C1, self.C2, self.b))
开发者ID:Woodstonelee,项目名称:misc,代码行数:8,代码来源:CalibrationEst.py

示例13: __init__

# 需要导入模块: from sherpa.models import ArithmeticModel [as 别名]
# 或者: from sherpa.models.ArithmeticModel import __init__ [as 别名]
 def __init__(self, name):
     self.has_25 = Parameter(name, "has_25", 0, min=0, max=1)
     ArithmeticModel.__init__(self, name, (self.has_25,))
开发者ID:DougBurke,项目名称:sherpa,代码行数:5,代码来源:test_regrid.py

示例14: __init__

# 需要导入模块: from sherpa.models import ArithmeticModel [as 别名]
# 或者: from sherpa.models.ArithmeticModel import __init__ [as 别名]
    def __init__(self, name="usermodel"):
        self.param1 = Parameter(name, "param1", 1, min=0, max=100)
        self.param2 = Parameter(name, "param2", 1, min=-100, max=100)

        ArithmeticModel.__init__(self, name, (self.param1, self.param2))
开发者ID:linearregression,项目名称:sherpa,代码行数:7,代码来源:test_ui.py

示例15: __init__

# 需要导入模块: from sherpa.models import ArithmeticModel [as 别名]
# 或者: from sherpa.models.ArithmeticModel import __init__ [as 别名]
    def __init__(self, name='usermodel'):
        self.param1 = Parameter(name, 'param1', 1, min=0, max=100)
        self.param2 = Parameter(name, 'param2', 1, min=-100, max=100)

        ArithmeticModel.__init__(self, name, (self.param1,
                                              self.param2))
开发者ID:spidersaint,项目名称:sherpa,代码行数:8,代码来源:test_ui.py


注:本文中的sherpa.models.ArithmeticModel.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。