class sunraster.SpectrogramCube(data, wcs, unit=None, uncertainty=None, meta=None, mask=None, instrument_axes=None, copy=False, **kwargs)[source]#

Bases: NDCube, SpectrogramABC

Class representing a sit-and-stare or single raster of slit spectrogram data.

Must be described by a single WCS.

  • data (numpy.ndarray) – The array holding the actual data in this object.

  • wcs (ndcube.wcs.wcs.WCS) – The WCS object containing the axes’ information

  • unit (astropy.unit.Unit or str, optional) – Unit for the dataset. Strings that can be converted to a Unit are allowed.

  • uncertainty (any type, optional) – Uncertainty in the dataset. Should have an attribute uncertainty_type that defines what kind of uncertainty is stored, for example “std” for standard deviation or “var” for variance. A metaclass defining such an interface is NDUncertainty - but isn’t mandatory. If the uncertainty has no such attribute the uncertainty is stored as UnknownUncertainty. Defaults to None.

  • meta (dict-like object, optional) – Additional meta information about the dataset.

  • mask (any type, optional) – Mask for the dataset. Masks should follow the numpy convention that valid data points are marked by False and invalid ones with True. Defaults to None.

  • instrument_axes (list, optional) – This is the relationship between the array axes and the instrument, i.e. repeat raster axis, slit position, position along slit, and spectral. These are needed because they cannot be inferred simply from the physical types.

  • copy (bool, optional) – Indicates whether to save the arguments as copy. True copies every attribute before saving it while False tries to save every parameter as reference. Note however that it is not always possible to save the input as reference. Default is False.

Attributes Summary


Return the celestial coordinates for each pixel.


Return the exposure time for each exposure.


Return the spectral coordinates for each pixel.


Return the time coordinates for each pixel.

Methods Summary

apply_exposure_time_correction([undo, force])

Applies or undoes exposure time correction to data and uncertainty and adjusts unit.

Attributes Documentation


Methods Documentation

apply_exposure_time_correction(undo=False, force=False)[source]#

Applies or undoes exposure time correction to data and uncertainty and adjusts unit.

Correction is only applied (undone) if the object’s unit doesn’t (does) already include inverse time. This can be overridden so that correction is applied (undone) regardless of unit by setting force=True.

  • undo (bool) – If False, exposure time correction is applied. If True, exposure time correction is undone. Default=False

  • force (bool) – If not True, applies (undoes) exposure time correction only if unit doesn’t (does) already include inverse time. If True, correction is applied (undone) regardless of unit. Unit is still adjusted accordingly.


result – New SpectrogramCube in new units.

Return type: