"""
============================
The brightest pixel location
============================

How to find and overplot the location of the brightest pixel
"""
import numpy as np
import astropy.units as u
import matplotlib.pyplot as plt
from sunpy.data.sample import AIA_171_IMAGE
import sunpy.map

###############################################################################
# We first create the Map using the sample data and import the coordinate
# functionality.
aia = sunpy.map.Map(AIA_171_IMAGE)


max_indices = np.unravel_index(aia.data.argmax(), aia.data.shape) * u.pixel

hpc_max = aia.pixel_to_data(max_indices[1], max_indices[0])

###############################################################################
# Let's now plot the results. We'll overlay the autogenerated SunPy lon/lat
# grid as well for comparison.
fig = plt.figure()
ax = plt.subplot(projection=aia)
aia.plot()
ax.plot_coord(hpc_max)
plt.show()

@@ -906,16 +906,22 @@
 (hpc_max
+, 'bx'
 )%0Aplt.sh

Update brightness_pixel_location.py