Skip to content

Commit

Permalink
added parametric law for stereo distortion (north pole)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomsail committed Apr 4, 2024
1 parent dc969ff commit 5c3cfd1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion oceanmesh/mesh_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ def _compute_forces(p, t, fh, min_edge_length, L0mult, opts):
p1 = p[bars].sum(1) / 2
x, y = to_lat_lon(p1[:, 0], p1[:, 1])
p2 = np.asarray([x, y]).T
hbars = fh(p2) * _stereo_distortion_dist(y)
hbars = fh(p2) * _stereo_distortion_dist(y) * _parametric(y)
else:
hbars = fh(p[bars].sum(1) / 2)
L0 = hbars * L0mult * (np.nanmedian(L) / np.nanmedian(hbars))
Expand Down Expand Up @@ -696,6 +696,12 @@ def _stereo_distortion_dist(lat):
return res


def _parametric(lat):
ones = np.ones(lat.shape)
res = ((90 - lat) * 2 + 18) / 180 * np.pi
return np.minimum(res, ones)


def _generate_initial_points(min_edge_length, geps, bbox, fh, fd, pfix, stereo=False):
"""Create initial distribution in bounding box (equilateral triangles)"""
if stereo:
Expand Down

0 comments on commit 5c3cfd1

Please sign in to comment.