Skip to content

Commit

Permalink
480 Flatten mask in display_matrix
Browse files Browse the repository at this point in the history
next-exp#480

[author: jjgomezcadenas]

The display function display_matrix takes an optional mask array that
allows to plot only those values of the matrix accepted by the
mask. This feature had not been previously tested, and thus we had not
noted that the mask had to be flattened. This is now fixed.

[reviewer: gonzaponte]

Straightforward fix. Approved.
  • Loading branch information
jjgomezcadenas authored and gonzaponte committed Jun 10, 2018
1 parent 7d57dd4 commit 0991855
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions invisible_cities/icaro/hst_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ def display_matrix(x, y, z, mask=None, **kwargs):

if mask is None:
mask = np.ones_like(z_, dtype=bool)
else:
mask = mask.flatten()
h = hist2d(x_[mask], y_[mask], (x_binning,
y_binning),
weights = z_[mask],
Expand Down

0 comments on commit 0991855

Please # to comment.