function Out = BinaryThresh(h,threshdepth)
%Take level sets of a function with more samples in the middle
%Level set height sampling done with equal area under sine function
%
%INPUTS
%  h = 500 x 500 matrix, input data set from PDE model
%  threshdepth = The positive value at which 
%
%OUTPUTS
%   Out = A z x 2 array which details the Area Fraction and the binary 
%         variable PathExist which indicates the presence of percolation
%         for each level set taken in melt
%
%By: Anthony Cheng (Mar 2015)
%===================================================================

melt = h >= threshdepth;
melt = +melt;
    
%-------------------------------------------------------------------
%Determine if percolation occurs at each sampled level set, and the
%Area Fraction at each level set
%-------------------------------------------------------------------
Out = CriticalArea(melt);

end