www.gusucode.com > 国外编的干涉合成孔径雷达(InSAR)Matlab工具箱 > 国外编的干涉合成孔径雷达(InSAR)Matlab工具箱/insarmatlab/insar/bowl.m

    function b = bowl(nrows,ncolumns)
% BOWL --  Generate unit bowl.
%   c = BOWL;        bowl [0,1] of dimensions (512,512);
%   c = BOWL(L);     bowl [0,1] of dimensions (L,L);
%   c = BOWL([L P]); bowl [0,1] of dimensions (L,P);
%   c = BOWL(L,P);   bowl [0,1] of dimensions (L,P);
% 
%   Bowl is generated by exp(r^2) where r is normalized radius.
%   Probably a more natural subsidence bowl should be used.
%
%   See also CONE, PYRAMID, RAMP, SIMINTERF 
% 

%// $Revision: 1.1 $  $Date: 2001/09/28 14:24:39 $
%// Bert Kampes, 11-Dec-2000

%%% Handle input.
if     (nargin==2) ;
elseif (nargin==1) if (prod(size(nrows))==1) ncolumns=nrows;
		   else ncolumns=nrows(2); nrows=nrows(1); end;
elseif (nargin==0) nrows=512; ncolumns=nrows;
else   error('wrong number of input');
end;

%%% Cone generation (can lot smarter?)
[x,y] = meshgrid(1:ncolumns,1:nrows);
x0    = round(size(x,2)/2);%          top of bowl
y0    = round(size(x,1)/2);%          top of bowl
r     = sqrt((x-x0).^2 + (y-y0).^2);%       radius
r     = normalize(r);
b     = exp(r.^2);

return
%%% Normalize [-sqrt(x0):0] --> [0,1]
minb  = max(b(:));
%minb  = -sqrt((size(x,2)-x0).^2 + (size(x,1)-y0).^2);
b     = (b-minb) ./ -minb;

%%% EOF