Interpolate NaN depth values in the bathymatry
4 ビュー (過去 30 日間)
古いコメントを表示
Hasara kalpani Thennakoon Thennakoon Mudiyanselage
2021 年 11 月 15 日
回答済み: Cris LaPierre
2021 年 12 月 21 日
I have a bathymatry data set with logitudes,latitudes and depths which i used to create a bathymatry for a certain area(matfile attached). But due to the Nan values in the depth data resulting map is little blury over some area.I would like to interpolate the NaN values withing the ocean area and make the map more detailed. (I have attached my code) Attached below is the map I got and the image below that is the one i expect .


2 件のコメント
Cris LaPierre
2021 年 11 月 15 日
I'm not convinced there are NaN values in the water. Instead, any land mass has been replaced with NaN except for right along the shore. Is there any way to get that elevation data back? That would make creating the desired plot easy.
load bathymatryGOF.mat
[Lat Lon] = meshgrid(lat_range,lon_range);
depth_range(isnan(depth_range)) = 10;
axesm('eqdcylin',"MapLatLimit",lat_range([1,end]),"MapLonLimit",lon_range([1,end]))
pcolorm(Lat,Lon,depth_range);
demcmap(depth_range)
tightmap
colorbar
回答 (2 件)
Raj Bhakta
2021 年 11 月 21 日
A similiar question at StackOverflow might provide an answer
They used the TriScatteredInterp function in matlab and an inpaint_nans function from MATLAB central. https://www.mathworks.com/matlabcentral/fileexchange/4551-inpaint_nans
0 件のコメント
Cris LaPierre
2021 年 12 月 21 日
There is no elevation data in the nc file, just depth. If it is a matter of getting the coloring to match, you can use the plotting capabilities in the mapping toolbox combined with a custom colormap for the water to more closely approximate the original figure.
load bathymatryGOF.mat
[Lat Lon] = meshgrid(lat_range,lon_range);
depth_range(isnan(depth_range)) = 10;
% create map axes. Set lat/lon limits
axesm('eqdcylin',"MapLatLimit",lat_range([1,end]),"MapLonLimit",lon_range([1,end]))
pcolorm(Lat,Lon,depth_range);
% define custom colormap for sea (Based on colors in original figure)
cmapsea = [0.125 0.10 0.15;
0.25 0.45 0.55;
1 1 1];
% apply custom colormap
demcmap(depth_range,[],cmapsea,[])
tightmap
colorbar
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Orange についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

