function [rad1, qc1, rad2, qc2] = eur_rad_read(path_rad1, path_rad2, period)
% read eurradiationbsrn
rad_fls = dir([path_rad1 '\eurradiation*']);
rad1 = [];
for i = 1:length(rad_fls)
    x = importbsrn_eur([path_rad1 '/' rad_fls(i).name]);
    rad1 = [rad1; x];
end
qc1 = [];
for i = 1:length(rad_fls)
    x = importbsrnstring_eur([path_rad1 '/' rad_fls(i).name]);
    qc1 = [qc1; x];
end
% calculate the time index
hour_rad = fix(rad1(:,4)/100);
min_rad = rad1(:,4) - 100*hour_rad;
time_rad = datenum(2018,1,0) + rad1(:,3) + (hour_rad + min_rad/60)/24;

rad1(:,1:4) = [];
rad1 = [time_rad rad1];

% cut to the right period
rad1(time_rad < datenum(period(1,:)) | time_rad > datenum(period(2,:)) + 1 - 1/24/60,:) = [];
qc1(time_rad < datenum(period(1,:)) | time_rad > datenum(period(2,:)) + 1 - 1/24/60,:) = [];
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
rad_fls = dir([path_rad2 '\eurradiation*']);
rad2 = [];
for i = 1:length(rad_fls)
    x = importbsrn_eur2([path_rad2 '/' rad_fls(i).name]);
    rad2 = [rad2; x];
end
qc2 = [];
for i = 1:length(rad_fls)
    x = importbsrnstring_eur2([path_rad2 '/' rad_fls(i).name]);
    qc2 = [qc2; x];
end
% calculate the time index
hour_rad = fix(rad2(:,4)/100);
min_rad = rad2(:,4) - 100*hour_rad;
time_rad = datenum(2018,1,0) + rad2(:,3) + (hour_rad + min_rad/60)/24;

rad2(:,1:4) = [];
rad2 = [time_rad rad2];

% cut to the right period
rad2(time_rad < datenum(period(1,:)) | time_rad > datenum(period(2,:)) + 1 - 1/24/60,:) = [];
qc2(time_rad < datenum(period(1,:)) | time_rad > datenum(period(2,:)) + 1 - 1/24/60,:) = [];

rad1(rad1==-9999) = NaN;
rad2(rad2==-9999) = NaN;