Interpolate NaN depth values in the bathymatry
조회 수: 4 (최근 30일)
이전 댓글 표시
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!

