Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
sec23
korte
pymagglobal
Commits
86df9cd5
Commit
86df9cd5
authored
Oct 20, 2021
by
Maximilian Schanner
Browse files
Add a twopi argument two get_z_at, to remove duplicates if necessary.
parent
47c6806f
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
CHANGELOG
View file @
86df9cd5
...
...
@@ -3,6 +3,7 @@ Changelog
2021-10-20 v1.1.1
-----------------
* Correct documentation of equi_sph
* Add a twopi argument to get_z_at
2021-08-25 v1.1.0
-----------------
...
...
pymagglobal/utils.py
View file @
86df9cd5
...
...
@@ -319,7 +319,7 @@ def equi_sph(n, twopi=True):
return
np
.
array
([
ts
,
ps
],
dtype
=
float
)
def
get_z_at
(
n
,
R
=
REARTH
,
t
=
1900.
,
random
=
False
):
def
get_z_at
(
n
,
R
=
REARTH
,
t
=
1900.
,
random
=
False
,
twopi
=
True
):
'''Get input points on the sphere. This is a convenience routine to allow
easy construction of field maps and synthetic data from the models.
...
...
@@ -335,6 +335,9 @@ def get_z_at(n, R=REARTH, t=1900., random=False):
random : bool, optional
If true, exactly n random points are returned. This is useful for
generating synthetic data.
twopi : bool, optional
Whether to include 2*pi as a duplicate of 0 for the longitutinal angle
(useful for plotting purposes). Only used if random is False.
Returns
-------
...
...
@@ -349,8 +352,9 @@ def get_z_at(n, R=REARTH, t=1900., random=False):
if
random
:
n_ret
=
n
n
=
100
*
n
twopi
=
False
angles
=
equi_sph
(
n
)
angles
=
equi_sph
(
n
,
twopi
=
twopi
)
z_at
=
np
.
zeros
((
4
,
angles
.
shape
[
1
]),
order
=
'F'
)
z_at
[
0
]
=
np
.
rad2deg
(
angles
[
0
])
z_at
[
1
]
=
np
.
rad2deg
(
angles
[
1
])
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment