time interpolation of a 3d matrix containing wind speed data
조회 수: 6 (최근 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!