5 |
% c is a 2-D or 3-D scalar or z-vector field |
% c is a 2-D or 3-D scalar or z-vector field |
6 |
% xi,yi are vectors of the new regular lat-lon grid to interpolate to. |
% xi,yi are vectors of the new regular lat-lon grid to interpolate to. |
7 |
% z is the interpolated data with dimensions of size(xi) by size(yi). |
% z is the interpolated data with dimensions of size(xi) by size(yi). |
8 |
|
% theta=0 is at 12 o'clock. |
9 |
% |
% |
10 |
% e.g. |
% e.g. |
11 |
% >> t=rdmds('Ttave.0000513360'); |
% >> t=rdmds('Ttave.0000513360'); |
17 |
[theta rho nz]=size(c); |
[theta rho nz]=size(c); |
18 |
[RHO,THETA] = meshgrid(1:rho,-pi+2*pi/theta:2*pi/theta:pi); |
[RHO,THETA] = meshgrid(1:rho,-pi+2*pi/theta:2*pi/theta:pi); |
19 |
[x,y] = pol2cart(THETA,RHO); |
[x,y] = pol2cart(THETA,RHO); |
|
%[nx ny nz]=size(c); |
|
20 |
nx=theta;ny=rho; |
nx=theta;ny=rho; |
21 |
|
|
22 |
X=reshape(x,[1 nx*ny]); |
X=reshape(x,[1 nx*ny]); |
26 |
for k=1:nz; |
for k=1:nz; |
27 |
C=reshape(c(:,:,k),[1 nx*ny]); |
C=reshape(c(:,:,k),[1 nx*ny]); |
28 |
z(:,:,k)=griddata(Y,X,C,yi,xi',varargin{:}); |
z(:,:,k)=griddata(Y,X,C,yi,xi',varargin{:}); |
|
% z(:,:,k)=griddata_fast(del,[C C(il) C(ig)],varargin{:}); |
|
29 |
end % k |
end % k |
30 |
|
|
31 |
% Split vertical and time dimensions |
% Split vertical and time dimensions |