threeML.plugins.DispersionSpectrumLike module

class threeML.plugins.DispersionSpectrumLike.DispersionSpectrumLike(name: str, observation, background=None, background_exposure=None, verbose=True, tstart=None, tstop=None)[source]

Bases: threeML.plugins.SpectrumLike.SpectrumLike

display_rsp()[source]

Display the currently loaded full response matrix, i.e., RMF and ARF convolved :return:

classmethod from_function(name: str, source_function, response, source_errors=None, source_sys_errors=None, background_function=None, background_errors=None, background_sys_errors=None)threeML.plugins.DispersionSpectrumLike.DispersionSpectrumLike[source]

Construct a simulated spectrum from a given source function and (optional) background function. If source and/or background errors are not supplied, the likelihood is assumed to be Poisson.

Parameters
  • name – simulated data set name

  • source_function – astromodels function

  • response – 3ML Instrument response

  • source_errors – (optional) gaussian source errors

  • source_sys_errors – (optional) systematic source errors

  • background_function – (optional) astromodels background function

  • background_errors – (optional) gaussian background errors

  • background_sys_errors – (optional) background systematic errors

Returns

simulated DispersionSpectrumLike plugin

get_pha_files()[source]
get_simulated_dataset(new_name=None, **kwargs)[source]

Returns another DispersionSpectrumLike instance where data have been obtained by randomizing the current expectation from the model, as well as from the background (depending on the respective noise models)

Returns

a DispersionSpectrumLike simulated instance

property response
set_model(likelihoodModel)[source]

Set the model to be used in the joint minimization.

set_model_integrate_method(method: str)[source]

Change the integrate method for the model integration :param method: (str) which method should be used (simpson or trapz)

write_pha(filename: str, overwrite: bool = False, force_rsp_write: bool = False)None[source]

Writes the observation, background and (optional) rsp to PHAII fits files

Parameters
  • filename – base file name to write out

  • overwrite – if you would like to force overwriting of the files

  • force_rsp_write – force the writing of an rsp even if not required