Interpolate NaN depth values in the bathymatry
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hasara kalpani Thennakoon Thennakoon Mudiyanselage
il 15 Nov 2021
Risposto: Cris LaPierre
il 21 Dic 2021
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 Commenti
Cris LaPierre
il 15 Nov 2021
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
Risposte (2)
Raj Bhakta
il 21 Nov 2021
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 Commenti
Cris LaPierre
il 21 Dic 2021
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 Commenti
Vedere anche
Categorie
Scopri di più su Orange in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

