Skip to content

Commit

Permalink
Maximum pixel location may occur at multiple position
Browse files Browse the repository at this point in the history
  • Loading branch information
prateekiiest committed Oct 26, 2017
1 parent 89bf1ff commit 4e1819e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/masking_hot_pixels.py
Expand Up @@ -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)
Expand Down

0 comments on commit 4e1819e

Please sign in to comment.