    %SILTPROFILER_GPS  main script for processing all siltprofiler data
%
% ... some proper documentation ...
%
% See also: siltprofiler_read_asc, siltprofiler_gps_kmlplot, siltprofiler_plot_debug

clear all
close all
clc

%%
L = xls2struct('siltprofiler_new_gps.xls');
%%
for ifile=1:length(L.gpsfilename)

    jfile = ifile;
  % jfile = 1;

%Inlezen 
  % A(jfile) = siltprofiler_read_asc(L.filename{jfile}); % now: gegenereert uit bin + ini
  % A(jfile) = siltprofiler_read_bin(L.filename{jfile},L.inifile{jfile}); % ultimately: lees direct uit bin mbv ini
    D(jfile) = siltprofiler_read_gps(L.gpsfilename{jfile});
%%

   count=0; % geeft aan welke file fout is
   for j=1:ifile
      count=count+1;
   end
   count

% Subfuncties
  % help convertcoordinates
  %[A.x,A.y,OPT]=convertCoordinates(A.lon,A.lat,'CS1.name','WGS 84','CS1.type','geo','CS2.name','WGS 84 / UTM zone 31N','CS2.type','xy')
  %[A.lon,A.lat]=convertCoordinates(A.xRD,A.yRD,'CS1.code',28992,'CS2.code',4326)
  
  %A(jfile).tidal_phase = siltprofiler_datenum2tidal_phase  (A(file).datenum,wateratanded_hoek_van holland, waterstande_den_helder);
  %A(jfile).salinity    = conductivity2salinity(A(jfile).C,A(jfile).T,A(jfile).Pres);
  
  %B(jfile)             = siltprofiler_bin                  (A(jfile),[-30:.2:3]); % op pressure
  
  %% Plotten
   % siltprofiler_gps_kmlplot(D(jfile).lat,D(jfile).lon,count);
   

end   
   
