function [RWS,SNR,xh,yh,zh,lonh,lath,hh]=hard_target(lidar)
%create laser pulse shape Note:10ns time division for 3m range gate seperation
dt=(lidar.ranges(2) - lidar.ranges(1)) / .3;
t=[-150:dt:150];
sig=180/2/sqrt(2);
nearly=ceil(72/(lidar.ranges(2) - lidar.ranges(1)));
R=exp(-(t/sig).^2); % gaussian temporal shape with full width of 180ns at 1/e^2
[na,nr]=size(lidar.SNR);
SNR=lidar.SNR;
RWS=lidar.RWS;
Beta=lidar.Beta;
ihard=1;
for ja=1:na
    P=lidar.SNR(ja,:);
    for j=1:20
%         B=imfilter(P,R,'replicate','conv');
%         BB=imfilter(P./B,R,'replicate','conv');
         B=ConvolutionDft( P,R,'Same' );
         BB=ConvolutionDft(P./B,R,'Same');

        pp=P.*BB;
        P=pp;
    end
    [locs pks]=peakseek(P,10,10);
    if ~isempty(locs)
        % first look at meanRWS in small window
        minp=locs(1)-lidar.gatelengthinpts/2;
        if minp<1
            minp=1;
        end
        maxp=locs(1)+lidar.gatelengthinpts/2;
        if maxp>nr
            maxp=nr;
        end
        rwsmean=mean(lidar.RWS(ja,[minp:maxp]));

        % fix window for NaN'ing RWS around buildings (extended to end of
        % range)
        minp=locs(1)-nearly;
        if minp<1
            minp=1;
        end

        if abs(rwsmean)<.25
            lidar.hard(ihard,1)=lidar.xd(ja,locs(1));
            lidar.hard(ihard,2)=lidar.yd(ja,locs(1));
            lidar.hard(ihard,3)=lidar.zd(ja,locs(1));
            lidar.lath(ihard)=lidar.lat(ja,locs(1));
            lidar.lonh(ihard)=lidar.lon(ja,locs(1));
            lidar.hh(ihard)=lidar.h(ja,locs(1));
            
            ihard=ihard+1;

            SNR(ja,minp:nr)=NaN;
            RWS(ja,minp:nr)=NaN;
            Beta(ja,minp:nr)=NaN;
        end
    end


end
xh=lidar.hard(:,1);
yh=lidar.hard(:,2);
zh=lidar.hard(:,3);
lath=lidar.lath;
lonh=lidar.lonh;
hh=lidar.hh;

return