disp('read_WHOI_day_STRATUS_2015.m')
fclose('all');

% loading STRATUS 13 mat file
%D:\Data\STRATUS_2019\CabodeHornos\SCS\S18;
data_drive = 'D:\Data';
cruise = 'STRATUS_2019';
ship= 'CabodeHornos';
S13_path = fullfile(data_drive,cruise,ship,'SCS','S18','W13_1_hr.mat');
%S13_path = D:Data\STRATUS_2019\CabodeHornos\SCS\S18\'W13_1_hr.mat';
load(S13_path);
%mt1=1
jd_13_1 =mday-datenum(2018,12,31); % jd for hourly S13 sys1
%jd_13_1 = mt1- datenum(2018,12,31); % jd for hourly S13 sys1
ii = find(floor(jd_13_1)==ddd);
if isempty(ii)
    jd_13_1 = zeros(24,1)*NaN;
    S13_wspd_1 = zeros(24,1)*NaN;
    S13_wdir_1 = zeros(24,1)*NaN;
    S13_bpr_1 = zeros(24,1)*NaN;
    S13_hrh_1 = zeros(24,1)*NaN;
    S13_atmp_1 = zeros(24,1)*NaN;
    S13_swr_1 = zeros(24,1)*NaN;
    S13_lwr_1 = zeros(24,1)*NaN;
    S13_sst_1 = zeros(24,1)*NaN;
else
    jd_13_1 = jd_13_1(ii);
    S13_wspd_1 = msys1.wspd(ii);
    S13_wdir_1 = msys1.wdir(ii);
    S13_bpr_1 = msys1.bpr(ii);
    S13_hrh_1 = msys1.hrh(ii);
    S13_atmp_1 = msys1.atmp(ii);
    S13_swr_1 = msys1.swr(ii);
    S13_lwr_1 = msys1.lwr(ii);
    S13_sst_1 = msys1.sst(ii);
end;

%jd_13_2 = mt2 - datenum(2014,12,31); % jd for hourly S13 sys2
jd_13_2 = mday-datenum(2014,12,31); % jd for hourly S13 sys2
ii = find(floor(jd_13_2)==ddd);
if isempty(ii)
    jd_13_2 = zeros(24,1)*NaN;
    S13_wspd_2 = zeros(24,1)*NaN;
    S13_wdir_2 = zeros(24,1)*NaN;
    S13_bpr_2 = zeros(24,1)*NaN;
    S13_hrh_2 = zeros(24,1)*NaN;
    S13_atmp_2 = zeros(24,1)*NaN;
    S13_swr_2 = zeros(24,1)*NaN;
    S13_lwr_2 = zeros(24,1)*NaN;
    S13_sst_2 = zeros(24,1)*NaN;
else
    jd_13_2 = jd_13_2(ii);
    S13_wspd_2 = msys2.wspd(ii);
    S13_wdir_2 = msys2.wdir(ii);
    S13_bpr_2 = msys2.bpr(ii);
    S13_hrh_2 = msys2.hrh(ii);
    S13_atmp_2 = msys2.atmp(ii);
    S13_swr_2 = msys2.swr(ii);
    S13_lwr_2 = msys2.lwr(ii);
    S13_sst_2 = msys2.sst(ii);
end;

% loading STRATUS 14 mat file
S14_path = fullfile(data_drive,cruise,ship,'SCS','S18','W13_2_hr.mat');
load(S14_path);
%jd_14_1 = sys1.mday - datenum(2014,12,31); % jd for hourly S14 sys1
jd_14_1 = mday - datenum(2014,12,31); % jd for hourly S14 sys1

%jd_14_1 = datenum(2014,12,31);
ii = find(floor(jd_14_1)==ddd);
if isempty(ii)
    jd_14_1 = zeros(24,1)*NaN;
    S14_wspd_1 = zeros(24,1)*NaN;
    S14_wdir_1 = zeros(24,1)*NaN;
    S14_bpr_1 = zeros(24,1)*NaN;
    S14_hrh_1 = zeros(24,1)*NaN;
    S14_atmp_1 = zeros(24,1)*NaN;
    S14_swr_1 = zeros(24,1)*NaN;
    S14_lwr_1 = zeros(24,1)*NaN;
    S14_sst_1 = zeros(24,1)*NaN;
else
    jd_14_1 = jd_14_1(ii);
    S14_wspd_1 = sys1.wspd(ii);
    S14_wdir_1 = sys1.wdir(ii);
    S14_bpr_1 = sys1.bpr(ii);
    S14_hrh_1 = sys1.hrh(ii);
    S14_atmp_1 = sys1.atmp(ii);
    S14_swr_1 = sys1.swr(ii);
    S14_lwr_1 = sys1.lwr(ii);
    S14_sst_1 = sys1.sst(ii);
end;

jd_14_2 = mday - datenum(2014,12,31); % jd for hourly S14 sys2
%jd_14_2 = datenum(2014,12,31);

ii = find(floor(jd_14_2)==ddd);
if isempty(ii)
    jd_14_2 = zeros(24,1)*NaN;
    S14_wspd_2 = zeros(24,1)*NaN;
    S14_wdir_2 = zeros(24,1)*NaN;
    S14_bpr_2 = zeros(24,1)*NaN;
    S14_hrh_2 = zeros(24,1)*NaN;
    S14_atmp_2 = zeros(24,1)*NaN;
    S14_swr_2 = zeros(24,1)*NaN;
    S14_lwr_2 = zeros(24,1)*NaN;
    S14_sst_2 = zeros(24,1)*NaN;
else
    jd_14_2 = jd_14_2(ii);
    S14_wspd_2 = sys2.wspd(ii);
    S14_wdir_2 = sys2.wdir(ii);
    S14_bpr_2 = sys2.bpr(ii);
    S14_hrh_2 = sys2.hrh(ii);
    S14_atmp_2 = sys2.atmp(ii);
    S14_swr_2 = sys2.swr(ii);
    S14_lwr_2 = sys2.lwr(ii);
    S14_sst_2 = sys2.sst(ii);
end;




