how can I convert a geospacial sst map from 4km to 6 km or vice versa
4 views (last 30 days)
Show older comments
[X,Y] = meshgrid(lon1:lon2, lat1:lat2); V = sst; [Xq,Yq] = meshgrid(lon:6:lat); Vq = interp2(X,Y,V,Xq,Yq)
0 Comments
Answers (1)
ANKUR KUMAR
on 5 Oct 2018
clc
clear
lon=[65:.04:70];
lat=[0:0.04:5]; %on 4km resolution
sst_4km=randi(27,126,126);
lon1=[65:.06:70];
lat1=[0:0.06:5]; %on 6 km resolution
[lon1_mesh,lat1_mesh]=meshgrid(lon1,lat1);
for ii=1:size(lon1_mesh,1)
sst_6km=interp2(lon,lat,sst_4km,lon1_mesh(ii,:),lat1_mesh(ii,:));
end
3 Comments
ANKUR KUMAR
on 8 Oct 2018
Since you haven't attached you file, that's why I have taken random numbers to explain. In place of sst_4km, load you sst from file and do further calculations.
Tanziha Mahjabin
on 9 Mar 2020
Hi, I am having some error saying :
{Error using .'
Transpose on ND array is not defined. Use PERMUTE instead.
Error in interp2 (line 122)
V = V.'; }
My code is followed:
time2=ncread(fileIn,'time');
time2=ncread(fileIn,'time')./86400+datenum(1981,01,01);
SST_lon=ncread(fileIn,'lon');
SST_lat=ncread(fileIn,'lat');
SST=ncread(fileIn,'sea_surface_temperature');
SST=SST-273.15;
id1=(SST_lat>-39.9&SST_lat<-36.2);
id2=(SST_lon>137.1&SST_lon<141.9);
lat1=SST_lat(id1);
lon1=SST_lon(id2);
[lon1_mesh,lat1_mesh]=meshgrid(lon1,lat1);
for ii=1:size(lon1,1)
SSTg=interp2(SST_lon,SST_lat,SST,lon1_mesh(ii,:),lat1_mesh(ii,:));
end
See Also
Categories
Find more on Point Cloud Processing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!