%% Process CDOM from UV Spectrophotometer
%Assumes DI Blank done before and after samples, check this in file too.
%
%Calls functions
%(1) calc_CDOM_absorption_raw_csv_from_UVSpec
%(2) get_CDOM_avg_and_create_csv_struct
%
%KAF Dec 2016

%%
clear all

cruise='YR160414';
folder=('/Users/kelsey/Desktop/Dissertation/Profiler Surveys/York River/Axial Surveys/YR160414-Yktwn2WestPoint/CDOM Absorbance/');
distance=[10
    20
    30
    40
    50
    60];


filename=cellstr(['YR160414_CDOM_1.csv'
'YR160414_CDOM_2.csv']);
rowstart=41; %check the row that the actual data begins and subtract 1 from that

for kk=1:length(filename)
if ispc
    [~,fn,~]=fileparts(char(filename(kk)));
elseif isunix || ismac
    [~,fn,~]=fileparts(strrep(char(filename(kk)),'\','/'));
end   
    calc_CDOM_absorption_raw_csv_from_UVSpec(fn,rowstart)
    
end

get_CDOM_avg_and_create_csv_struct(cruise,folder,distance)