stix2xspec.spectrogram module
- class stix2xspec.spectrogram.Spectrogram(filename, background=False, use_discriminators=True, replace_doubles=False, keep_short_bins=True, shift_duration=None, time_bin_filename=None, det_ind=None, pix_ind=None)
Bases:
object- property alpha
1 if the input FITS file is a L1A file.
- apply_elut(elut_filename=None, n_energies=None)
Apply the ELUT to the spectrogram.
Everything that happens after calls to stx_read_…_fits_file and before stix_convert_science_data2ospex in stx_convert_…pro.
- Parameters
elut_filename (str, optional) – Defaults to None. Name of the ELUT to use.
n_energies (int, optional) – Defaults to None. Needs to be set to equal the number of energies in the data spectrogram in the case that the current spectrogram is the background to be subtracted from that one.
- correct_counts()
Perform livetime correction of counts.
- property data_level
The data level of the input FITS file.
- spectrum_to_fits(fitsfilename, srm_file='stx_srm_full.fits', write_srm=True)
Write the spectrogram to an OGIP-compatible FITS file. It can either be background-subtracted or not. Currently cannot be used to write background files.
- Parameters
fitsfilename (str) – Name of the FITS file to be written.
srm_file (str, optional) – .srm file from which to derive the .srm file corresponding to this observation.
write_srm (bool, optional) – Defaults to True. Whether or not to write the .srm file as well.
- to_rate()
Convert counts to count rate