diff --git a/examples/masking_hot_pixels.py b/examples/masking_hot_pixels.py index d680ba5315b..40e8fca4946 100644 --- a/examples/masking_hot_pixels.py +++ b/examples/masking_hot_pixels.py @@ -26,8 +26,8 @@ # Now we create a new custom aia with our new mask and # plot the result using our modified colormap -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]) +max_indices = np.argwhere(aia.data == aia.data.max())*u.pixel +hpc_max = aia.pixel_to_data(max_indices[:,1], max_indices[:,0]) r = np.sqrt(hpc_max.Tx ** 2 + hpc_max.Ty ** 2) / aia.rsun_obs mask = ma.masked_greater_equal(r, 1) scaled_map = sunpy.map.Map(aia.data, aia.meta, mask=mask.mask)