diff --git a/Troubled_Cell_Detector.py b/Troubled_Cell_Detector.py index 521629a79c082d831586c6ca504530f61ba25073..915317d2c667be3015c4315c97c82f0982806335 100644 --- a/Troubled_Cell_Detector.py +++ b/Troubled_Cell_Detector.py @@ -3,6 +3,7 @@ @author: Laura C. Kühle, Soraya Terrab (sorayaterrab) TODO: Fix cell averages and reconstructions to create data with an x-point stencil +TODO: Fix bug for max_avg calculation -> Done """ import os @@ -437,7 +438,7 @@ class Theoretical(WaveletDetector): def _get_cells(self, multiwavelet_coeffs, projection): troubled_cells = [] - max_avg = max(1, max(abs(projection[0][degree]) for degree in range(self._polynomial_degree+1))) + max_avg = np.sqrt(0.5) * max(1, max(abs(projection[0][cell+1]) for cell in range(self._num_coarse_grid_cells))) for cell in range(self._num_coarse_grid_cells): if self._is_troubled_cell(multiwavelet_coeffs, cell, max_avg):