当前位置: 首页>>代码示例>>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;未经允许,请勿转载。