Skip to content
Snippets Groups Projects
Commit 522688a3 authored by Laura Christine Kühle's avatar Laura Christine Kühle
Browse files

Replaced 'num_coarse_grid_cells' with Mesh.

parent 74901fe3
No related branches found
No related tags found
No related merge requests found
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
TODO: Adjust TCs for wavelet detectors (sliding window over all cells instead TODO: Adjust TCs for wavelet detectors (sliding window over all cells instead
of every second) -> Done of every second) -> Done
TODO: Replace num_coarse_grid_cells with mesh TODO: Replace num_coarse_grid_cells with mesh -> Done
TODO: Introduce Adjusted Outer Fence method in Boxplot using global_mean TODO: Introduce Adjusted Outer Fence method in Boxplot using global_mean
TODO: Introduce overlapping cell for adjacent folds in Boxplot TODO: Introduce overlapping cell for adjacent folds in Boxplot
TODO: Introduce lower/upper extreme outliers in Boxplot TODO: Introduce lower/upper extreme outliers in Boxplot
...@@ -226,8 +226,7 @@ class WaveletDetector(TroubledCellDetector): ...@@ -226,8 +226,7 @@ class WaveletDetector(TroubledCellDetector):
""" """
super()._reset(config) super()._reset(config)
# Set additional necessary parameter # Set wavelet projections
self._num_coarse_grid_cells = self._mesh.num_grid_cells//2
self._wavelet_projection_left, self._wavelet_projection_right \ self._wavelet_projection_left, self._wavelet_projection_right \
= self._basis.multiwavelet_projection = self._basis.multiwavelet_projection
...@@ -311,7 +310,7 @@ class WaveletDetector(TroubledCellDetector): ...@@ -311,7 +310,7 @@ class WaveletDetector(TroubledCellDetector):
# Calculate projection on coarse mesh # Calculate projection on coarse mesh
output_matrix = [] output_matrix = []
for i in range(self._num_coarse_grid_cells): for i in range(self._mesh.num_grid_cells//2):
new_entry = 0.5 * ( new_entry = 0.5 * (
projection[:, 2 * i] @ basis_projection_left projection[:, 2 * i] @ basis_projection_left
+ projection[:, 2 * i + 1] @ basis_projection_right) + projection[:, 2 * i + 1] @ basis_projection_right)
...@@ -496,6 +495,6 @@ class Theoretical(WaveletDetector): ...@@ -496,6 +495,6 @@ class Theoretical(WaveletDetector):
for degree in range( for degree in range(
self._basis.polynomial_degree+1))/max_avg self._basis.polynomial_degree+1))/max_avg
eps = self._cutoff_factor\ eps = self._cutoff_factor\
/ (self._mesh.cell_len*self._num_coarse_grid_cells*2) / (self._mesh.cell_len*self._mesh.num_grid_cells)
return max_value > eps return max_value > eps
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment