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)
def startup(self, cache): pha = self.pha pha.notice_response(False) self.channel = pha.get_noticed_channels() self.mask = pha.get_mask() self.model.startup(cache) CompositeModel.startup(self, cache)
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)
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())
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))
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())
def startup(self): pha = self.pha if numpy.iterable(pha.mask): pha.notice_response(True) self.channel = pha.get_noticed_channels() self.mask = pha.get_mask() self._get_noticed_energy_list() CompositeModel.startup(self)
def startup(self, cache): pha = self.pha if numpy.iterable(pha.mask): pha.notice_response(True) self.channel = pha.get_noticed_channels() self.mask = pha.get_mask() self._get_noticed_energy_list() CompositeModel.startup(self, cache)
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)
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)
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, ))
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,))
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()
def teardown(self): # Note: # # The pha variable was declared but not used, so has been commented # out. It has been kept as a comment for future review, since it # is unclear whether anything should be done to the PHA object # during teardown # # 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)
def __init__(self, rmf, model): self.rmf = rmf self.model = model # Logic for ArithmeticModel.__init__ self.pars = () # FIXME: group pairs of coordinates with one attribute 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.rmfargs = () CompositeModel.__init__(self, 'apply_rmf(%s)' % model.name, (model,)) self.filter()
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()
def __init__(self, rmf, model): self.rmf = rmf self.model = model # Logic for ArithmeticModel.__init__ self.pars = () # FIXME: group pairs of coordinates with one attribute 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.rmfargs = () CompositeModel.__init__(self, 'apply_rmf(%s)' % model.name, (model, )) self.filter()
def __init__(self, source, pha): self.channel = pha.channel self.mask = numpy.ones(len(pha.channel), dtype=bool) self.pha = pha self.source = source self.elo = None self.ehi = None self.lo = None self.hi = None self.table = None self.orders = None models = [] grid = [] for id in pha.response_ids: arf, rmf = pha.get_response(id) if arf is None and rmf is None: raise DataErr('norsp', pha.name) m = ResponseNestedModel(arf, rmf) indep = None if arf is not None: indep = arf.get_indep() if rmf is not None: indep = rmf.get_indep() models.append(m) grid.append(indep) self.models = models self.grid = grid name = '%s(%s)' % (type(self).__name__, ','.join(['%s(%s)' % (m.name, source.name) for m in models])) CompositeModel.__init__(self, name, (source,))
def __init__(self, source, pha): self.channel = pha.channel self.mask = numpy.ones(len(pha.channel), dtype=bool) self.pha = pha self.source = source self.elo = None self.ehi = None self.lo = None self.hi = None self.table = None self.orders = None models = [] grid = [] for id in pha.response_ids: arf, rmf = pha.get_response(id) if arf is None and rmf is None: raise DataErr('norsp', pha.name) m = ResponseNestedModel(arf, rmf) indep = None if arf is not None: indep = arf.get_indep() if rmf is not None: indep = rmf.get_indep() models.append(m) grid.append(indep) self.models = models self.grid = grid name = '%s(%s)' % (type(self).__name__, ','.join( ['%s(%s)' % (m.name, source.name) for m in models])) CompositeModel.__init__(self, name, (source, ))
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))
def startup(self): self.model.startup() CompositeModel.startup(self)
def teardown(self): self.model.teardown() CompositeModel.teardown(self)
def startup(self, cache): self.model.startup(cache) CompositeModel.startup(self, cache)