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


Python model.CompositeModel類代碼示例

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

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

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

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

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

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

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


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