but_bathy_filter_Callback.m 809 Bytes
function but_bathy_filter_Callback(hObject, eventdata, handles)

global S

if isfield(S,'z')
    zmin      = str2num(handles.edit_zmin.String) ;
    I         = find(S.z < zmin) ;
    S.lon(I)  = [] ;
    S.lat(I)  = [] ;
    S.dnum(I) = [] ;
    S.z(I)    = [] ;
    If                     = str2num(handles.edit_If.String) ;
    I0                     = str2num(handles.edit_I0.String) ;
    nIf                    = str2num(handles.edit_If.String) - numel(I) ;
    handles.edit_If.String = num2str(nIf) ;
    guidata(hObject, handles);
    update_plots(hObject, eventdata, handles) ;
    
    % write to logfile
    N = numel(S.dnum) ; % track size
    fprintf(handles.logfid,'%s,%d,%d,%f,%d\n','bathy_filter',I0,If,zmin,N) ;
else
    msgbox('No z computed for GPS track. Load bathymetry file!')
end

end