clearvars
filename='Stratus-XVIII_MET_sys2.txt';
fileout='stratus18_telem_sys2';

q=fopen(filename)
% year mo day hr yday BPR ATMP STMP WNDE WNDN WSPD WDIR RH SRAD LRAD PRC PRATE SAL COND
% UTC mbar degC degC m/s m/s m/s deg % W/m2 W/m2 mm mm/hr (1) S/m
% 2019 4 13 8 103.354 1016.76 20.142 20.343 -0.67 1.50 1.6 335.9 68.44 2.9 403.6 26.78 0.00 0.00 0.000
C=textscan(q,'%f%f%f%f%f %f %f %f %f %f %f %f %f %f %f %f %f %f %f',...
    'headerlines',5);
mday = datenum(C{1},C{2},C{3},C{4},0,0); % hourly time stamp in Matlab convention
bpr = C{6}; % barometric pressure in mbars
atmp = C{7}; % air temp in degrees Celsius
sst = C{8}; % sea surface tem in degrees Celsius
wnde = C{9}; % wind to the east in m/s
wndn = C{10}; %wind to the north in m/s
wspd = C{11}; % wind speed in m/s
wdir = C{12}; % wind direction (heading) in degrees
hrh = C{13}; % relative humidity in percent RH
swr = C{14}; % solar shortwave radiation in W/m**2
lwr = C{15}; % longwave radiation in W/m**2
precip = C{16}; % preipitation accumulation in mm/hr
prate = C{17}; % precipitation rate in mm/hr
sal = C{18}; % salinity in practical salinity units (psu)
cond = C{19}; % conductivity in Siemens/meter
fclose(q)

save(fileout,'mday','atmp','bpr','hrh','lwr','swr','sst','wnde','wndn',...
    'wspd','wdir','sal','cond','precip','prate')
