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

clear all
close all
clc

%%
L = xls2struct('siltprofiler_oud_main.xls');
%%
for ifile=9:length(L.filename)

   % noord wijk2/nw02_090723192227 is different ?? tabs instead of comma

   A(ifile) = siltprofiler_read_asc(L.filename{ifile}); % now: gegenereert uit bin + ini
  %A(ifile) = siltprofiler_read_bin(L.filename{ifile},L.inifile{ifile}); % ultimately: lees direct uit bin mbv ini
 
  % 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(ifile).tidal_phase = siltprofiler_datenum2tidal_phase  (A(file).datenum,wateratanded_hoek_van holland, waterstande_den_helder);
   A(ifile).salinity    = conductivity2salinity(A(ifile).cond,A(ifile).temp,A(ifile).press);
  
  %B(ifile)             = siltprofiler_bin                  (A(ifile),[-30:.2:3]); % op pressure
   
   %siltprofiler_plot_debug(A(ifile),...
    %                       L.index_start(ifile),...
     %                      L.index_end(ifile));
                       
   %siltprofiler_plot      (A(ifile),...
    %                       L.down_start(ifile),...
     %                      L.down_end(ifile)); % optie: 4e invoer struct C met vaste assen limieten
   
   siltprofiler_salinity_plot      (A(ifile),...
                                    L.index_start(ifile),...
                                    L.index_end(ifile)); % optie: 4e invoer struct C met vaste assen limieten
  
end   
   
