From 2cfb3a6fbf84d14107123a39e5e269cc978afdf1 Mon Sep 17 00:00:00 2001 From: "J.J. Gomez-Cadenas" Date: Sun, 10 Jun 2018 18:41:41 +0200 Subject: [PATCH] 480 Flatten mask in display_matrix https://github.com/nextic/IC/pull/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. --- invisible_cities/icaro/hst_functions.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/invisible_cities/icaro/hst_functions.py b/invisible_cities/icaro/hst_functions.py index 968ba1c3e9..38dbd865b8 100644 --- a/invisible_cities/icaro/hst_functions.py +++ b/invisible_cities/icaro/hst_functions.py @@ -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],