how to extrapolate a non uniform 3d data?

6 次查看(过去 30 天)
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
[X1,Y1]=meshgrid(lon(1):1:lon(end),lat(1):1:lat(end));
Check the answer and follow the same.

类别

Help CenterFile Exchange 中查找有关 Mathematics 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by