# respike¶

aiapy.calibrate.respike(smap, spikes=None)[source]

Re-insert “spikes” or “hot pixels” into level 1 AIA images.

Level 1 AIA images are, by default, “de-spiked” to remove erroneously high intensity values, e.g. due to cosmic ray hits. This function re-inserts these “spikes” back into the image using spike location and intensity values either provided by the user or obtained automatically from JSOC.

Note

This function should only be applied to level 1 images (i.e. before calling aiapy.calibrate.register). If the input image has been interpolated in any way from the original level 1 data, the spikes will be reinserted at the wrong locations.

Note

This function modifies the LVL_NUM, NSPIKES, and COMMENTS header keywords such that the resulting FITS header will differ from the original file.

Note

If the image series of interest is large, it is advised to obtain the spike data via JSOC externally and specify them via the spikes keyword argument. To retrieve the coordinates of the positions of the spikes use the function aiapy.calibrate.fetch_spikes.

Parameters:
• smap (AIAMap) – Level 1 AIA image. This can be a cutout or a full-frame image.

• spikes (array-like, with shape (2, N), optional) – Tuple of pixel positions of the spikes in the coordinate system of the level 1 AIA image in smap (first entry) and original intensity values (second entry). This can be calculated using fetch_spikes. If not specified, the spike positions and intensities are automatically queried from the JSOC.

Returns:

A level 0.5 version of smap with the spike data re-inserted at the appropriate pixels

Return type:

AIAMap