本文整理汇总了Python中sherpa.models.model.CompositeModel类的典型用法代码示例。如果您正苦于以下问题:Python CompositeModel类的具体用法?Python CompositeModel怎么用?Python CompositeModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CompositeModel类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
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: startup
def startup(self):
pha = self.pha
pha.notice_response(False)
self.channel = pha.get_noticed_channels()
self.mask = pha.get_mask()
self.model.startup()
CompositeModel.startup(self)
示例3: teardown
def teardown(self):
pha = self.pha
rmf = self.rmf
self.channel = sao_arange(1, rmf.detchans)
self.mask = numpy.ones(rmf.detchans, dtype=bool)
self.model.teardown()
CompositeModel.teardown(self)
示例4: __init__
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))
示例5: teardown
def teardown(self):
pha = self.pha
if numpy.iterable(pha.mask):
pha.notice_response(False)
self.channel = pha.channel
self.mask = numpy.ones(len(pha.channel), dtype=bool)
self.elo = None; self.ehi = None; self.table = None
self.lo = None; self.hi = None
CompositeModel.teardown(self)
示例6: __init__
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,))
示例7: __init__
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()