function siltprofiler_plot_fitted_obs(A,i0,i1)
%SILTPROFILER_PLOT_FITTED_OBS  plot result from siltprofiler_read_asc
%
%
%   D = siltprofiler_read_asc(ascname)
%       siltprofiler_plot_fitted_obs(D,start,end)
%
% This function can be used to look whether the scatter from the obs relate to a certain function:
%
%
%See also: SILTPROFILER_READ_ASC; SILTPROFILER_PLOT_DEBUG;
%SILTPROFILER_PLOT

%% Copyright notice
%   --------------------------------------------------------------------
%   Copyright (C) 2010 Delft University of Technology
%       Gerben J. de Boer
%
%       g.j.deboer@tudelft.nl	
%
%       Fluid Mechanics Section
%       Faculty of Civil Engineering and Geosciences
%       PO Box 5048
%       2600 GA Delft
%       The Netherlands
%
%   This library is free software: you can redistribute it and/or
%   modify it under the terms of the GNU Lesser General Public
%   License as published by the Free Software Foundation, either
%   version 2.1 of the License, or (at your option) any later version.
%
%   This library is distributed in the hope that it will be useful,
%   but WITHOUT ANY WARRANTY; without even the implied warranty of
%   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
%   Lesser General Public License for more details.
%
%   You should have received a copy of the GNU Lesser General Public
%   License along with this library. If not, see <http://www.gnu.org/licenses/>.
%   --------------------------------------------------------------------

OPT.export = 1;
OPT.pause  = 0;

n = length(A.obs)+1;
   if i1==0; i1 = n;end

   scatter(A.obs(i0:i1),A.depth(i0:i1),'xg')
hold on
plot(A.fit1(A.depth(i0:i1).*-1),A.depth(i0:i1),'r','LineWidth',2)
plot(A.fit2(A.depth(i0:i1).*-1),A.depth(i0:i1),'b','LineWidth',2)
plot(A.fit3(A.depth(i0:i1).*-1),A.depth(i0:i1),'c','LineWidth',2)
plot(A.fit4(A.depth(i0:i1).*-1),A.depth(i0:i1),'m','LineWidth',2)

legend('OBS data','exp2','powerexp','Rouss','exp3','Location','NorthEast')
hold off
      
      xlabel ('(OBS) FTU')
      ylabel ('Depth [m]')
      %grid on
      title({A.name,'fitted OBS'})

      
  if OPT.export
      print2screensize([filename(A.name),'_fitted_obs.png'])
      end
   if OPT.pause
         pausedisp
      end

