how to extrapolate a non uniform 3d data?

6 ビュー (過去 30 日間)
Sreeraj R
Sreeraj R 2021 年 11 月 18 日
回答済み: KSSV 2021 年 11 月 18 日
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 Center および File ExchangeMathematics についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by