gdata = readtable("Diel_GPP_log.csv");
%%
% for mission = 1:height(gdata.MissionID)
for mission = 5
    FitModel = false;
    exportpdf = true;
    filename = char(gdata.Filename(mission));
    load(filename, 's'); % .mat file
    pdffilename = ['Mission_',num2str(gdata.MissionID(mission)),'_Profiles_',num2str(gdata.StartProf(mission)),'_',num2str(gdata.EndProf(mission)),'_Diel.pdf'];
    %% QC 
    if isnan(gdata.StartProf(mission))
        continue
    end
    
    idiel = gdata.StartProf(mission):gdata.EndProf(mission); % QC from spreadsheet
    iupper = 1:5; % Defining surface layer 0 to approx 2.5 m
    QC = char(strsplit(char(gdata.QC(mission)),','));
    QC = str2num(QC)';
    idiel(QC) = [];

end
