diff --git a/CAL/CalibrationProcessing/lib/processing/averaging.py b/CAL/CalibrationProcessing/lib/processing/averaging.py index 791bdae16c5d2d5cc07316d51908e5b872a0d6f0..8696ef5d6f1d6048502b53656266f11cd4fcb469 100644 --- a/CAL/CalibrationProcessing/lib/processing/averaging.py +++ b/CAL/CalibrationProcessing/lib/processing/averaging.py @@ -20,7 +20,7 @@ def average_values_by_sample(data_array, window_size, field_name=None): :rtype: numpy.ndarray """ - new_array_size = _round_up_size(len(data_array), window_size) + new_array_size = _compute_size_of_new_array(len(data_array), window_size) # select the right field if field_name is not None: @@ -132,7 +132,7 @@ def average_datatable_by_sample(data_table_in, window_size): :return: the array with the averaged values and the array with the standard deviations :rtype: dict(str:numpy.ndarray) """ - new_array_size = _round_up_size(len(data_table_in), window_size) + new_array_size = _compute_size_of_new_array(len(data_table_in), window_size) result = _average_datatable_with_function(data_table_in, window_size, new_array_size, @@ -167,7 +167,7 @@ def average_datatable_by_time_interval(data_table_in, time_interval): average_samples_dt) window_size = 1 logging.debug('averaging with a sample size of %s', window_size) - new_array_size = _round_up_size(len(data_table_in), window_size) + new_array_size = _compute_size_of_new_array(len(data_table_in), window_size) result = _average_datatable_with_function(data_table_in, window_size, new_array_size, @@ -299,7 +299,7 @@ def average_dataset_by_time(input_data_set, time_interval): return dataset -def _round_up_size(array_size, window_size): +def _compute_size_of_new_array(array_size, window_size): """ Round up the array size given a window size. If array_size % window_size = 0 it returns array_size/window_size