Note
Go to the end to download the full example code.
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)
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()
Total running time of the script: (0 minutes 3.852 seconds)