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 __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, 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 __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))