% generate the figure that has the chirped psf
if ~exist('red')
  load /mas/disks/vision9/steve/flakes/perspectivepics/red.txt
end%if
x1=conv(red,[.1 .2 .3 .2 .1]);
t=linspace(0,1,length(x1));

m1=.2;
m2=.4;
m3=.6;
m4=.8;

if isempty(findstr(path,'gabor'))
  p=path;
  path(p,'/mas/disks/vision9/steve/gabor');
end%if

N=1000; % number of pts
g1=gauss(N,100,-300);
g2=gauss(N,100,-100);
g3=gauss(N,100, 100);
g4=gauss(N,100, 300);
G=[g1; g2; g3; g4].';  % plot matrix
G=G/max(g2);  % normalize to unit height
G=G*100;   % nice height
%plot([g1; g2; g3; g4].')  % all 4 gaussians on same plot
h1=axes('position',[.1 .7 .8 .1])
plot(1:N,G,':',1:N,dechirp(x1,length(g1)),'-') %solid and solid
set(h1,'visible','off')
xlabel('(a)')
h2=axes('position',[.1 .55 .8 .1])
plot(1:N,G,'--',1:N,dechirp(x1,1000,.5+.38),'-') %solid and solid
set(h2,'visible','off')
xlabel('(b)')

h3=axes('position',[.1 .4 .8 .1])
c=.5+.23
H=[dechirp(g1,1000,c); dechirp(g2,1000,c); dechirp(g3,1000,c);...
   dechirp(g4,1000,c)].';
c2=1-(.5+.38);
H2=[dechirp(g1,1000,c2); dechirp(g2,1000,c2); dechirp(g3,1000,c2);...
    dechirp(g4,1000,c2)].';
H=H/max(g1);
H2=H2/max(g1);
H=H*100;
H2=H2*100;
plot(1:N,H,':',1:N,H2,'--',1:N,dechirp(x1,1000,c),'-')
set(h3,'visible','off')
xlabel('(c)')

