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
af4aeb2a
There was a problem fetching the pipeline summary.
Commit
af4aeb2a
authored
7 years ago
by
David Verelst
Browse files
Options
Downloads
Patches
Plain Diff
prepost: some fixes for dlcplot related issues
parent
0c318b1e
No related branches found
No related tags found
No related merge requests found
Pipeline
#
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
wetb/prepost/dlcplots.py
+7
-3
7 additions, 3 deletions
wetb/prepost/dlcplots.py
wetb/prepost/dlctemplate.py
+3
-4
3 additions, 4 deletions
wetb/prepost/dlctemplate.py
with
10 additions
and
7 deletions
wetb/prepost/dlcplots.py
+
7
−
3
View file @
af4aeb2a
...
...
@@ -57,6 +57,9 @@ def merge_sim_ids(sim_ids, post_dirs, post_dir_save=False):
"""
# map the run_dir to the same order as the post_dirs, labels
run_dirs
=
[]
# avoid saving merged cases if there is only one!
if
type
(
sim_ids
).
__name__
==
'
list
'
and
len
(
sim_ids
)
==
1
:
sim_ids
=
sim_ids
[
0
]
# if sim_id is a list, combine the two dataframes into one
df_stats
=
pd
.
DataFrame
()
...
...
@@ -99,15 +102,16 @@ def merge_sim_ids(sim_ids, post_dirs, post_dir_save=False):
pass
else
:
fpath
=
os
.
path
.
join
(
post_dir
,
'
-
'
.
join
(
sim_ids
)
+
'
.h5
'
)
fmerged
=
fpath
.
replace
(
'
.h5
'
,
'
_statistics.h5
'
)
if
ii
==
0
:
# and save somewhere so we can add the second data frame on
# disc
df_stats
.
to_hdf
(
f
path
,
'
table
'
,
mode
=
'
w
'
,
format
=
'
table
'
,
df_stats
.
to_hdf
(
f
merged
,
'
table
'
,
mode
=
'
w
'
,
format
=
'
table
'
,
complevel
=
9
,
complib
=
'
blosc
'
)
print
(
'
%s merged stats written to: %s
'
%
(
sim_id
,
fpath
))
else
:
# instead of doing a concat in memory, add to the hdf store
df_stats
.
to_hdf
(
f
path
,
'
table
'
,
mode
=
'
r+
'
,
format
=
'
table
'
,
df_stats
.
to_hdf
(
f
merged
,
'
table
'
,
mode
=
'
r+
'
,
format
=
'
table
'
,
complevel
=
9
,
complib
=
'
blosc
'
,
append
=
True
)
print
(
'
%s merging stats into: %s
'
%
(
sim_id
,
fpath
))
# df_stats = pd.concat([df_stats, df_stats2], ignore_index=True)
...
...
@@ -453,7 +457,7 @@ def plot_dlc_stats(df_stats, plot_chans, fig_dir_base, labels=None,
mfcs3
=
[
'
r
'
,
'
w
'
]
stds
=
[
'
r
'
,
'
b
'
]
required
=
[
'
[DLC]
'
,
'
[run_dir]
'
,
'
[wdir]
'
,
'
[Windspeed]
'
]
required
=
[
'
[DLC]
'
,
'
[run_dir]
'
,
'
[wdir]
'
,
'
[Windspeed]
'
,
'
[res_dir]
'
]
cols
=
df_stats
.
columns
for
col
in
required
:
if
col
not
in
cols
:
...
...
This diff is collapsed.
Click to expand it.
wetb/prepost/dlctemplate.py
+
3
−
4
View file @
af4aeb2a
...
...
@@ -393,7 +393,8 @@ def post_launch(sim_id, statistics=True, rem_failed=True, check_logs=True,
# add_sigs = {name:expr}
# in addition, sim_id and case_id are always added by default
tags
=
[
'
[Case folder]
'
]
tags
=
[
'
[Case folder]
'
,
'
[run_dir]
'
,
'
[res_dir]
'
,
'
[DLC]
'
,
'
[wsp]
'
,
'
[Windspeed]
'
,
'
[wdir]
'
]
add
=
None
# general statistics for all channels channel
# set neq=None here to calculate 1Hz equivalent loads
...
...
@@ -538,7 +539,6 @@ if __name__ == '__main__':
P_RUN
,
P_SOURCE
,
PROJECT
,
sim_id
,
P_MASTERFILE
,
MASTERFILE
,
POST_DIR
\
=
dlcdefs
.
configure_dirs
(
verbose
=
True
)
# create HTC files and PBS launch scripts (*.p)
if
opt
.
prep
:
print
(
'
Start creating all the htc files and pbs_in files...
'
)
...
...
@@ -569,12 +569,11 @@ if __name__ == '__main__':
for
nr
in
[
1
,
2
,
3
]:
rpl
=
(
nr
,
nr
,
node_nr
,
comp
)
chans
.
append
(
'
blade%i-blade%i-node-%03i-momentvec-%s
'
%
rpl
)
plot_chans
[
'
$M_%s B123_{%
i
}$
'
%
(
comp
,
node_lab
)]
=
chans
plot_chans
[
'
$M_%s B123_{%
s
}$
'
%
(
comp
,
node_lab
)]
=
chans
chans
=
[]
# combine blade 1,2,3 pitch angle stats into a single plot
for
nr
in
[
1
,
2
,
3
]:
rpl
=
(
nr
,
nr
,
node_nr
,
comp
)
chans
.
append
(
'
bearing-pitch%i-angle-deg
'
%
nr
)
plot_chans
[
'
$B123_{pitch}$
'
]
=
chans
...
...
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