-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
stereo: adjusted parametric law and initial point distribution
- Loading branch information
Showing
1 changed file
with
20 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -698,21 +698,37 @@ def _stereo_distortion_dist(lat): | |
|
||
def _parametric(lat): | ||
ones = np.ones(lat.shape) | ||
res = ((90 - lat) * 2 + 18) / 180 * np.pi | ||
return np.minimum(res, ones) | ||
y1 = ((90 - lat) * 2 + 16) / 180 * np.pi | ||
y2 = ((90 - lat) * 4 + 8) / 180 * np.pi | ||
y3 = ((90 - lat) * 8 + 4) / 180 * np.pi | ||
y4 = ((90 - lat) * 16 + 2) / 180 * np.pi | ||
y5 = ((90 - lat) * 32 + 1) / 180 * np.pi | ||
y6 = ((90 - lat) * 64 +.5) / 180 * np.pi | ||
y7 = ((90 - lat) * 128+.25) / 180 * np.pi | ||
y8 = ((90 - lat) * 252+.125) / 180 * np.pi | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
tomsail
Author
Contributor
|
||
y = np.minimum(y1,ones) | ||
y = np.minimum(y2,y) | ||
y = np.minimum(y3,y) | ||
y = np.minimum(y4,y) | ||
y = np.minimum(y5,y) | ||
y = np.minimum(y6,y) | ||
y = np.minimum(y7,y) | ||
y = np.minimum(y8,y) | ||
return y | ||
|
||
|
||
def _generate_initial_points(min_edge_length, geps, bbox, fh, fd, pfix, stereo=False): | ||
"""Create initial distribution in bounding box (equilateral triangles)""" | ||
if stereo: | ||
bbox = np.array([[-180, 180], [-89, 89]]) | ||
bbox = np.array([[-180, 180], [-89, 90]]) | ||
p = np.mgrid[ | ||
tuple(slice(min, max + min_edge_length, min_edge_length) for min, max in bbox) | ||
tuple(slice(min, max, min_edge_length) for min, max in bbox) | ||
].astype(float) | ||
if stereo: | ||
# for global meshes in stereographic projections, | ||
# we need to reproject the points from lon/lat to stereo projection | ||
# then, we need to rectify their coordinates to lat/lon for the sizing function | ||
p += np.random.rand(*p.shape) * min_edge_length / 2 # randomise the distribution | ||
p0 = p.reshape(2, -1).T | ||
x, y = to_stereo(p0[:, 0], p0[:, 1]) | ||
p = np.asarray([x, y]).T | ||
|
Not that it will make a huge difference, but shouldn't this be 256?