function firstone = first_cl_node(Xs,Ys)
% Addresses need to remove an initial section of the centerline. The model
% produces applies a constant upstream curvature boundary condition that results in
% a growing linear stretch at the mouth of the centerline. This linear
% stretch should be removed before computing further statistics.
line_thresh = 1; % threshold below which points are considered part of initial straight line that is a product of the upstream boundary condtion
z = 2; % how many points to use to fit the line
[fitline] = polyfit(Xs(1:z),Ys(1:z),1); % find the slope and intercept of the line passing through z points
diffs = Ys - (fitline(2)+fitline(1)*Xs); % find difference between line and actual centerline
bigenough = abs(diffs) > line_thresh; % find centerline nodes that are not on the line
firstone = find(bigenough==1,1); % identify the first node not on the line
end