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
5895b8b9
Commit
5895b8b9
authored
7 years ago
by
David Verelst
Browse files
Options
Downloads
Patches
Plain Diff
prepost.dlcplots: small plot fixes for robustness
parent
4376e797
No related branches found
Branches containing commit
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
+13
-5
13 additions, 5 deletions
wetb/prepost/dlcplots.py
with
13 additions
and
5 deletions
wetb/prepost/dlcplots.py
+
13
−
5
View file @
5895b8b9
...
...
@@ -15,13 +15,13 @@ standard_library.install_aliases()
#print(*objects, sep=' ', end='\n', file=sys.stdout)
import
os
import
socket
#
import socket
import
gc
import
numpy
as
np
import
matplotlib.pyplot
as
plt
#
import matplotlib as mpl
import
matplotlib
as
mpl
#from matplotlib.figure import Figure
#from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigCanvas
#from scipy import interpolate as interp
...
...
@@ -234,7 +234,7 @@ def plot_dlc_stats(df_stats, plot_chans, fig_dir_base, labels=None,
chans_ms_1hz : dict, default={}
Key/value pairs of channel and list of to be plotten m values. Channel
refers to plot title as used as the key value in plot_chans.
refers to plot title
/label
as used as the key value in plot_chans.
"""
...
...
@@ -245,7 +245,12 @@ def plot_dlc_stats(df_stats, plot_chans, fig_dir_base, labels=None,
leg
.
get_frame
().
set_alpha
(
0.7
)
title_space
=
0.0
if
title
:
fig
.
suptitle
(
'
%s %s
'
%
(
dlc_name
,
ch_dscr
))
fig_title
=
'
%s %s
'
%
(
dlc_name
,
ch_dscr
)
# FIXME: dlc_name is assumed to be not in math mode ($$), so
# escape underscores to avoid latex going bananas
if
mpl
.
rcParams
[
'
text.usetex
'
]:
fig_title
=
'
%s %s
'
%
(
dlc_name
.
replace
(
'
_
'
,
'
\\
_
'
),
ch_dscr
)
fig
.
suptitle
(
fig_title
)
title_space
=
0.02
ax
.
set_xlabel
(
xlabel
)
if
ylabels
is
not
None
:
...
...
@@ -290,7 +295,9 @@ def plot_dlc_stats(df_stats, plot_chans, fig_dir_base, labels=None,
if
not
sim_ids
:
sim_ids
=
[]
for
run_dir
in
run_dirs
:
sim_ids
.
append
(
run_dir
.
split
(
os
.
path
.
sep
)[
-
2
])
# in case this is a windows path:
tmp
=
run_dir
.
replace
(
'
\\
'
,
'
/
'
).
replace
(
'
:
'
,
''
)
sim_ids
.
append
(
tmp
.
split
(
'
/
'
)[
-
2
])
# first, take each DLC appart
for
gr_name
,
gr_dlc
in
df_stats
.
groupby
(
df_stats
[
'
[Case folder]
'
]):
...
...
@@ -432,6 +439,7 @@ def plot_dlc_stats(df_stats, plot_chans, fig_dir_base, labels=None,
ms
=
chans_ms_1hz
[
ch_dscr
]
for
im
,
m
in
enumerate
(
ms
):
# average over seed and possibly yaw angles
# wind speed or yaw inflow according to dlc case
gr_key
=
gr_ch_dlc_sid
[
key
]
d1hz
=
gr_ch_dlc_sid
[
m
].
groupby
(
gr_key
).
mean
()
...
...
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