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
c9bc12e8
Commit
c9bc12e8
authored
8 years ago
by
tlbl
Browse files
Options
Downloads
Patches
Plain Diff
removing rfc_hist since not required anymore
parent
c6fcde50
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/fatigue_tools/rainflowcounting/rfc_hist.py
+0
-53
0 additions, 53 deletions
wetb/fatigue_tools/rainflowcounting/rfc_hist.py
with
0 additions
and
53 deletions
wetb/fatigue_tools/rainflowcounting/rfc_hist.py
deleted
100644 → 0
+
0
−
53
View file @
c6fcde50
from
__future__
import
division
from
__future__
import
unicode_literals
from
__future__
import
print_function
from
__future__
import
absolute_import
from
future
import
standard_library
standard_library
.
install_aliases
()
import
numpy
as
np
def
rfc_hist
(
sig_rf
,
nrbins
=
46
):
"""
Histogram of rainflow counted cycles
hist, bin_edges, bin_avg = rfc_hist(sig, nrbins=46)
Divide the rainflow counted cycles of a signal into equally spaced bins.
Created on Wed Feb 16 16:53:18 2011
@author: David Verelst
Modified 10.10.2011 by Mads M Pedersen to elimintate __copy__ and __eq__
Parameters
----------
sig_rf : array-like
As output by rfc_astm or rainflow
nrbins : int, optional
Divide the rainflow counted amplitudes in a number of equally spaced
bins.
Returns
-------
hist : array-like
Counted rainflow cycles per bin, has nrbins elements
bin_edges : array-like
Edges of the bins, has nrbins+1 elements.
bin_avg : array-like
Average rainflow cycle amplitude per bin, has nrbins elements.
"""
rf_half
=
sig_rf
# the Matlab approach is to divide into 46 bins
bin_edges
=
np
.
linspace
(
0
,
1
,
num
=
nrbins
+
1
)
*
rf_half
.
max
()
hist
=
np
.
histogram
(
rf_half
,
bins
=
bin_edges
)[
0
]
# calculate the average per bin
hist_sum
=
np
.
histogram
(
rf_half
,
weights
=
rf_half
,
bins
=
bin_edges
)[
0
]
# replace zeros with one, to avoid 0/0
hist_
=
hist
.
copy
()
hist_
[(
hist
==
0
).
nonzero
()]
=
1.0
# since the sum is also 0, the avg remains zero for those whos hist is zero
bin_avg
=
hist_sum
/
hist_
return
hist
,
bin_edges
,
bin_avg
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