Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
WindEnergyToolbox
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
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
wtlib
WindEnergyToolbox
Commits
749b1d47
Commit
749b1d47
authored
9 years ago
by
David Verelst
Browse files
Options
Downloads
Patches
Plain Diff
h2_vs_hs2: absolute errors for powercurve H2-HS2, improved legend handling icw errorbar
parent
83f08682
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
wetb/prepost/h2_vs_hs2.py
+27
-21
27 additions, 21 deletions
wetb/prepost/h2_vs_hs2.py
with
27 additions
and
21 deletions
wetb/prepost/h2_vs_hs2.py
+
27
−
21
View file @
749b1d47
...
...
@@ -1007,9 +1007,9 @@ class Plots(object):
wind_h2
=
results
.
pwr_h2_mean
[
'
windspeed
'
].
values
wind_hs
=
results
.
pwr_hs
[
'
windspeed
'
].
values
# POWER
# POWER
---------------------------------------------------------------
ax
=
axes
[
0
]
ax
.
set_title
(
'
Power [kW]
'
)
# HAWC2
keys
=
[
'
P_aero
'
,
'
P_mech
'
]
lss
=
[
self
.
h2ls
,
'
--
'
,
'
:
'
]
...
...
@@ -1023,25 +1023,30 @@ class Plots(object):
c
=
self
.
h2c
ax
.
errorbar
(
wind_h2
,
results
.
pwr_h2_mean
[
key
].
values
,
color
=
c
,
ls
=
ls
,
label
=
label
,
alpha
=
0.9
,
yerr
=
yerr
,
marker
=
self
.
h2ms
)
# HAWCSTAB2
key
=
'
P_aero
'
ax
.
plot
(
wind_hs
,
results
.
pwr_hs
[
key
].
values
,
label
=
'
HAWCStab2
'
,
alpha
=
0.7
,
color
=
self
.
hsc
,
ls
=
self
.
hsls
,
marker
=
self
.
hsms
)
ax
.
set_title
(
'
Power [kW]
'
)
#
relative
errors on the right axes
# errors on the right axes
axr
=
ax
.
twinx
()
assert
np
.
allclose
(
wind_h2
,
wind_hs
)
qq1
=
results
.
pwr_h2_mean
[
key
].
values
qq2
=
results
.
pwr_hs
[
key
].
values
err
=
np
.
abs
(
1.0
-
qq1
/
qq2
)
*
100.0
err
=
qq1
-
qq2
axr
.
plot
(
wind_hs
,
err
,
color
=
self
.
errc
,
ls
=
self
.
errls
,
alpha
=
0.6
,
label
=
self
.
errlab
)
# axr.set_ylabel('absolute error []')
# axr.set_ylim([])
label
=
self
.
errlab
+
'
P$_{aero}$
'
)
ax
.
set_xlim
([
wind_h2
.
min
(),
wind_h2
.
max
()])
# THRUST
# legends
lines
,
labels
=
ax
.
get_legend_handles_labels
()
linesr
,
labelsr
=
axr
.
get_legend_handles_labels
()
leg
=
axr
.
legend
(
lines
+
linesr
,
labels
+
labelsr
,
loc
=
'
lower right
'
)
leg
.
get_frame
().
set_alpha
(
0.5
)
# THRUST --------------------------------------------------------------
ax
=
axes
[
1
]
ax
.
set_title
(
'
Thrust [kN]
'
)
keys
=
[
'
T_aero
'
,
'
T_shafttip
'
]
lss
=
[
self
.
h2ls
,
'
--
'
,
'
:
'
]
# HAWC2
...
...
@@ -1054,22 +1059,23 @@ class Plots(object):
# HAWCStab2
ax
.
plot
(
wind_hs
,
results
.
pwr_hs
[
'
T_aero
'
].
values
,
color
=
self
.
hsc
,
alpha
=
0.7
,
label
=
'
HAWCStab2 T$_{aero}$
'
,
marker
=
self
.
hsms
,
ls
=
self
.
hsls
)
# relative errors on the right axes
# errors on the right axes
axr
=
ax
.
twinx
()
qq1
=
results
.
pwr_h2_mean
[
'
T_aero
'
].
values
qq2
=
results
.
pwr_hs
[
'
T_aero
'
].
values
err
=
np
.
abs
(
1.0
-
(
qq1
/
qq2
))
*
100.0
err
=
qq1
-
qq2
axr
.
plot
(
wind_hs
,
err
,
color
=
self
.
errc
,
ls
=
self
.
errls
,
alpha
=
0.6
,
label
=
self
.
errlab
)
ax
.
set_
title
(
'
Thrust [kN]
'
)
label
=
self
.
errlab
+
'
T$_{aero}$
'
)
ax
.
set_
xlim
([
wind_h2
.
min
(),
wind_h2
.
max
()]
)
axes
=
self
.
set_axes_label_grid
(
axes
,
setlegend
=
True
)
#
# use axr for the legend
#
keys_tex = [kk.replace('_', '$_{') + '}$' for kk in keys]
#
l
ines
=
[
ax.l
ines[2]] + [ax.lines[5]] + [ax.lines[6]] + axr.lines
#
l
abels = keys_tex + ['HAWCStab2 T$_{aero}$', self.errlab]
# leg = axr.legend(lines, labels, loc='best')
#
leg.get_frame().set_alpha(0.5
)
# legends
lines
,
labels
=
ax
.
get_legend_handles_labels
()
linesr
,
labelsr
=
axr
.
get_legend_handles_labels
()
l
eg
=
ax
r
.
l
egend
(
lines
+
linesr
,
labels
+
labelsr
,
loc
=
'
lower right
'
)
l
eg
.
get_frame
().
set_alpha
(
0.5
)
axes
=
self
.
set_axes_label_grid
(
axes
,
setlegend
=
False
)
return
fig
,
axes
...
...
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