Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
empyre
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
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Teresa Weßels
empyre
Commits
8004191d
Commit
8004191d
authored
11 years ago
by
Jörn Ungermann
Browse files
Options
Downloads
Patches
Plain Diff
fixed some pep8 violations
parent
74619d30
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pyramid/analytic.py
+8
-8
8 additions, 8 deletions
pyramid/analytic.py
pyramid/numcore/c1.pyx
+7
-7
7 additions, 7 deletions
pyramid/numcore/c1.pyx
with
15 additions
and
15 deletions
pyramid/analytic.py
+
8
−
8
View file @
8004191d
...
...
@@ -64,10 +64,10 @@ def phase_mag_disc(dim, res, beta, center, radius, height, b_0=1):
'''
# Function for the phase:
def
phiMag
(
x
,
y
):
r
=
np
.
hypot
(
x
-
x0
,
y
-
y0
)
r
=
np
.
hypot
(
x
-
x0
,
y
-
y0
)
r
[
center
[
1
],
center
[
2
]]
=
1E-30
result
=
coeff
*
Lz
*
((
y
-
y0
)
*
np
.
cos
(
beta
)
-
(
x
-
x0
)
*
np
.
sin
(
beta
))
result
*=
np
.
where
(
r
<=
R
,
1
,
(
R
/
r
)
**
2
)
result
=
coeff
*
Lz
*
((
y
-
y0
)
*
np
.
cos
(
beta
)
-
(
x
-
x0
)
*
np
.
sin
(
beta
))
result
*=
np
.
where
(
r
<=
R
,
1
,
(
R
/
r
)
**
2
)
return
result
# Process input parameters:
z_dim
,
y_dim
,
x_dim
=
dim
...
...
@@ -97,10 +97,10 @@ def phase_mag_sphere(dim, res, beta, center, radius, b_0=1):
'''
# Function for the phase:
def
phiMag
(
x
,
y
):
r
=
np
.
hypot
(
x
-
x0
,
y
-
y0
)
r
=
np
.
hypot
(
x
-
x0
,
y
-
y0
)
r
[
center
[
1
],
center
[
2
]]
=
1E-30
result
=
coeff
*
R
**
3
/
r
**
2
*
((
y
-
y0
)
*
np
.
cos
(
beta
)
-
(
x
-
x0
)
*
np
.
sin
(
beta
))
result
*=
np
.
where
(
r
>
R
,
1
,
(
1
-
(
1
-
(
r
/
R
)
**
2
)
**
(
3.
/
2.
)))
result
=
coeff
*
R
**
3
/
r
**
2
*
((
y
-
y0
)
*
np
.
cos
(
beta
)
-
(
x
-
x0
)
*
np
.
sin
(
beta
))
result
*=
np
.
where
(
r
>
R
,
1
,
(
1
-
(
1
-
(
r
/
R
)
**
2
)
**
(
3.
/
2.
)))
return
result
# Process input parameters:
z_dim
,
y_dim
,
x_dim
=
dim
...
...
@@ -109,8 +109,8 @@ def phase_mag_sphere(dim, res, beta, center, radius, b_0=1):
R
=
res
*
radius
coeff
=
-
2.
/
3.
*
pi
*
b_0
/
PHI_0
# Create grid:
x
=
np
.
linspace
(
res
/
2
,
x_dim
*
res
-
res
/
2
,
num
=
x_dim
)
y
=
np
.
linspace
(
res
/
2
,
y_dim
*
res
-
res
/
2
,
num
=
y_dim
)
x
=
np
.
linspace
(
res
/
2
,
x_dim
*
res
-
res
/
2
,
num
=
x_dim
)
y
=
np
.
linspace
(
res
/
2
,
y_dim
*
res
-
res
/
2
,
num
=
y_dim
)
xx
,
yy
=
np
.
meshgrid
(
x
,
y
)
# Return phase:
return
phiMag
(
xx
,
yy
)
This diff is collapsed.
Click to expand it.
pyramid/numcore/c1.pyx
+
7
−
7
View file @
8004191d
import
math
def
great_circle
(
float
lon1
,
float
lat1
,
float
lon2
,
float
lat2
):
def
great_circle
(
float
lon1
,
float
lat1
,
float
lon2
,
float
lat2
):
cdef
float
radius
=
3956.0
cdef
float
pi
=
3.14159265
cdef
float
x
=
pi
/
180.0
cdef
float
a
,
b
,
theta
,
c
cdef
float
x
=
pi
/
180.0
cdef
float
a
,
b
,
theta
,
c
a
=
(
90.0
-
lat1
)
*
(
x
)
b
=
(
90.0
-
lat2
)
*
(
x
)
theta
=
(
lon2
-
lon1
)
*
(
x
)
a
=
(
90.0
-
lat1
)
*
(
x
)
b
=
(
90.0
-
lat2
)
*
(
x
)
theta
=
(
lon2
-
lon1
)
*
(
x
)
c
=
math
.
acos
((
math
.
cos
(
a
)
*
math
.
cos
(
b
))
+
(
math
.
sin
(
a
)
*
math
.
sin
(
b
)
*
math
.
cos
(
theta
)))
return
radius
*
c
\ No newline at end of file
return
radius
*
c
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