當前位置: 首頁>>代碼示例>>Python>>正文


Python CompositeModel.__init__方法代碼示例

本文整理匯總了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())
開發者ID:DougBurke,項目名稱:sherpa,代碼行數:9,代碼來源:background.py

示例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))
開發者ID:DougBurke,項目名稱:sherpa,代碼行數:9,代碼來源:test_regrid_unit.py

示例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,))
開發者ID:mirca,項目名稱:sherpa,代碼行數:17,代碼來源:instrument.py

示例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()
開發者ID:ChandraCXC,項目名稱:sherpa,代碼行數:18,代碼來源:instrument.py


注:本文中的sherpa.models.model.CompositeModel.__init__方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。