Boundary/polygon around coastline of Greenland

8 ビュー (過去 30 日間)
Christian Mathiesen
Christian Mathiesen 2022 年 1 月 22 日
回答済み: Chad Greene 2022 年 4 月 3 日
I have a big dataset of the topography of Greenland. x and y are in stereographic coordinates, with x being a vector of length 10218x1, y being a vector of length 18346x1 and z being a matrix of size 18346x10218 containing values of topography, negative values in the sea and postive inland.
I have a meshgrid of the x and y coordinates and I wish to calculate the distance from the closest point of the coast at every point in this meshgrid. My problem is to create a boundary or a border around the coast and islands surrounding Greenland, ie. where z goes from being negative to positive. I have tried to create a polygon, but the difference in length of the x and y arrays is giving me problems.
The dataset is too large (2.5 gb) to attach, but can be downloaded here.
filename = 'BedMachineGreenland-2021-04-20.nc';
x = ncread(filename,'x');
y = ncread(filename,'y');
x = double(nc_x);
y = double(nc_y);
dx = 5000;
x_ax=min(x):dx:max(x);
y_ax=min(y):dx:max(y);
[xx,yy]=meshgrid(x_ax,y_ax);
z = ncread(filename,'bed')';
figure
imagesc(nc_x,nc_y,z); axis xy equal; caxis([-500 1800]);
colorbar
Any help is appreciated. Thanks.

採用された回答

KSSV
KSSV 2022 年 1 月 22 日
You can get the coastline using the function contour. Read about it.
[M,c] = contour(x,y,Z,[0 0]) ; % M has the coordinates you want

その他の回答 (1 件)

Chad Greene
Chad Greene 2022 年 4 月 3 日
I've just added a 'gl' option to plot Greenland's grounding line using BedMachine's mask. https://github.com/chadagreene/BedMachine, so
bedmachine('gl','greenland')
produces this:
or
bedmachine('gl','color','red','linewidth',2,'greenland')
produces this:

カテゴリ

Help Center および File ExchangeMap Display についてさらに検索

製品


リリース

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by