how to extrapolate a non uniform 3d data?

2 views (last 30 days)
Sreeraj R on 18 Nov 2021
Answered: KSSV on 18 Nov 2021
hi
i have a dataset which doesnt have a uniform difference between the lat and lon even though the data resolution is 5.5x3.5km resolution. i have to extrapolate the data into a 1˚x1˚ resolution. i tried using a code however it was showing some error. how do i solve this error?
the above picture shows the lattitudes.
clear all
close all
clc
data=('D:\Sreeraj\Earthdata tropomi\New folder\S5P_OFFL_L2__NO2___01012021.nc');
% ncdisp(data)
lat=lati_plot(1,:)';
lon=lon_plot(:,1);
[X,Y]=meshgrid(lon,lat);
%resampling data
[X1,Y1]=meshgrid(lon(1):1:lon(end),lat(1):1:lat(end));
for i=1:34
v=interp2(X,Y,ak(:,:,i),X1,Y1);
v1(:,:,i)=v;
end
Error using griddedInterpolant
The grid must be created from grid vectors which are strictly monotonically increasing.
Error in interp2>makegriddedinterp (line 228)
F = griddedInterpolant(varargin{:});
Error in interp2 (line 136)
F = makegriddedinterp(X, Y, V, method,extrap);
Error in tropomiresample (line 21)
v=interp2(X,Y,ak(:,:,i),X1,Y1);
Walter Roberson on 18 Nov 2021
Your latitudes are decreasing in both directions. You need to flipud() and fliplr() your arrays.

KSSV on 18 Nov 2021
[X1,Y1]=meshgrid(lon(1):1:lon(end),lat(1):1:lat(end));