From 2913357d984eba3f624ef8da2a0b361fc4c25ecb Mon Sep 17 00:00:00 2001 From: Abelardo Moralejo Olaizola Date: Wed, 18 Dec 2024 12:05:09 +0100 Subject: [PATCH] Avoid useless warning from rare empty pixels --- lstchain/image/cleaning.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lstchain/image/cleaning.py b/lstchain/image/cleaning.py index 37aafd586..9db70e128 100644 --- a/lstchain/image/cleaning.py +++ b/lstchain/image/cleaning.py @@ -147,6 +147,9 @@ def find_tailcuts(input_dir, run_number): median_pix_charge_dev = median_abs_deviation(charges_pedestals, axis=0, nan_policy='omit') + # Avoid later warnings from empty pixels: + median_pix_charge_dev = np.where(median_pix_charge_dev > 0, + median_pix_charge_dev, np.nan) # Just a cut to remove outliers (pixels): outliers = (np.abs(charges_pedestals - median_pix_charge) / median_pix_charge_dev) > mad_max