time interpolation of a 3d matrix containing wind speed data
7 ビュー (過去 30 日間)
古いコメントを表示
Hello everyone,
I am not an expert user and I would like to ask some information regarding time interpolation. I am running simulations to generate wind waves and as you know, the crucial point is to have wind data with good quality. For my simulations I used ERA5 wind data ( reanalysis) but I was told to compare the wind field with wind data coming from altimeters, for example IFREMER. The objective of the comparison is to correct some possible biases in the wind field.
Now, the problem is that ERA5 collects data every hour while IFREMER provides data every 6 hours. Since I am now focusing on the year 2011, for example, in the first case I have 8760 values while in the second case I have 1460 values.
Basically I have two 3D matrices: u10_ERA5 (81x109x8760) and u10_IFREMER (81x109x1460). The first two dimensions represent wind intensity for defined sets of longitude and latitudes ( the same for both matrices). Since the wind data coming from IFREMER is more accurate, I would like to modify the ERA5 matrix in order to increase the quality of the wind.
Here I attached two drawings I made ( just to give an idea of what I am thinking to do)
Could you provide a code that can help me in this?
Thank you a lot
0 件のコメント
回答 (1 件)
Star Strider
2023 年 6 月 3 日
The retime or synchronize would likely be more apporpriate here, however the resample function could work (and interp1 is an option as well). I would downsample the hourly data to the every-six-hour data rather than upsample the every-six-hour data. The reason is that upsampling creates data where none previously existed. You cannot determine what the IFREMER data actually were at the hourly times, so any comparisons of interpolated hourly data to the ERA5 data would likely not be valid.
So I would use retime or synchronize to downsample the ERA5 data to the same times as the IFREMER data and go from there.
2 件のコメント
Star Strider
2023 年 6 月 5 日
編集済み: Star Strider
2023 年 6 月 5 日
My pleasure!
This might be possible using the flip function, however I would need your data to experimant with, since I do not know how to simulate it.
EDIT — (5 Jun 2023 at 14:32)
I just now figured out how to simulate it.
The flip approach seems to work, although the plots are the same because of the way the MATLAB plotting functions (here surf) work.
The matrices themselves are flipped appropriately, as can be seen by examining the first and third dimensions of both ‘A3’ and ‘flipLatA3’ (the second dimension is the same column-wise, so it does not demonstrate any changes) —
Latv = linspace(29,2, 7);
Lonv = linspace(90, 120, 8);
[Lat,Lon] = ndgrid(Latv,Lonv);
WVel = Lat.^2/100 + Lon.^2/100;
A3 = cat(3, Lat,Lon, WVel)
figure
surf(A3(:,:,1), A3(:,:,2), A3(:,:,3))
colormap(turbo)
xlabel('Lat')
ylabel('Lon')
zlabel('Wvel')
flipLatA3 = flip(A3,1)
figure
surf(flipLatA3(:,:,1), flipLatA3(:,:,2), flipLatA3(:,:,3))
colormap(turbo)
xlabel('Lat')
ylabel('Lon')
zlabel('Wvel')
.
参考
カテゴリ
Help Center および File Exchange で Geographic Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!