% load txt file with report from Vaisala weather station on Cabo de Hornos
clear all

q=fopen('WXT__SMSAWS__20180405_1.txt');
% Date	Lowest cloud base altitude (instant)	Second cloud base altitude (instant)	
% Latitude	Longitude	Atmospheric pressure	Pressure at station level	
% Pressure reduced to mean sea level (QFF)	Relative humidity	Sky condition, cloud layer 1	
% Speed over ground, instant value	Air Temperature, 1 min average	(UV-Radiaton 1)	
% Wind direction, instant value	Wind direction, 2 min average	Wind speed, instant value	Wind speed, 2 min. average
% 2016-06-16 11:33:00	///	///	3049.3700	7421.0010	1019.4	1019.8	1021.0	80	1	12.0	14.8		177	176	30.2	30.7

% Date Time CB1 CB2 Lat Lon BPR Pa Pmsl HRH ?(sky) SOG ATMP WDIR WDIR2min WSPD WSPD2min
C = textscan(q,'%f-%f-%f %f:%f:%f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f%f %f \n','Headerlines',2);
fclose(q)

%%
mday = datenum(C{1},C{2},C{3},C{4},C{5},C{6});
lat = C{4};
lon = C{5};
bpr = C{6};
Pa = C{7};
Pmsl = C{8};
hrh = C{9};
cld = C{10};
sog = C{11};
atmp = C{17};
wdir = C{18};
wdir_2mn = C{19};
wspd = C{20};
wspd_2mn = C{21};

%%
plot(mday,wspd,'.-')
%myticks(gca,1,2), grid on



