Commit 86df9cd5 authored by Maximilian Schanner's avatar Maximilian Schanner
Browse files

Add a twopi argument two get_z_at, to remove duplicates if necessary.

parent 47c6806f
......@@ -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
......@@ -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.
......@@ -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])
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment