Skip to content

Commit

Permalink
apply Mercator proj to central coordinates
Browse files Browse the repository at this point in the history
  • Loading branch information
albangossard committed Feb 19, 2025
1 parent 215e35f commit 52863a7
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/glaciers/glacier/glacier2D_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ function initialize_glacier_data(rgi_id::String, params::Parameters; smoothing=f
northing = dims(glacier_gd, 2).val
latitudes = map(x -> x.lat.val, transform.(Ref(mean(easting)), northing))
longitudes = map(x -> x.lon.val, transform.(easting, Ref(mean(northing))))
x0y0 = transform(glacier_grid["x0y0"][1], glacier_grid["x0y0"][2])
if maximum(abs.(latitudes)) > 80
@warn "Mercator projection can fail in high-latitude regions. You glacier includes latitudes larger than 80 degrees."
end
Expand Down Expand Up @@ -167,7 +168,7 @@ function initialize_glacier_data(rgi_id::String, params::Parameters; smoothing=f
A = 4e-17, C = 0.0, n = 3.0,
slope = slope, dist_border = dist_border,
Coords = Coords, Δx=Δx, Δy=Δy, nx=nx, ny=ny,
cenlon = glacier_grid["x0y0"][1] , cenlat = glacier_grid["x0y0"][2])
cenlon = x0y0.lon.val, cenlat = x0y0.lat.val)
return glacier

catch error
Expand Down
Binary file modified test/data/glaciers/glaciers2D_w_glathida.jld2
Binary file not shown.
Binary file modified test/data/glaciers/glaciers2D_wo_glathida.jld2
Binary file not shown.

0 comments on commit 52863a7

Please sign in to comment.