threeML.utils.spectrum.pha_spectrum module

class threeML.utils.spectrum.pha_spectrum.PHASpectrum(pha_file_or_instance: Union[str, pathlib.Path, threeML.utils.OGIP.pha.PHAII], spectrum_number: Optional[int] = None, file_type: str = 'observed', rsp_file: Optional[str] = None, arf_file: Optional[str] = None)[source]

Bases: threeML.utils.spectrum.binned_spectrum.BinnedSpectrumWithDispersion

property ancillary_file

Returns the ancillary file definied in the header, or None if there is none defined

Returns

a path to a file, or None

property background_file

Returns the background file definied in the header, or None if there is none defined p

return

a path to a file, or None

clone(new_counts=None, new_count_errors=None, new_exposure=None, new_scale_factor=None)[source]

make a new spectrum with new counts and errors and all other parameters the same

Parameters
  • new_exposure – the new exposure for the clone

  • new_scale_factor – the new scale factor for the clone

  • new_counts – new counts for the spectrum

  • new_count_errors – new errors from the spectrum

Returns

new pha spectrum

property filename
classmethod from_dispersion_spectrum(dispersion_spectrum: threeML.utils.spectrum.binned_spectrum.BinnedSpectrumWithDispersion, file_type: str = 'observed')threeML.utils.spectrum.pha_spectrum.PHASpectrum[source]
property grouping
property response_file

Returns the response file definied in the header, or None if there is none defined

Returns

a path to a file, or None

property scale_factor

This is a scale factor (in the BACKSCAL keyword) which must be used to rescale background and source regions

Returns

set_ogip_grouping(grouping)[source]

If the counts are rebinned, this updates the grouping :param grouping:

class threeML.utils.spectrum.pha_spectrum.PHASpectrumSet(pha_file_or_instance: Union[str, pathlib.Path, threeML.utils.OGIP.pha.PHAII], file_type: str = 'observed', rsp_file: Optional[str] = None, arf_file: Optional[str] = None)[source]

Bases: threeML.utils.spectrum.binned_spectrum_set.BinnedSpectrumSet

property ancillary_file

Returns the ancillary file definied in the header, or None if there is none defined

Returns

a path to a file, or None

property background_file

Returns the background file definied in the header, or None if there is none defined p

return

a path to a file, or None

clone(new_counts=None, new_count_errors=None)[source]

make a new spectrum with new counts and errors and all other parameters the same

Parameters
  • new_counts – new counts for the spectrum

  • new_count_errors – new errors from the spectrum

Returns

new pha spectrum

property filename
classmethod from_dispersion_spectrum(dispersion_spectrum: threeML.utils.spectrum.binned_spectrum.BinnedSpectrumWithDispersion, file_type: str = 'observed')threeML.utils.spectrum.pha_spectrum.PHASpectrum[source]
property grouping
property response_file

Returns the response file definied in the header, or None if there is none defined

Returns

a path to a file, or None

property scale_factor

This is a scale factor (in the BACKSCAL keyword) which must be used to rescale background and source regions

Returns

set_ogip_grouping(grouping)[source]

If the counts are rebinned, this updates the grouping :param grouping: