/[MITgcm]/MITgcm_contrib/timour_matlab/mscripts/radialwmean.m
ViewVC logotype

Annotation of /MITgcm_contrib/timour_matlab/mscripts/radialwmean.m

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


Revision 1.1 - (hide annotations) (download)
Wed Sep 3 21:22:22 2003 UTC (21 years, 10 months ago) by edhill
Branch: MAIN
CVS Tags: HEAD
initial checkin of Timour's MatLAB scripts

1 edhill 1.1 % create circular sampling rings
2     t=w;
3    
4     Nn=Nx/2;
5    
6     rad=[1:1:(Nn-1)];
7     ring=ones(Nx,Ny,Nz);
8     weight=zeros(1,Nn-1);
9     radialmean=zeros(1,Nn-1);
10     XCenter = (Nx+1)/2 ;
11     YCenter = (Ny+1)/2 ;
12    
13    
14     for k=1:Nn-1
15     for i=1:Nx
16     for j=1:Ny
17     radius(i,j) = sqrt((i-XCenter)^2+(j-YCenter)^2);
18     end
19     end
20     radius(find( round(radius) > (k+1) ))=radius(find (round(radius) > (k+1) ))*0;
21     radius(find( round(radius) < (k) ))=radius(find (round(radius) < (k) ))*0;
22     radius(find(radius>0))=1.0;
23     ring(:,:,k)=radius;
24     weight(:,k)=length(find(ring(:,:,k) > 0));
25     end
26    
27    
28     for i=1:Nn-1
29     tring=t(:,:,15).*ring(:,:,i);
30     meandoubleu(i)=sum(sum(tring))/weight(:,i);
31     end
32    
33     figure
34     plot([1:Nn-1],meandoubleu,'o-')

  ViewVC Help
Powered by ViewVC 1.1.22