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
2664924b
Commit
2664924b
authored
7 years ago
by
Mads M. Pedersen
Browse files
Options
Downloads
Patches
Plain Diff
rename shear coordinates to uvw in shear_file.py
parent
225aade2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
wetb/hawc2/shear_file.py
+8
-8
8 additions, 8 deletions
wetb/hawc2/shear_file.py
with
8 additions
and
8 deletions
wetb/hawc2/shear_file.py
+
8
−
8
View file @
2664924b
...
@@ -15,28 +15,28 @@ standard_library.install_aliases()
...
@@ -15,28 +15,28 @@ standard_library.install_aliases()
import
numpy
as
np
import
numpy
as
np
import
os
import
os
def
save
(
filename
,
y
_coordinates
,
z_coordinates
,
u
=
None
,
v
=
None
,
w
=
None
):
def
save
(
filename
,
x
_coordinates
,
z_coordinates
,
u
=
None
,
v
=
None
,
w
=
None
):
"""
"""
Parameters
Parameters
----------
----------
filename : str
filename : str
filename
filename
y
_coordinates : array_like
x
_coordinates : array_like
lateral coordinates
lateral coordinates
z_coordinates : array_like
z_coordinates : array_like
vertical coordinates
vertical coordinates
u : array_like, optional
u : array_like, optional
shear_u component, normalized with U_mean
\n
shear_u component, normalized with U_mean
\n
shape must be (#z_coordinates, #
y
_coordinates) or (#z_coordinates,)
shape must be (#z_coordinates, #
x
_coordinates) or (#z_coordinates,)
v : array_like, optional
v : array_like, optional
shear_v component, normalized with U_mean
\n
shear_v component, normalized with U_mean
\n
shape must be (#z_coordinates, #
y
_coordinates) or (#z_coordinates,)
shape must be (#z_coordinates, #
x
_coordinates) or (#z_coordinates,)
w : array_like, optional
w : array_like, optional
shear_w component, normalized with U_mean
\n
shear_w component, normalized with U_mean
\n
shape must be (#z_coordinates, #
y
_coordinates) or (#z_coordinates,)
shape must be (#z_coordinates, #
x
_coordinates) or (#z_coordinates,)
"""
"""
shape
=
(
len
(
z_coordinates
),
len
(
y
_coordinates
))
shape
=
(
len
(
z_coordinates
),
len
(
x
_coordinates
))
vuw
=
[
v
,
u
,
w
]
vuw
=
[
v
,
u
,
w
]
for
i
in
range
(
3
):
for
i
in
range
(
3
):
if
vuw
[
i
]
is
None
:
if
vuw
[
i
]
is
None
:
...
@@ -56,12 +56,12 @@ def save(filename, y_coordinates, z_coordinates, u=None, v=None, w=None):
...
@@ -56,12 +56,12 @@ def save(filename, y_coordinates, z_coordinates, u=None, v=None, w=None):
os
.
makedirs
(
os
.
path
.
dirname
(
filename
))
#, exist_ok=True)
os
.
makedirs
(
os
.
path
.
dirname
(
filename
))
#, exist_ok=True)
with
open
(
filename
,
'
w
'
,
encoding
=
'
utf-8
'
)
as
fid
:
with
open
(
filename
,
'
w
'
,
encoding
=
'
utf-8
'
)
as
fid
:
fid
.
write
(
"
# autogenerated shear file
\n
"
)
fid
.
write
(
"
# autogenerated shear file
\n
"
)
fid
.
write
(
"
%d %d
\n
"
%
(
len
(
y
_coordinates
),
len
(
z_coordinates
)))
fid
.
write
(
"
%d %d
\n
"
%
(
len
(
x
_coordinates
),
len
(
z_coordinates
)))
for
i
,
l
in
enumerate
([
'
v
'
,
'
u
'
,
'
w
'
]):
for
i
,
l
in
enumerate
([
'
v
'
,
'
u
'
,
'
w
'
]):
fid
.
write
(
"
# shear %s component
\n
"
%
l
)
fid
.
write
(
"
# shear %s component
\n
"
%
l
)
fid
.
write
(
"
\n
"
.
join
([
"
"
.
join
([
"
%.10f
"
%
v
for
v
in
r
])
for
r
in
vuw
[
i
]]))
fid
.
write
(
"
\n
"
.
join
([
"
"
.
join
([
"
%.10f
"
%
v
for
v
in
r
])
for
r
in
vuw
[
i
]]))
fid
.
write
(
"
\n
"
)
fid
.
write
(
"
\n
"
)
for
yz
,
coor
in
([
'
y
'
,
y
_coordinates
],
[
'
z
'
,
z_coordinates
]):
for
yz
,
coor
in
([
'
v
'
,
x
_coordinates
],
[
'
w
'
,
z_coordinates
]):
fid
.
write
(
"
# %s coordinates
\n
"
%
yz
)
fid
.
write
(
"
# %s coordinates
\n
"
%
yz
)
fid
.
write
(
"
\n
"
.
join
(
"
%.10f
"
%
v
for
v
in
coor
))
fid
.
write
(
"
\n
"
.
join
(
"
%.10f
"
%
v
for
v
in
coor
))
fid
.
write
(
"
\n
"
)
fid
.
write
(
"
\n
"
)
...
...
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