% go_ship
clearvars
addpath(path,'/Users/sbigorre/matlab/Matlabtools/structures');
infiles=dir('data/v2018*.asc');
fprintf('reading %d files\n', length(infiles));
ship=load_ship(['data/',infiles(1).name]); %'data/v20160615.asc');
save ship.mat ship
load ship.mat
for ii=2:length(infiles)
    infile=infiles(ii).name;
    [new]=load_ship(['data/',infile]);
    if isstruct(new)
        fprintf('%s %s - %s %d pts max dt %.1f\n', infile, ...
            datestr(new.mday(1)),datestr(new.mday(end)), ...
            length(new.mday),max(diff(new.mday))*24*60);
        ship=struct_merge(ship,new);
%         movefile(['Met/',infile],'data');
    else
        fprintf('could not read %s\n', infile);
    end
end
save ship.mat

        