From 63d61ab584ee29704bea2fd7079ad25d87789b95 Mon Sep 17 00:00:00 2001 From: Abelardo Moralejo Date: Tue, 4 Jul 2023 14:28:55 +0200 Subject: [PATCH] Change way to access monitoring info in dl1 file The former approach np.array(f.root[].cols.charge_mean) results now in an attempt to allocate a huge array (instead of just 2x2x1855), and hence a crash. No idea when or why the change of behaviour happened - could it be because of some change in pytables? --- lstchain/calib/camera/pixel_threshold_estimation.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lstchain/calib/camera/pixel_threshold_estimation.py b/lstchain/calib/camera/pixel_threshold_estimation.py index 8ebfd390b0..c8cc98ad79 100644 --- a/lstchain/calib/camera/pixel_threshold_estimation.py +++ b/lstchain/calib/camera/pixel_threshold_estimation.py @@ -24,10 +24,10 @@ def get_bias_and_std(dl1_file): """ with tables.open_file(dl1_file) as f: ped = f.root[dl1_params_tel_mon_ped_key] - ped_charge_mean = np.array(ped.cols.charge_mean) - ped_charge_std = np.array(ped.cols.charge_std) + ped_charge_mean = ped.col('charge_mean') + ped_charge_std = ped.col('charge_std') calib = f.root[dl1_params_tel_mon_cal_key] - dc_to_pe = np.array(calib.cols.dc_to_pe[ORIGINAL_CALIBRATION_ID]) + dc_to_pe = calib.col('dc_to_pe')[ORIGINAL_CALIBRATION_ID] ped_charge_mean_pe = ped_charge_mean * dc_to_pe ped_charge_std_pe = ped_charge_std * dc_to_pe