/[MITgcm]/MITgcm_contrib/osse/utils/cart2cyl.m
ViewVC logotype

Diff of /MITgcm_contrib/osse/utils/cart2cyl.m

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.3 by afe, Wed Jan 5 20:40:21 2005 UTC revision 1.4 by afe, Thu Jan 13 15:50:36 2005 UTC
# Line 3  function [z] = cart2cyl(c,thetai,rhoi,va Line 3  function [z] = cart2cyl(c,thetai,rhoi,va
3  %  %
4    
5  NN=size(c);  NN=size(c);
 %[theta rho nz]=size(c);  
6  [x y nz]=size(c);  [x y nz]=size(c);
 %[RHO,THETA] = meshgrid(1:rho,-pi+2*pi/theta:2*pi/theta:pi);  
 %[Y,X] = meshgrid(-(x-1)/2:(x-1)/2,-(y-1)/2:(y-1)/2);  
 %stepx=(2*x+1)/(2*x);  
 %stepy=(2*y+1)/(2*y);  
7  stepx=(x+1)/(x);  stepx=(x+1)/(x);
8  stepy=(y+1)/(y);  stepy=(y+1)/(y);
9  [Y,X] = meshgrid(-(x)/2:stepx:(x)/2,-(y)/2:stepy:(y)/2);  [Y,X] = meshgrid(-(x)/2:stepx:(x)/2,-(y)/2:stepy:(y)/2);
 %[Y,X] = meshgrid(x,y);  
 %[Y,X] = meshgrid(-(x)/2:stepx:(x)/2+stepx,-(y)/2:stepy:(y)/2+stepy);  
 %[x,y] = pol2cart(THETA,RHO);  
10  [theta,rho] = cart2pol(X,Y);  [theta,rho] = cart2pol(X,Y);
 %theta=(theta./(pi*2)+0.5).*size(thetai,2);  
 %theta=theta.*2*((size(thetai,2)+1)/size(thetai,2));  
 %theta=(theta./(pi*2)+0.5).*(size(thetai,2)+1);  
 %theta=(theta./(pi*2)+0.5).*(size(thetai,2));  
11  theta=(theta./(pi*2)+0.5).*(size(thetai,2));  theta=(theta./(pi*2)+0.5).*(size(thetai,2));
 %theta=(theta./pi).*size(thetai,2);  
 %theta=(theta./(pi*2)).*size(thetai,2);  
 %rho=max(rhoi)*rho/((x-1)/2);  
12  rho=max(rhoi)*rho/((x)/2);  rho=max(rhoi)*rho/((x)/2);
 %theta=rot90(theta.*180./pi,-1);  
 %[nx ny nz]=size(c);  
 %nx=theta;ny=rho;  
13  ntheta=x;nrho=y;  ntheta=x;nrho=y;
14    
 %X=reshape(x,[1 nx*ny]);  
 %Y=reshape(y,[1 nx*ny]);  
15  THETA=reshape(theta,[1 ntheta*nrho]);  THETA=reshape(theta,[1 ntheta*nrho]);
16  RHO=reshape(rho,[1 ntheta*nrho]);  RHO=reshape(rho,[1 ntheta*nrho]);
 %del=griddata_preprocess(Y,X,yi,xi',varargin{:});  
17  del=griddata_preprocess(RHO,THETA,rhoi,thetai',varargin{:});  del=griddata_preprocess(RHO,THETA,rhoi,thetai',varargin{:});
18    
19  for k=1:nz;  for k=1:nz;
20   C=reshape(c(:,:,k),[1 ntheta*nrho]);   C=reshape(c(:,:,k),[1 ntheta*nrho]);
21  z(:,:,k)=griddata(RHO,THETA,C,rhoi,thetai',varargin{:});  z(:,:,k)=griddata(RHO,THETA,C,rhoi,thetai',varargin{:});
 %z(:,:,k)=griddata(Y,X,C,yi,xi',varargin{:});  
 % z(:,:,k)=griddata_fast(del,[C C(il) C(ig)],varargin{:});  
22  end % k  end % k
23    
24  % Split vertical and time dimensions  % Split vertical and time dimensions

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

  ViewVC Help
Powered by ViewVC 1.1.22