SJICube#

class irispy.SJICube(
data,
wcs,
*,
uncertainty=None,
unit=None,
meta=None,
mask=None,
copy=False,
scaled=None,
**kwargs,
)[source]#

Bases: SpectrogramCube

Class representing SJI Image described by a single WCS.

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

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

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

  • meta (dict object) – Additional meta information about the dataset.

  • 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.

  • 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.

  • 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.

  • scaled (bool, optional) – Indicates if the data has been scaled.

Attributes Summary

basic_wcs

Returns a standard WCS instead of gWCS.

Methods Summary

apply_dust_mask(*[, undo])

Applies or undoes an update of the mask with the dust particles positions.

plot([axes, plot_axes, axes_coordinates, ...])

Visualize the NDCube.

remove_cosmic_rays(*[, method, sigma, ...])

Return a cleaned copy of the cube with cosmic rays removed.

remove_dust(*[, dust_mask, temporal_window, ...])

Return a new cube with dust-darkened pixels repaired.

to_maps([index])

Return SunPy Maps for the requested frame(s).

Attributes Documentation

basic_wcs#

Returns a standard WCS instead of gWCS.

Methods Documentation

apply_dust_mask(*, undo=False)[source]#

Applies or undoes an update of the mask with the dust particles positions.

Rewrite self.mask with/without the dust positions.

Parameters:

undo (bool) – If False, dust particles positions mask will be applied. If True, dust particles positions mask will be removed. Default=False

plot(
axes=None,
plot_axes=None,
axes_coordinates=None,
axes_units=None,
data_unit=None,
wcs=None,
**kwargs,
)#

Visualize the NDCube.

Parameters:
  • axes (WCSAxes or None:, optional) – The axes to plot onto. If None the current axes will be used.

  • plot_axes (list, optional) – A list of length equal to the number of pixel dimensions in array axis order. This list selects which cube axes are displayed on which plot axes. For an image plot this list should contain 'x' and 'y' for the plot axes and None for all the other elements. For a line plot it should only contain 'x' and None for all the other elements.

  • axes_unit (list, optional) – A list of length equal to the number of world dimensions specifying the units of each axis, or None to use the default unit for that axis.

  • axes_coordinates (list, optional) – A list of length equal to the number of pixel dimensions. For each axis the value of the list should either be a string giving the world axis type or None to use the default axis from the WCS.

  • data_unit (astropy.units.Unit) – The data is changed to the unit given or the NDCube.unit if not given.

  • wcs (astropy.wcs.wcsapi.BaseHighLevelWCS) – The WCS object to define the coordinates of the plot axes.

  • kwargs – Additional keyword arguments are given to the underlying plotting infrastructure which depends on the dimensionality of the data and whether 1 or 2 plot_axes are defined: - Animations: mpl_animators.ArrayAnimatorWCS - Static 2-D images: matplotlib.pyplot.imshow - Static 1-D line plots: matplotlib.pyplot.plot

remove_cosmic_rays(
*,
method='rsliding',
sigma: float | None = None,
max_iters: int | None = None,
method_kwargs=None,
)[source]#

Return a cleaned copy of the cube with cosmic rays removed.

This is a convenience wrapper around irispy.utils.cosmic_rays.remove_cosmic_rays.

Parameters:
  • method ({"rsliding", "astroscrappy"}, optional) – Backend used to detect and clean cosmic rays.

  • sigma (float, optional) – Shared clipping threshold override for the selected backend.

  • max_iters (int, optional) – Shared iteration-count override for the selected backend.

  • method_kwargs (dict, optional) – Additional keyword arguments passed to the selected backend.

Returns:

Cleaned cube with the same metadata and coordinates as the original.

Return type:

irispy.sji.SJICube

remove_dust(
*,
dust_mask=None,
temporal_window=2,
exposure_normalize=True,
fallback='spatial',
spatial_box=5,
)[source]#

Return a new cube with dust-darkened pixels repaired.

This is a convenience wrapper around irispy.utils.dust.remove_dust.

Parameters:
  • dust_mask (numpy.ndarray, optional) – Boolean mask marking pixels to repair. If omitted, a mask is derived from data values.

  • temporal_window (int, optional) – Number of neighboring frames on either side to use for temporal replacement.

  • exposure_normalize (bool, optional) – If True, normalize temporal candidate pixels by exposure time when metadata are available.

  • fallback ({"spatial", None}, optional) – Fallback behavior when temporal replacement is unavailable.

  • spatial_box (int, optional) – Size of the local median filter used by the spatial fallback.

Returns:

Cleaned cube with dust-darkened pixels repaired.

Return type:

irispy.sji.SJICube

to_maps(index: int | list[int] | None = None)[source]#

Return SunPy Maps for the requested frame(s).

Parameters:

index (int, list, optional) – The index of the SJI steps you want. By default None which will return the entire cube as a map sequence.

Returns:

A single Map if index is an int, otherwise a MapSequence.

Return type:

sunpy.map.Map or sunpy.map.MapSequence