eth-vaw-glaciology / GlacioTools.jl

MIT License
1 stars 0 forks source link

Crop to shape not working properly #13

Open luraess opened 1 year ago

luraess commented 1 year ago

Trying to crop bedrock elevation to shape (glacier outline) does not work as expected in here https://github.com/eth-vaw-glaciology/GlacioTools.jl/blob/4650bc8a3fda75f1b451474711b32c26210296bc/src/Alpine_glaciers.jl#L92

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.

mauro3 commented 1 year ago

Can you post a minimal example?

luraess commented 1 year ago

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 https://github.com/eth-vaw-glaciology/GlacioTools.jl/blob/3f8287d69e52a1f0531fe6f0b936acd3c4bcb253/src/Alpine_glaciers.jl#L107 seems to fix the thing now.

luraess commented 1 year ago

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

mauro3 commented 1 year ago

Closed with #14