get_response_for_pha

sherpa.astro.background.get_response_for_pha(data, model, bkg_srcs={}, pileup_model=None, id=None)[source] [edit on github]

Create the response model describing the source and model.

Include any background components and apply the response model for the dataset.

This is essentially the object-oriented version of sherpa.astro.background.add_response.

Parameters:
  • data (sherpa.astro.data.DataPHA instance) – The dataset (may be a background dataset).

  • model (sherpa.models.model.ArithmeticModel instance) – The model (without response or background components) to match to data.

  • bkg_srcs (dict) – Keys in the dictionary need to be the background ids in the dataset data, and the values are the corresponding source models.

  • pileup_model (None or sherpa.astro.models.JDPileup instance) – Pileup model for the dataset if needed, or None for no pileup model.

  • id (string) – A string to label the dataset in warning messages. If this is set None the name of the dataset it used. Thus parameters is mainly needed if this function is called from the UI layer, where datasets and models have ids that are not stored in an attribute of the dataset itself.

Returns:

fullmodel – The model including the necessary response models and background components.

Return type:

sherpa.models.model.ArithmeticModel