%WhichInterpolationIsBest
%Edwin Kite

%Purpose: Determine which interpolation surface best recovers the by-hand
%unit assignments to F1 or F2.

for trs = 1:2 %ts = transect
load(strcat('outputWidthMeasurementsMarsRivers_Transect_',num2str(trs)))
    w(trs).s = s(11); %w for width
    w(trs).t = t; %w aggregated using tie numbers
end

    wz  = [w(1).s.cz, w(2).s.cz]'; %All widths (*not* collated; each bank-pair is one entry)
    wzs = [w(1).s.czs; w(2).s.czs]; %All widths (*not* collated; each bank-pair is one entry)
    wzu = [w(1).s.cbankunit, w(2).s.cbankunit]'

    wzu(wzu==-9) = 0;
   
for l = 1:4
    figure
    correct = ((sum(wzs(:,l)>0 & wzu==2) + sum(wzs(:,l)<0 & wzu==1) ) ./ sum(wzu~=0));
    scatter(1:length(wz),wzs(:,l),30,wzu,'Filled');
    hold on
    line([0 350],[0 0])
    title(strcat('Interpolation method: ',num2str(l),'. Fraction correct: ',num2str(correct)),'FontSize',20)
end
    