本文整理匯總了Python中sherpa.models.model.CompositeModel.__init__方法的典型用法代碼示例。如果您正苦於以下問題:Python CompositeModel.__init__方法的具體用法?Python CompositeModel.__init__怎麽用?Python CompositeModel.__init__使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類sherpa.models.model.CompositeModel
的用法示例。
在下文中一共展示了CompositeModel.__init__方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __init__
# 需要導入模塊: from sherpa.models.model import CompositeModel [as 別名]
# 或者: from sherpa.models.model.CompositeModel import __init__ [as 別名]
def __init__(self, srcdata, bkgmodels):
self.srcdata = srcdata
self.bkgmodels = bkgmodels
scale_factor = self.srcdata.sum_background_data(lambda key, bkg:1)
bkgnames = [model.name for model in bkgmodels.values()]
name = '%g * (' % scale_factor + ' + '.join(bkgnames) + ')'
CompositeModel.__init__(self, name, self.bkgmodels.values())
示例2: __init__
# 需要導入模塊: from sherpa.models.model import CompositeModel [as 別名]
# 或者: from sherpa.models.model.CompositeModel import __init__ [as 別名]
def __init__(self, model, wrapper):
self.model = self.wrapobj(model)
self.wrapper = wrapper
CompositeModel.__init__(self,
"{}({})".format(self.wrapper.name,
self.model.name),
(self.wrapper, self.model))
示例3: __init__
# 需要導入模塊: from sherpa.models.model import CompositeModel [as 別名]
# 或者: from sherpa.models.model.CompositeModel import __init__ [as 別名]
def __init__(self, rmf, model, pha=None):
self.pha = pha
self.channel = sao_arange(1, rmf.detchans) # sao_arange is inclusive
self.mask = numpy.ones(rmf.detchans, dtype=bool)
self.rmf = rmf
self.elo, self.ehi = rmf.get_indep()
self.lo, self.hi = DataPHA._hc / self.ehi, DataPHA._hc / self.elo
self.model = model
self.otherargs = None
self.otherkwargs = None
self.pars = ()
CompositeModel.__init__(self,
('%s(%s)' % ('apply_rmf', self.model.name)),
(self.model,))
示例4: __init__
# 需要導入模塊: from sherpa.models.model import CompositeModel [as 別名]
# 或者: from sherpa.models.model.CompositeModel import __init__ [as 別名]
def __init__(self, arf, model):
self.arf = arf
self.model = model
self.elo = None; self.ehi = None # Energy space
self.lo = None; self.hi = None # Wavelength space
self.xlo = None; self.xhi = None # Current Spectral coordinates
# Used to rebin against finer or coarser energy grids
self.arfargs = ()
# Logic for ArithmeticModel.__init__
self.pars = ()
CompositeModel.__init__(self, 'apply_arf(%s)' % model.name, (model,))
self.filter()