function sst = read_rosr_FATIMA_2022(dfl,dnums)
%{
    reads rosr sst from .mat file specified by dfl and returns array with the
    of same length as dnums.  rosr sst values are copied into the nearest
    minute timestamp of the input dnums timestamp array
    
    input parameters: dfl = string path to scs file
                      dnums = datenum time grid for resampling sst
%}

load(dfl,'sst_rosr'); % load table with raw rosr sst data

sst = NaN(length(dnums),1);

for ii=1:length(dnums)
    test = sst_rosr.dnum - dnums(ii);
    % find a rosr value that falls within 1-min after dnums(ii)
    jj = find(test>0 & test<=60/86400);
    if ~isempty(jj)
        sst(ii) = sst_rosr.ssst(jj); % copy it over if found
    end
end
end