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
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
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
toolbox
WindEnergyToolbox
Commits
931385ea
Commit
931385ea
authored
6 years ago
by
David Verelst
Browse files
Options
Downloads
Patches
Plain Diff
prepost: plotting updates, and minor change in test
parent
06ce9420
No related branches found
No related tags found
No related merge requests found
Pipeline
#6732
passed
6 years ago
Stage: test
Stage: deploy
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
wetb/prepost/mplutils.py
+16
-7
16 additions, 7 deletions
wetb/prepost/mplutils.py
wetb/prepost/tests/test_Simulations.py
+1
-1
1 addition, 1 deletion
wetb/prepost/tests/test_Simulations.py
with
17 additions
and
8 deletions
wetb/prepost/mplutils.py
+
16
−
7
View file @
931385ea
...
...
@@ -142,12 +142,12 @@ def one_legend(*args, **kwargs):
return
leg
def
p4psd
(
ax
,
rpm_mean
,
p_
max
=
1
7
,
y_pos_rel
=
0.25
,
color
=
'
g
'
,
ls
=
'
--
'
,
def
p4psd
(
ax
,
rpm_mean
,
f
max
=
1
0
,
y_pos_rel
=
0.25
,
color
=
'
g
'
,
ls
=
'
--
'
,
ps
=
None
,
col_text
=
'
w
'
):
"""
Add the P
'
s on a PSD
f
n_
max is the maximum value on the plot (ax.xlim). This only works when
fmax is the maximum value on the plot (ax.xlim). This only works when
setting the xlim of the plot before calling p4psd.
Parameters
...
...
@@ -157,22 +157,31 @@ def p4psd(ax, rpm_mean, p_max=17, y_pos_rel=0.25, color='g', ls='--',
rpm_mean
p_max : int, default=17
fmax : int, default=17
stop plotting p
'
s after fmax (when ps is None)
ps : iterable of ints, default=None
specify which p
'
s to plot (ignores fmax)
y_pos_rel : int or list, default=0.25
"""
if
ps
is
None
:
pmax
=
int
(
60
*
fmax
/
rpm_mean
)
ps
=
list
(
range
(
1
,
pmax
))
else
:
pmax
=
len
(
ps
)
if
isinstance
(
y_pos_rel
,
float
)
or
isinstance
(
y_pos_rel
,
int
):
y_pos_rel
=
[
y_pos_rel
]
*
p
_
max
y_pos_rel
=
[
y_pos_rel
]
*
pmax
f_min
=
ax
.
get_xlim
()[
0
]
f_max
=
ax
.
get_xlim
()[
1
]
# add the P's
bbox
=
dict
(
boxstyle
=
"
round
"
,
edgecolor
=
color
,
facecolor
=
color
)
for
i
,
p
in
enumerate
(
range
(
1
,
p_max
)
):
for
i
,
p
in
enumerate
(
ps
):
p_freq
=
p
*
rpm_mean
/
60.0
if
p_freq
>
f_max
:
break
if
p
%
3
==
0
:
alpha
=
0.5
ax
.
axvline
(
x
=
p_freq
,
linewidth
=
1
,
color
=
color
,
alpha
=
0.7
,
ls
=
ls
)
...
...
This diff is collapsed.
Click to expand it.
wetb/prepost/tests/test_Simulations.py
+
1
−
1
View file @
931385ea
...
...
@@ -63,7 +63,7 @@ class TestGenerateInputs(Template):
shutil
.
rmtree
(
os
.
path
.
join
(
p_root
,
tmpl
.
PROJECT
,
'
remote
'
))
tmpl
.
force_dir
=
tmpl
.
P_RUN
tmpl
.
launch_dlcs_excel
(
'
remote
'
,
silent
=
True
,
runmethod
=
'
gorm
'
,
tmpl
.
launch_dlcs_excel
(
'
remote
'
,
silent
=
True
,
runmethod
=
'
pbs
'
,
pbs_turb
=
True
,
zipchunks
=
True
,
postpro_node_zipchunks
=
False
,
postpro_node
=
False
)
...
...
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