remove_dust#
- irispy.utils.dust.remove_dust(
- cube,
- *,
- dust_mask=None,
- temporal_window=2,
- exposure_normalize=True,
- fallback='spatial',
- spatial_box=5,
Replace dust-darkened pixels in an IRIS image cube.
This routine is inspired by SolarSoft’s
IRIS_DUSTBUSTER. It uses neighboring frames at the same pixel location first, and falls back to a local spatial median when temporal replacements is not available.- Parameters:
cube (
irispy.sji.SJICube) – The image cube to clean. Two-dimensional image slices are also supported.dust_mask (
numpy.ndarray, optional) – Boolean mask marking the pixels to repair. If omitted, the mask is derived fromirispy.utils.calculate_dust_mask. For a 3D cube, a 2D mask is broadcast over time.temporal_window (
int, optional) – Number of neighboring frames on either side to consider when computing the replacement value. Defaults to 2, which mirrors the neighboring frames used in the IDL implementation.exposure_normalize (
bool, optional) – IfTrue, normalize candidate replacement pixels by the frame exposure time before taking the median and scale the result back to the target frame. If no usable exposure time metadata are available this step is skipped.fallback ({
"spatial", None}, optional) – Fallback to use when temporal replacement is unavailable."spatial"applies a local median filter to the frame. None leaves those pixels masked.spatial_box (
int, optional) – Size of the local median filter used by the spatial fallback. Defaults to 5.
- Returns:
A new cube with repaired dust pixels.
- Return type:
Notes
Unlike the IDL routine, this function does not remap instrument bad-pixel tables into the image plane. It assumes the dust locations are already represented in the data values or supplied via
dust_mask.