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
4ea3b35a
Commit
4ea3b35a
authored
8 years ago
by
David Verelst
Browse files
Options
Downloads
Patches
Plain Diff
prepost: add convenience interface for calculating stats+del per file
parent
7873d7be
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/statsdel.py
+56
-0
56 additions, 0 deletions
wetb/prepost/statsdel.py
with
56 additions
and
0 deletions
wetb/prepost/statsdel.py
0 → 100644
+
56
−
0
View file @
4ea3b35a
# -*- coding: utf-8 -*-
"""
Created on Thu Jul 21 15:13:38 2016
@author: dave
"""
from
__future__
import
print_function
from
__future__
import
division
from
__future__
import
unicode_literals
from
__future__
import
absolute_import
#from builtins import dict
#from io import open
#from builtins import zip
#from builtins import range
#from builtins import str
#from builtins import int
from
future
import
standard_library
standard_library
.
install_aliases
()
import
os
from
wetb.prepost
import
windIO
def
calc
(
fpath
,
no_bins
=
46
,
m
=
[
3
,
4
,
6
,
8
,
10
,
12
],
neq
=
None
,
i0
=
0
,
i1
=
None
,
ftype
=
False
,
fsave
=
False
):
"""
Should we load m, statchans, delchans from another file? This function
will be called from a PBS script.
"""
if
fpath
[
-
4
:]
==
'
.sel
'
or
fpath
[
-
4
:]
==
'
.dat
'
:
fpath
=
fpath
[
-
4
:]
fdir
=
os
.
path
.
dirname
(
fpath
)
fname
=
os
.
path
.
basename
(
fpath
)
res
=
windIO
.
LoadResults
(
fdir
,
fname
,
debug
=
False
,
usecols
=
None
,
readdata
=
True
)
statsdel
=
res
.
statsdel_df
(
i0
=
i0
,
i1
=
i1
,
statchans
=
'
all
'
,
neq
=
neq
,
no_bins
=
no_bins
,
m
=
m
,
delchans
=
'
all
'
)
if
fsave
:
if
fsave
[
-
4
:]
==
'
.csv
'
:
statsdel
.
to_csv
(
fsave
)
elif
fsave
[
-
3
:]
==
'
.h5
'
:
statsdel
.
to_hdf
(
fsave
,
'
table
'
,
complib
=
'
zlib
'
,
complevel
=
9
)
elif
ftype
==
'
.csv
'
:
statsdel
.
to_csv
(
fpath
+
ftype
)
elif
ftype
==
'
.h5
'
:
statsdel
.
to_hdf
(
fpath
+
ftype
,
'
table
'
,
complib
=
'
zlib
'
,
complevel
=
9
)
if
__name__
==
'
__main__
'
:
pass
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