Multi-scale Gaussian Normalization#

This example applies Multi-scale Gaussian Normalization to a sunpy.map.Map using sunkit_image.enhance.mgn.

import matplotlib.pyplot as plt
import sunpy.data.sample
import sunpy.map
from astropy import units as u
from matplotlib import colors

import sunkit_image.enhance as enhance

sunpy provides a range of sample data with a number of suitable images.

aia_map = sunpy.map.Map(sunpy.data.sample.AIA_171_IMAGE)

# The original image is plotted to showcase the difference.
fig = plt.figure()
ax = plt.subplot(projection=aia_map)
aia_map.plot(clip_interval=(1, 99.99) * u.percent)
AIA $171 \; \mathrm{\mathring{A}}$ 2011-06-07 06:33:02
Files Downloaded:   0%|          | 0/1 [00:00<?, ?file/s]

AIA20110607_063302_0171_lowres.fits:   0%|          | 0.00/973k [00:00<?, ?B/s]


Files Downloaded: 100%|██████████| 1/1 [00:00<00:00,  2.72file/s]
Files Downloaded: 100%|██████████| 1/1 [00:00<00:00,  2.72file/s]

<matplotlib.image.AxesImage object at 0x7f67f9121c40>

Applying Multi-scale Gaussian Normalization on a solar image. The sunkit_image.enhance.mgn function takes either a sunpy.map.Map or a numpy.ndarray as a input.

mgn_map = enhance.mgn(aia_map)

Now we will plot the MGN enhanced map.

fig = plt.figure()
ax = plt.subplot(projection=mgn_map)
mgn_map.plot(norm=colors.Normalize())

plt.show()
AIA $171 \; \mathrm{\mathring{A}}$ 2011-06-07 06:33:02

Total running time of the script: (0 minutes 3.852 seconds)

Gallery generated by Sphinx-Gallery