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
eb1ec872
There was a problem fetching the pipeline summary.
Commit
eb1ec872
authored
7 years ago
by
Mads M. Pedersen
Browse files
Options
Downloads
Patches
Plain Diff
rads2rpm implemented
parent
549b3755
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/utils/geometry.py
+5
-1
5 additions, 1 deletion
wetb/utils/geometry.py
wetb/utils/tests/test_geometry.py
+6
-1
6 additions, 1 deletion
wetb/utils/tests/test_geometry.py
with
11 additions
and
2 deletions
wetb/utils/geometry.py
+
5
−
1
View file @
eb1ec872
...
...
@@ -88,4 +88,8 @@ def std_rad(dir):
return
np
.
sqrt
(
1
-
(
np
.
nanmean
(
np
.
sin
(
dir
))
**
2
+
np
.
nanmean
(
np
.
cos
(
dir
))
**
2
))
def
rpm2rads
(
rpm
):
return
rpm
*
2
*
np
.
pi
/
60
\ No newline at end of file
return
rpm
*
2
*
np
.
pi
/
60
def
rads2rpm
(
rads
):
return
rads
/
(
2
*
np
.
pi
)
*
60
\ No newline at end of file
This diff is collapsed.
Click to expand it.
wetb/utils/tests/test_geometry.py
+
6
−
1
View file @
eb1ec872
...
...
@@ -13,7 +13,8 @@ import unittest
import
numpy
as
np
from
wetb.utils.geometry
import
rad
,
deg
,
mean_deg
,
sind
,
cosd
,
std_deg
,
tand
from
wetb.utils.geometry
import
rad
,
deg
,
mean_deg
,
sind
,
cosd
,
std_deg
,
tand
,
\
rpm2rads
,
rads2rpm
import
os
...
...
@@ -67,6 +68,10 @@ class TestGeometry(unittest.TestCase):
def
test_std_deg_nan
(
self
):
self
.
assertAlmostEqual
(
std_deg
(
np
.
array
([
0
,
90
,
180
,
270
,
np
.
nan
])),
57.296
,
2
)
def
test_rpm2rads
(
self
):
self
.
assertAlmostEqual
(
rpm2rads
(
1
),.
1047
,
4
)
self
.
assertAlmostEqual
(
rads2rpm
(
rpm2rads
(
1
)),
1
)
if
__name__
==
"
__main__
"
:
...
...
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