Help wanted with lake bathymetry

Hi,

My goal is to create digital bottom models from depth points and lake shorelines. The final format should be GeoTIFF and CRS the same as for the source data, EPSG:3067 which is almost the same as UTM zone 35.

Depth points and the lake polygon can be downloaded from http://latuviitta.org/downloads/gmt_bathymetry.zip.

I have now managed to create a somewhat usable result with command
gmt surface depth_points.xyz -R443231.881/448359.631/6803096.632/6808575.009 -I10 -Dlakepoly.gmt -Lu0 -Gdem_with_d_and_lu.nc

However, the algorithm creates a wall along the shoreline and dry land gets elevations below the lake surface. Values greater than zero I could cut with the parameter “-Lu0” but I can’t cut negative heights because they appear in the real depth data.
lake_bathymetry_3

I was suggested to mask the land area by running surface with parameter -M but it does not work with this kind of data where the measurements have been done in lines with 60-70 meters apart which means that the value of M must be at least 35 meters.

Is there any other GMT tool that can be used for making an exact mask by the lake polygon? The area that is not lake should get either height=0 or nodata. I know how to do that with gdal_rasterize but some native GMT way might make scripting easier.

I was not sure how to apply CRS for the source datasets correctly so I just dropped CRS. However, my aim is to make georeferenced so I would appreciate a hint about how to define CRS correctly for my datasets. Also it would be nice if I could save the result directly into GeoTIFF format it that is possible.

Regards,

-Jukka Rahkonen-