diff --git a/hexrdgui/scaling.py b/hexrdgui/scaling.py index 53b57c3b8..71e7522be 100644 --- a/hexrdgui/scaling.py +++ b/hexrdgui/scaling.py @@ -12,14 +12,23 @@ def none(x): def sqrt(x): + if isinstance(x, np.ma.masked_array): + return np.sqrt(x.filled(np.nan) - + np.nanmin(x.filled(np.nan))) return np.sqrt(x - np.nanmin(x)) def log(x): + if isinstance(x, np.ma.masked_array): + return np.log(x.filled(np.nan) - + np.nanmin(x.filled(np.nan)) + 1) return np.log(x - np.nanmin(x) + 1) def log_log_sqrt(x): + if isinstance(x, np.ma.masked_array): + return np.log(np.log(np.sqrt(x.filled(np.nan) - + np.nanmin(x.filled(np.nan))) + 1) + 1) return np.log(np.log(np.sqrt(x - np.nanmin(x)) + 1) + 1)