Skip to content

Commit

Permalink
fix sizing functions using dem (CHLNDDEV#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomsail authored Jan 5, 2024
1 parent c4c56d2 commit dc969ff
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion oceanmesh/edgefx.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,8 @@ def bathymetric_gradient_sizing_function(
# Convert back to degrees from meters (if geographic)
if crs == "EPSG:4326" or crs == 4326:
grid.values /= meters_per_degree
grid.dx = dem.dx
grid.dy = dem.dy

if max_edge_length is not None:
grid.values[grid.values > max_edge_length] = max_edge_length
Expand All @@ -550,7 +552,6 @@ def bathymetric_gradient_sizing_function(
min_edge_length = grid.dx

grid.values[grid.values < min_edge_length] = min_edge_length

grid.build_interpolant()

return grid
Expand Down Expand Up @@ -879,6 +880,8 @@ def wavelength_sizing_function(
# Convert back to degrees from meters (if geographic)
if crs == "EPSG:4326" or crs == 4326:
grid.values /= meters_per_degree
grid.dx = dem.dx
grid.dy = dem.dy

if min_edgelength is None:
min_edgelength = np.amin(grid.values)
Expand Down

0 comments on commit dc969ff

Please sign in to comment.