remove_cosmic_rays#

irispy.utils.cosmic_rays.remove_cosmic_rays(
cube,
*,
method: str = 'rsliding',
sigma: float | None = None,
max_iters: int | None = None,
method_kwargs: Mapping[str, Any] | None = None,
)[source]#

Remove cosmic rays from a cube and return a cleaned cube.

Parameters:
  • cube (irispy.sji.SJICube or irispy.spectrograph.SpectrogramCube) – Cube object to clean.

  • method ({"rsliding", "astroscrappy"}, optional) – Cosmic ray removal backend. "rsliding" is the default and operates on the full array. "astroscrappy" is applied frame-by-frame over the last two axes.

  • sigma (float, optional) – Shared clipping threshold override. This maps to sigma for rsliding and sigclip for astroscrappy.

  • max_iters (int, optional) – Shared iteration-count override. This maps to max_iters for rsliding and niter for astroscrappy.

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

Returns:

A new cube with cleaned data and copied metadata/coordinates.

Return type:

irispy.sji.SJICube or irispy.spectrograph.SpectrogramCube