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

class stix2xspec.spectrogram.stx_energy_axis(num_energy=32, energy_mean=None, gmean=None, low=None, high=None, low_fsw_idx=None, high_fsw_idx=None, edges_1=None, edges_2=None, width=None)

Bases: object

Energy axis class for spectrogram. Compare to stx_energy_axis.pro.

default_value(k)
class stix2xspec.spectrogram.stx_time_axis(time_mean=None, time_start=None, time_end=None, duration=None)

Bases: object

Time axis class for spectrogram. Compare to stx_time_axis.pro.

RHESSI_format_times()

Calculate certain MJD time values for FITS header.