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
shfe1
WindEnergyToolbox
Commits
1a298984
Commit
1a298984
authored
7 years ago
by
David Verelst
Browse files
Options
Downloads
Patches
Plain Diff
prepost.dlcplots: small fixes
parent
997f9b48
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
wetb/prepost/dlcplots.py
+16
-5
16 additions, 5 deletions
wetb/prepost/dlcplots.py
with
16 additions
and
5 deletions
wetb/prepost/dlcplots.py
+
16
−
5
View file @
1a298984
...
...
@@ -76,8 +76,12 @@ def merge_sim_ids(sim_ids, post_dirs, post_dir_save=False):
wsp
=
'
[wsp]
'
else
:
wsp
=
'
[Windspeed]
'
dfc
=
dfc
[[
'
[case_id]
'
,
'
[run_dir]
'
,
wsp
,
'
[res_dir]
'
,
'
[wdir]
'
,
'
[DLC]
'
]]
# columns we want to add from cc.cases (cases dict) to stats
cols_cc
=
set
([
'
[run_dir]
'
,
wsp
,
'
[res_dir]
'
,
'
[wdir]
'
,
'
[DLC]
'
])
# do not add column twice, some might already be in df stats
add_cols
=
list
(
cols_cc
-
set
(
df_stats
.
columns
))
add_cols
.
append
(
'
[case_id]
'
)
dfc
=
dfc
[
add_cols
]
df_stats
=
pd
.
merge
(
df_stats
,
dfc
,
on
=
'
[case_id]
'
)
df_stats
.
rename
(
columns
=
{
wsp
:
'
[Windspeed]
'
},
inplace
=
True
)
...
...
@@ -118,6 +122,8 @@ def merge_sim_ids(sim_ids, post_dirs, post_dir_save=False):
sim_id
=
sim_ids
sim_ids
=
[
sim_id
]
post_dir
=
post_dirs
if
isinstance
(
post_dirs
,
list
):
post_dir
=
post_dirs
[
0
]
cc
=
sim
.
Cases
(
post_dir
,
sim_id
,
rem_failed
=
True
)
df_stats
,
_
,
_
=
cc
.
load_stats
(
leq
=
False
)
run_dirs
=
[
df_stats
[
'
[run_dir]
'
].
unique
()[
0
]]
...
...
@@ -129,8 +135,12 @@ def merge_sim_ids(sim_ids, post_dirs, post_dir_save=False):
wsp
=
'
[wsp]
'
else
:
wsp
=
'
[Windspeed]
'
dfc
=
dfc
[[
'
[case_id]
'
,
'
[run_dir]
'
,
wsp
,
'
[res_dir]
'
,
'
[wdir]
'
,
'
[DLC]
'
]]
# columns we want to add from cc.cases (cases dict) to stats
cols_cc
=
set
([
'
[run_dir]
'
,
wsp
,
'
[res_dir]
'
,
'
[wdir]
'
,
'
[DLC]
'
])
# do not add column twice, some might already be in df stats
add_cols
=
list
(
cols_cc
-
set
(
df_stats
.
columns
))
add_cols
.
append
(
'
[case_id]
'
)
dfc
=
dfc
[
add_cols
]
df_stats
=
pd
.
merge
(
df_stats
,
dfc
,
on
=
'
[case_id]
'
)
df_stats
.
rename
(
columns
=
{
wsp
:
'
[Windspeed]
'
},
inplace
=
True
)
...
...
@@ -348,7 +358,6 @@ def plot_stats(sim_ids, post_dirs, fig_dir_base=None):
fig
.
clear
()
print
(
'
saved: %s
'
%
fig_path
)
ax2
.
grid
()
ax2
.
set_xlim
([
3
,
27
])
leg
=
ax2
.
legend
(
loc
=
'
best
'
,
ncol
=
2
)
...
...
@@ -972,6 +981,7 @@ class PlotPerf(object):
print
(
'
done
'
)
self
.
fig
.
clear
()
def
plot_dlc01_powercurve
(
sim_ids
,
post_dirs
,
run_dirs
,
fig_dir_base
):
"""
Create power curve based on steady DLC01 results
...
...
@@ -1029,6 +1039,7 @@ def plot_dlc00(sim_ids, post_dirs, run_dirs, fig_dir_base=None, labels=None,
fig_path
=
os
.
path
.
join
(
fig_dir_base
,
dlcf
)
fp
.
final
(
fig_path
,
_cname
.
replace
(
'
.htc
'
,
'
.png
'
))
def
plot_staircase
(
sim_ids
,
post_dirs
,
run_dirs
,
fig_dir_base
=
None
,
cname
=
'
dlc00_stair_wsp04_25_noturb.htc
'
):
"""
...
...
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