eth-vaw-glaciology / GlacioTools.jl

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Crop to shape not working properly

luraess opened this issue · comments

Trying to crop bedrock elevation to shape (glacier outline) does not work as expected in here

push!(BedrElev_stack, GlacioTools.crop_padded(BedrElev, shape, padding))

Shape is following
Screenshot 2023-02-22 at 15 11 46

But cropped output is following
Screenshot 2023-02-22 at 15 11 30

Exclude the plotting distortion.

commented

Can you post a minimal example?

using

mask_trim(raster, poly; pad=10) = trim(mask(raster; with=poly); pad=pad)

instead of GlacioTools.crop_padded such as

push!(IceThick_stack, mask_trim(IceThick, shape; pad=padding))

in

push!(IceThick_stack, GlacioTools.crop_padded(IceThick, shape, padding))

seems to fix the thing now.

Should now be implemented in #14 and close this upon merge.

commented

Closed with #14