Skip to content

Commit

Permalink
do not normalize binary arrays (issue765)
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosggarcia committed Jun 8, 2022
1 parent 0f46774 commit 7b3a3c3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion healpy/projaxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,12 @@ def projmap(
if alpha is not None:
alpha_img = self.proj.projmap(alpha, vec2pix_func, rot=rot, coord=coord)
alpha_img[alpha_img == -np.inf] = 0
alpha = plt.Normalize()(alpha_img)
# If the alpha array is binary (e.g. 0's and some other value), do
# not normalize it
if np.unique(alpha_img).size <= 2:
alpha = alpha_img
else:
alpha = plt.Normalize()(alpha_img)
try:
if vmin is None:
vmin = img[w].min()
Expand Down

0 comments on commit 7b3a3c3

Please sign in to comment.