Skip to content

Commit

Permalink
implemented median ratios
Browse files Browse the repository at this point in the history
  • Loading branch information
tomsail committed Nov 13, 2023
1 parent b92880c commit 451ad6e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions oceanmesh/mesh_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ def _compute_forces(p, t, fh, min_edge_length, L0mult, opts):
hbars = fh(p2) * _stereo_distortion_dist(y)
else:
hbars = fh(p[bars].sum(1) / 2)
L0 = hbars * L0mult * ((L**2).sum() / (hbars**2).sum()) ** (1.0 / 2)
L0 = hbars * L0mult * (np.nanmedian(L) / np.nanmedian(hbars))
F = L0 - L
F[F < 0] = 0 # Bar forces (scalars)
Fvec = (
Expand Down Expand Up @@ -693,7 +693,6 @@ def _stereo_distortion_dist(lat):
lrad = np.radians(lat)
# Calculate the scale factor for the stereographic projection
res = 2 / (1 + np.sin(lrad)) / 180 * np.pi
res[lat > 80] = res[lat > 80] * np.sin(np.radians(lat[lat > 80]))
return res


Expand Down

0 comments on commit 451ad6e

Please sign in to comment.