how to extrapolate a non uniform 3d data?

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)
lon_plot=ncread(data,'/PRODUCT/longitude');
lati_plot=ncread(data,'/PRODUCT/latitude');
ak=ncread(data,'/PRODUCT/averaging_kernel');
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);

댓글 수: 1

Walter Roberson
Walter Roberson 2021년 11월 18일
Your latitudes are decreasing in both directions. You need to flipud() and fliplr() your arrays.

댓글을 달려면 로그인하십시오.

답변 (1개)

KSSV
KSSV 2021년 11월 18일

0 개 추천

[X1,Y1]=meshgrid(lon(1):1:lon(end),lat(1):1:lat(end));
Check the answer and follow the same.

카테고리

도움말 센터File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

태그

질문:

2021년 11월 18일

답변:

2021년 11월 18일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by