OutputSpectrumModel
- class jwst.combine_1d.combine1d.OutputSpectrumModel[source]
Bases:
objectModel an output spectrum.
- Attributes:
- wavelengthndarray
Output wavelength.
- fluxndarray
Output flux.
- flux_errorndarray
Output error on the flux.
- surf_brightndarray
Output surface brightness.
- sb_errorndarray
Output error on the surface brightness.
- dqndarray
Output DQ array.
- weightndarray
Weight value for each spectral element.
- countndarray
Input value count for each output spectral element.
- wcsgwcs.wcs.WCS
Output spectral WCS.
- normalizedbool
Flag to indicate data has been combined (sums are normalized).
Methods Summary
accumulate_sums(input_spectra[, sigma_clip])Compute a weighted sum of all the input spectra.
assign_wavelengths(input_spectra)Create an array of wavelengths to use for the output spectrum.
close()Set data attributes to null values.
combine_spectra(flux, flux_error, ...[, ...])Combine accumulated spectra.
Create the output data.
Methods Documentation
- accumulate_sums(input_spectra, sigma_clip=None)[source]
Compute a weighted sum of all the input spectra.
Each pixel of each input spectrum will be added to one pixel of the output spectrum. The wavelength spacing of the input and output should be comparable, so each input pixel will usually correspond to one output pixel (i.e., have the same wavelength, to within half a pixel). However, for any given input spectrum, there can be output pixels that are incremented by more than one input pixel, and there can be output pixels that are not incremented. If there are several input spectra, such gaps will hopefully be filled in.
Pixels in an input spectrum that are flagged (via the DQ array) as DO_NOT_USE will not be used, i.e., they will simply be ignored when incrementing output arrays from an input spectrum. If an input pixel is flagged with a non-zero value other than DO_NOT_USE, the value will be propagated to the output DQ array via bitwise OR.
- Parameters:
- input_spectralist of
InputSpectrumModel List of input spectra.
- sigma_clipfloat, optional
Factor for clipping outliers in spectral combination.
- input_spectralist of
- assign_wavelengths(input_spectra)[source]
Create an array of wavelengths to use for the output spectrum.
Take the union of all input wavelengths, then call
compute_output_wl()to bin wavelengths in groups of the number of overlapping spectra.- Parameters:
- input_spectralist of
InputSpectrumModel List of input spectra.
- input_spectralist of
- combine_spectra(flux, flux_error, surf_bright, sb_error, weight, count, sigma_clip=None)[source]
Combine accumulated spectra.
- Parameters:
- fluxndarray, 2-D
Tabulated fluxes for the input spectra in the format
[N spectra, M wavelengths].- flux_errorndarray, 2-D
Flux errors of input spectra.
- surf_brightndarray, 2-D
Surface brightnesses of input spectra.
- sb_errorndarray, 2-D
Surface brightness errors for input spectra.
- weightndarray, 2-D
Pixel weights for input spectra
- countndarray, 2-D
Count of how many values at each index in the input arrays.
- sigma_clipfloat, optional
Factor for clipping outliers. Compares input spectra to the median and medaian absolute devaition, by default None.
- Returns:
- fluxndarray, 1-D
Combined 1-D fluxes.
- flux_errorndarray, 1-D
Combined 1-D flux errors.
- surf_brightndarray, 1-D
Combined 1-D surface brightnesses.
- sb_errorndarray, 1-D
Combined 1-D surface brightness errors.
- weightndarray, 1-D
Total, per wavelength weights.
- countndarray, 1-D
Total count of spectra contributing to each wavelength.
- create_output_data()[source]
Create the output data.
- Returns:
- output_model
CombinedSpecModel A table of combined spectral data.
- output_model