function [ship]=load_ship(infile)

%get_vship
% load the data from the Cabo de Hornos vaisala logger
% sneaker-netted from control lab daily
% preprocess:
% f=WXT__SMSAWS__20150419.txt
% cat  $f | \
%    awk '(NF == 64){print}'| cut -f 1-28 | \
%  sed 's/:/ /g' | sed 's/-/ /' | sed 's/-/ /'  | \
%  sed 's:///:-999.99:g' > \
% `echo $f | sed 's/WXT__SMSAWS__/v/' | sed 's/txt/asc/'`
% the above removes all the : but just first 2 of the '-'s
%
% 123  456		8   9      11  12        14 15
% Date Time DPT HDG SOG sk BPR BPRcor sk RH ATMP 
%
%       18         21                           31
% sk sk WDIR sk sk WSPD sk sk sk sk sk sk sk sk BPR
%
ship=[];

nxpf=33;	
lcmd=sprintf('raw=load (''%s'');', infile);
eval(lcmd)
[nt,nf]=size(raw);
if nf ~= nxpf
    fprintf('error in %s. %d x %d, expect %d fields\n', infile, ...
        nt, nf, nxpf);
else
    ship.mday=datenum(raw(:,1:6));
    ship.heading=raw(:,8);
    ship.speed=raw(:,9) .* 0.5144; %.5515;  % to m/s %correct conversion factor (kn to m/s) added 2016/6/25
    ship.bpr=raw(:,11); % in hPa
    ship.bpr_c=raw(:,12); % Pressure at MSL
    ship.hrh=raw(:,14);
    ship.atmp=raw(:,15);
    ship.wdir=raw(:,18);
    ship.wspd=raw(:,21);
    ship.bpr2=raw(:,31);
%     ship.lat = raw(:,37);
%     ship.lon = raw(:,38);
%     ship=struct_nan999(ship);
end
    
    
