Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Troubled Cell Detection
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Laura Christine Kühle
Troubled Cell Detection
Commits
74901fe3
Commit
74901fe3
authored
2 years ago
by
Laura Christine Kühle
Browse files
Options
Downloads
Patches
Plain Diff
Changed code to report troubled cells on fine instead of coarse grid for wavelet detection.
parent
c17369b0
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Plotting.py
+1
-1
1 addition, 1 deletion
Plotting.py
Troubled_Cell_Detector.py
+12
-12
12 additions, 12 deletions
Troubled_Cell_Detector.py
with
13 additions
and
13 deletions
Plotting.py
+
1
−
1
View file @
74901fe3
...
...
@@ -118,7 +118,7 @@ def plot_shock_tube(num_grid_cells: int, troubled_cell_history: list,
current_cells
=
troubled_cell_history
[
pos
]
for
cell
in
current_cells
:
plt
.
plot
(
cell
,
time_history
[
pos
],
'
k.
'
)
plt
.
xlim
((
0
,
num_grid_cells
//
2
))
plt
.
xlim
((
0
,
num_grid_cells
))
plt
.
xlabel
(
'
Cell
'
)
plt
.
ylabel
(
'
Time
'
)
plt
.
title
(
'
Shock Tubes
'
)
...
...
This diff is collapsed.
Click to expand it.
Troubled_Cell_Detector.py
+
12
−
12
View file @
74901fe3
...
...
@@ -3,7 +3,8 @@
@author: Laura C. Kühle, Soraya Terrab (sorayaterrab)
TODO: Adjust TCs for wavelet detectors (sliding window over all cells instead
of every second)
of every second) -> Done
TODO: Replace num_coarse_grid_cells with mesh
TODO: Introduce Adjusted Outer Fence method in Boxplot using global_mean
TODO: Introduce overlapping cell for adjacent folds in Boxplot
TODO: Introduce lower/upper extreme outliers in Boxplot
...
...
@@ -244,8 +245,7 @@ class WaveletDetector(TroubledCellDetector):
List of indices for all detected troubled cells.
"""
multiwavelet_coeffs
=
self
.
_calculate_wavelet_coeffs
(
projection
[:,
1
:
-
1
])
multiwavelet_coeffs
=
self
.
_calculate_wavelet_coeffs
(
projection
)
return
self
.
_get_cells
(
multiwavelet_coeffs
,
projection
)
def
_calculate_wavelet_coeffs
(
self
,
projection
):
...
...
@@ -263,10 +263,10 @@ class WaveletDetector(TroubledCellDetector):
"""
output_matrix
=
[]
for
i
in
range
(
self
.
_
num_coarse
_grid_cells
):
for
i
in
range
(
self
.
_
mesh
.
num
_grid_cells
):
new_entry
=
0.5
*
(
projection
[:,
2
*
i
]
@
self
.
_wavelet_projection_left
+
projection
[:,
2
*
i
+
1
]
@
self
.
_wavelet_projection_right
)
projection
[:,
i
]
@
self
.
_wavelet_projection_left
+
projection
[:,
i
+
1
]
@
self
.
_wavelet_projection_right
)
output_matrix
.
append
(
new_entry
)
return
np
.
transpose
(
np
.
array
(
output_matrix
))
...
...
@@ -377,12 +377,12 @@ class Boxplot(WaveletDetector):
"""
indexed_coeffs
=
[[
multiwavelet_coeffs
[
0
,
i
],
i
]
for
i
in
range
(
self
.
_
num_coarse
_grid_cells
)]
for
i
in
range
(
self
.
_
mesh
.
num
_grid_cells
)]
if
self
.
_
num_coarse
_grid_cells
<
self
.
_fold_len
:
self
.
_fold_len
=
self
.
_
num_coarse
_grid_cells
if
self
.
_
mesh
.
num
_grid_cells
<
self
.
_fold_len
:
self
.
_fold_len
=
self
.
_
mesh
.
num
_grid_cells
num_folds
=
self
.
_
num_coarse
_grid_cells
//
self
.
_fold_len
num_folds
=
self
.
_
mesh
.
num
_grid_cells
//
self
.
_fold_len
troubled_cells
=
[]
for
fold
in
range
(
num_folds
):
...
...
@@ -466,9 +466,9 @@ class Theoretical(WaveletDetector):
troubled_cells
=
[]
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
.
_
mesh
.
num
_grid_cells
)))
for
cell
in
range
(
self
.
_
num_coarse
_grid_cells
):
for
cell
in
range
(
self
.
_
mesh
.
num
_grid_cells
):
if
self
.
_is_troubled_cell
(
multiwavelet_coeffs
,
cell
,
max_avg
):
troubled_cells
.
append
(
cell
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment