%File: Check_wind_data_2015.m
% This file reads measured data for hourly mean values of wind speeds
% for four sites in Sweden. All data also has a time stamp. However
% the measurements were not perfect so some data is missing. When data
% is available or missing then there is a flag stating this. This means 
% that it is % possible to extract correct data. In this file one can select 
% one out % of four sites, the script reads the data and then extracts only 
% the part % with true measurements. Then the duration curve for the 
% measured data is printed.
clear 
clf
load('ormnbr_data')
k=4 ;
if k==1
    Wind1=Byx_wind ;
    Site1='Byxelkrok' ;
elseif k==2
    Wind1=Mag_wind ;
    Site1='Maglarp' ;
elseif k==3
    Wind1=Nas_wind ;
    Site1='Näsudden' ;
elseif k==4
    Wind1=Rin_wind ;
    Site1='Ringhals' ;
end
leng = length(year);
j3=1;
for i=1:leng
    if Wind1(i) > 8000
        Wind2(j3)=(Wind1(i)-9000)/10 ;
        j3=j3+1 ;
    end
end
plot(-sort(-Wind2))
ylabel('Wind speed [m/s]')
xlabel('Nr of hours the wind speed is exceeded')
title_txt=['Site: ' Site1 ', Nr of hours with data: ' num2str(j3)] ;
title(title_txt)

