Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VirtFlow_GUI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
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
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
Andreas Weissenbrunner
VirtFlow_GUI
Commits
40b16745
Commit
40b16745
authored
Nov 3, 2022
by
Andreas Weissenbrunner
Browse files
Options
Downloads
Patches
Plain Diff
version with k-factor and scaled meter plot
parent
c2e29a78
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
Flow_class.py
+1
-1
1 addition, 1 deletion
Flow_class.py
GUI_Elbow.py
+43
-9
43 additions, 9 deletions
GUI_Elbow.py
with
44 additions
and
10 deletions
Flow_class.py
+
1
−
1
View file @
40b16745
...
...
@@ -453,7 +453,7 @@ class Elbow_profile():
def
make_kfac_fully
(
self
,
flowmeter
=
None
,
ret
=
False
):
rfine
=
np
.
linspace
(
0
,
1
,
int
(
1e6
))
ufine
=
self
.
fully_class
.
get_u_u_vol
(
rfine
)
self
.
up_fully
=
np
.
trapz
(
r
fine
,
u
fine
)
self
.
up_fully
=
np
.
trapz
(
u
fine
,
r
fine
)
self
.
k_fully
=
1
/
self
.
up_fully
if
ret
:
return
self
.
up_fully
,
self
.
k_fully
...
...
This diff is collapsed.
Click to expand it.
GUI_Elbow.py
+
43
−
9
View file @
40b16745
...
...
@@ -332,7 +332,7 @@ class mainPanel(wx.Panel):
self
.
xax_dropdown
.
SetSelection
(
0
)
self
.
xax_dropdown
.
Bind
(
wx
.
EVT_CHOICE
,
self
.
Onxax_dropdown
)
# y-axis choices
self
.
yax_dropdown
=
wx
.
Choice
(
self
,
choices
=
[
"
error in %
"
,
"
k
"
,
"
k_d
is
"
,
"
k_st
"
])
self
.
yax_dropdown
=
wx
.
Choice
(
self
,
choices
=
[
"
error in %
"
,
"
k
"
,
"
k_d
"
])
self
.
yax_dropdown
.
SetSelection
(
0
)
self
.
yax_dropdown
.
Bind
(
wx
.
EVT_CHOICE
,
self
.
Onyax_dropdown
)
# add the axes choices and labels to a hbox
...
...
@@ -710,25 +710,59 @@ class mainPanel(wx.Panel):
x
=
0
y
=
0
xlabel
=
""
y
*=
100
plot_what
=
self
.
yax_dropdown
.
GetSelection
()
spreadfac
=
1
ylimiter
=
0.02
if
plot_what
==
0
:
y
*=
flow
.
k_fully
*
100
y_u
*=
100
spreadfac
=
100
ylabel
=
"
Error in %
"
elif
plot_what
==
1
:
# this is k-factor
y
=
1
/
(
y
+
flow
.
up_fully
)
ylabel
=
"
Callibration factor k_p
"
elif
plot_what
==
2
:
# this is k_st-factor
y
=
flow
.
up_fully
/
(
y
+
flow
.
up_fully
)
ylabel
=
"
Correction factor k_d
"
else
:
print
(
"
no axes selected
"
)
x
=
0
y
=
0
ylabel
=
""
ylimiter
*=
spreadfac
self
.
ax_meter
.
cla
()
#
self
.
ax_meter
.
set_xlabel
(
xlabel
)
self
.
ax_meter
.
set_ylabel
(
"
Error in %
"
)
self
.
ax_meter
.
set_ylabel
(
ylabel
)
self
.
ax_meter
.
plot
(
x
,
y
,
'
-
'
)
ymin
=
self
.
ax_meter
.
get_ylim
()[
0
]
ymax
=
self
.
ax_meter
.
get_ylim
()[
1
]
ydiff
=
ymax
-
ymin
print
(
ydiff
)
if
ydiff
<
ylimiter
:
ymin
=
self
.
ax_meter
.
get_ylim
()[
0
]
-
(
ylimiter
-
ydiff
)
/
2
ymax
=
self
.
ax_meter
.
get_ylim
()[
1
]
+
(
ylimiter
-
ydiff
)
/
2
# print("min")
# print(ymin)
# print("max")
# print(ymax)
self
.
ax_meter
.
set_ylim
(
ymin
,
ymax
)
#
# the line-plot of the selected parameter within the x axes
self
.
ax_meter
.
plot
([
x_selected
,
x_selected
],[
ymin
,
ymax
],
'
r-
'
,
linewidth
=
1
)
if
y_u
.
any
():
self
.
ax_meter
.
fill_between
(
x
,
y
-
y_u
,
y
+
y_u
,
facecolor
=
'
green
'
,
alpha
=
0.3
,
interpolate
=
True
,
label
=
"
std
"
)
self
.
ax_meter
.
text
(
x_selected
,
self
.
ax_meter
.
get_ylim
()[
0
]
,
"
"
+
str
(
np
.
round
(
np
.
interp
(
x_selected
,
x
,
y
),
2
))
+
"
|
"
+
str
(
np
.
round
(
np
.
interp
(
x_selected
,
x
,
y_u
),
2
)),
fontsize
=
14
,
color
=
'
r
'
)
self
.
ax_meter
.
text
(
x_selected
,
ymin
,
"
"
+
str
(
np
.
round
(
np
.
interp
(
x_selected
,
x
,
y
),
2
))
+
"
|
"
+
str
(
np
.
round
(
np
.
interp
(
x_selected
,
x
,
y_u
),
2
)),
fontsize
=
14
,
color
=
'
r
'
)
else
:
self
.
ax_meter
.
text
(
x_selected
,
min
(
y
),
"
"
+
str
(
np
.
round
(
np
.
interp
(
x_selected
,
x
,
y
),
2
)),
fontsize
=
14
,
color
=
'
r
'
)
#
# the line-plot of the selected parameter within the x axes
self
.
ax_meter
.
plot
([
x_selected
,
x_selected
],
self
.
ax_meter
.
get_ylim
(),
'
r-
'
,
linewidth
=
1
)
self
.
ax_meter
.
text
(
x_selected
,
ymin
,
"
"
+
str
(
np
.
round
(
np
.
interp
(
x_selected
,
x
,
y
),
2
)),
fontsize
=
14
,
color
=
'
r
'
)
self
.
ax_meter
.
grid
(
"
on
"
)
self
.
fig_meter
.
tight_layout
()
self
.
canvas_meter
.
draw
()
...
...
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