function varargout = ripcat(varargin) % RIPCAT M-file for ripcat.fig % RIPCAT, by itself, creates a new RIPCAT or raises the existing % singleton*. % % H = RIPCAT returns the handle to a new RIPCAT or the handle to % the existing singleton*. % % RIPCAT('CALLBACK',hObject,eventData,handles,...) calls the local % function named CALLBACK in RIPCAT.M with the given input arguments. % % RIPCAT('Property','Value',...) creates a new RIPCAT or raises the % existing singleton*. Starting from the left, property value pairs are % applied to the GUI before ripcat_OpeningFunction gets called. An % unrecognized property name or invalid value makes property application % stop. All inputs are passed to ripcat_OpeningFcn via varargin. % % *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one % instance to run (singleton)". % % See also: GUIDE, GUIDATA, GUIHANDLES % Edit the above text to modify the response to help ripcat % Last Modified by GUIDE v2.5 17-Mar-2004 16:17:21 % Begin initialization code - DO NOT EDIT gui_Singleton = 1; gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @ripcat_OpeningFcn, ... 'gui_OutputFcn', @ripcat_OutputFcn, ... 'gui_LayoutFcn', [] , ... 'gui_Callback', []); if nargin & isstr(varargin{1}) gui_State.gui_Callback = str2func(varargin{1}); end if nargout [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:}); else gui_mainfcn(gui_State, varargin{:}); end % End initialization code - DO NOT EDIT % --- Executes just before ripcat is made visible. function ripcat_OpeningFcn(hObject, eventdata, handles, varargin) % This function has no output args, see OutputFcn. % hObject handle to figure % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % varargin command line arguments to ripcat (see VARARGIN) global rcdata; rcdata.dep = 2; % change deployment number here % ASCII file with sonar data filenames if(rcdata.dep==1), load settings_d1; fid = fopen('sonar_fnames_dep1.txt','r'); elseif(rcdata.dep==2), load settings_d2; fid = fopen('sonar_fnames_dep2.txt','r'); end % read the names i=1; while( ~feof(fid) ), rcdata.filenames{i} = fgetl(fid); i=i+1; end fclose(fid); rcdata.settings = settings; if(exist('ripcatout.csv')==2), fprintf(1,'Warning: appending to existing file. Maybe delete or rename ripcatout.csv.\n') end rcdata.fno = 1; rcdata.nfno = length(rcdata.filenames); rcdata.spacing = 0.5; rcdata.orientation = 45; rcdata.bgcolor = get(handles.plot_button,'BackgroundColor'); rcdata.ogx = 1; rcdata.ogy = 1; rcdata.reset_axis = 1; rcdata.origin = sqrt(2); rcdata.dxy = 0.04; rcdata.ncrest = 0; rcdata.spacing = 1; rcdata.lambda = -99; rcdata.elev = .5; rcdata.dq = 0; rcdata.rclass = 1; rcdata.lsclass = 1; rcdata.ssclass = 1; rcdata.change = 1; rcdata.comments = 'none'; rcdata.reset_axis = 1; rcdata.fig1_axis = [-5 5 -5 5]; whole_fname = sprintf('%s',rcdata.filenames{rcdata.fno}); [pathstr,fname,fext,fver]=fileparts(whole_fname); gdate = [rcdata.settings.datayear str2num(fname(3:4)) str2num(fname(5:6)) str2num(fname(7:8)) str2num(fext(3:4)) 0]; dn = datenum( gdate ); rcdata.datestr = datestr(dn,2); rcdata.timestr = datestr(dn,15); set(handles.fno_etext,'String',num2str(rcdata.fno)); set(handles.date_etext,'String',[rcdata.datestr,' ',rcdata.timestr]); set(handles.fname_etext,'String',whole_fname); set(handles.ogx_etext,'String',num2str(rcdata.ogx)); set(handles.ogy_etext,'String',num2str(rcdata.ogy)); set(handles.dxy_etext,'String',num2str(rcdata.dxy)); set(handles.spacing_slider,'Value',rcdata.spacing); set(handles.spacing_edit,'String',... num2str(get(handles.spacing_slider,'Value'))); set(handles.orientation_slider,'Value',rcdata.orientation); set(handles.orientation_edit,'String',... num2str(get(handles.orientation_slider,'Value'))); % First plot rcdata.fig1 = figure(1); clf; guidata(hObject, handles); handles = refile(handles); % Update handles structure guidata(hObject, handles); % UIWAIT makes ripcat wait for user response (see UIRESUME) %uiwait(handles.figure1); % --- Outputs from this function are returned to the command line. function varargout = ripcat_OutputFcn(hObject, eventdata, handles) % varargout cell array for returning output args (see VARARGOUT); % hObject handle to figure % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Get default command line output from handles structure global output_struct; varargout{1} = output_struct; % --- Executes during object creation, after setting all properties. function spacing_slider_CreateFcn(hObject, eventdata, handles) % hObject handle to spacing_slider (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: slider controls usually have a light gray background, change % 'usewhitebg' to 0 to use default. See ISPC and COMPUTER. usewhitebg = 1; if usewhitebg set(hObject,'BackgroundColor',[.9 .9 .9]); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end % --- Executes on slider movement. function spacing_slider_Callback(hObject, eventdata, handles) % hObject handle to spacing_slider (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'Value') returns position of slider % get(hObject,'Min') and get(hObject,'Max') to determine range of % slider global rcdata val = get(handles.spacing_slider,'Value'); val = max(val,get(hObject,'Min')); val = min(val,get(hObject,'Max')); rcdata.spacing= val; set(handles.spacing_edit,'String',sprintf('%5.2f',rcdata.spacing)); set(handles.spacing_slider,'Value',rcdata.spacing); % Update handles structure guidata(hObject, handles); update_agrid(handles); % --- Executes during object creation, after setting all properties. function orientation_slider_CreateFcn(hObject, eventdata, handles) % hObject handle to orientation_slider (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: slider controls usually have a light gray background, change % 'usewhitebg' to 0 to use default. See ISPC and COMPUTER. usewhitebg = 1; if usewhitebg set(hObject,'BackgroundColor',[.9 .9 .9]); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end % --- Executes on slider movement. function orientation_slider_Callback(hObject, eventdata, handles) % hObject handle to orientation_slider (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'Value') returns position of slider % get(hObject,'Min') and get(hObject,'Max') to determine range of slider global rcdata val = round(get(handles.orientation_slider,'Value')); val = max(val,get(hObject,'Min')); val = min(val,get(hObject,'Max')); rcdata.orientation = val; set(handles.orientation_edit,'String',num2str(rcdata.orientation)); % Update handles structure guidata(hObject, handles); update_agrid(handles); % --- Executes on button press in done_button. function done_button_Callback(hObject, eventdata, handles) % hObject handle to done_button (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % --- Executes during object creation, after setting all properties. function data_quality_popupmenu_CreateFcn(hObject, eventdata, handles) % hObject handle to data_quality_popupmenu (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: popupmenu controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc set(hObject,'BackgroundColor','white'); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end % --- Executes on selection change in data_quality_popupmenu. function data_quality_popupmenu_Callback(hObject, eventdata, handles) % hObject handle to data_quality_popupmenu (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: contents = get(hObject,'String') returns data_quality_popupmenu contents as cell array % contents{get(hObject,'Value')} returns selected item from data_quality_popupmenu global rcdata rcdata.dq = get(hObject,'Value'); % --- Executes during object creation, after setting all properties. function ripple_category_popupmenu_CreateFcn(hObject, eventdata, handles) % hObject handle to ripple_category_popupmenu (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: popupmenu controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc set(hObject,'BackgroundColor','white'); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end % --- Executes on selection change in ripple_category_popupmenu. function ripple_category_popupmenu_Callback(hObject, eventdata, handles) % hObject handle to ripple_category_popupmenu (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: contents = get(hObject,'String') returns ripple_category_popupmenu contents as cell array % contents{get(hObject,'Value')} returns selected item from ripple_category_popupmenu global rcdata rcdata.rclass = get(hObject,'Value'); % --- Executes during object creation, after setting all properties. function spacing_edit_CreateFcn(hObject, eventdata, handles) % hObject handle to spacing_edit (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc set(hObject,'BackgroundColor','white'); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end function spacing_edit_Callback(hObject, eventdata, handles) % hObject handle to spacing_edit (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of spacing_edit as text % str2double(get(hObject,'String')) returns contents of spacing_edit as a double global rcdata rcdata.spacing = 0.01*round(100*str2double(get(hObject,'String'))); set(handles.spacing_slider,'Value',rcdata.spacing); set(handles.spacing_edit,'String',sprintf('%6.2f',rcdata.spacing)); % Update handles structure guidata(hObject, handles); update_agrid(handles); % --- Executes during object creation, after setting all properties. function orientation_edit_CreateFcn(hObject, eventdata, handles) % hObject handle to orientation_edit (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc set(hObject,'BackgroundColor','white'); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end function orientation_edit_Callback(hObject, eventdata, handles) % hObject handle to og_etext (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of og_etext as text % str2double(get(hObject,'String')) returns contents of og_etext as a double global rcdata rcdata.orientation = round( str2double(get(hObject,'String')) ); set(handles.orientation_slider,'Value',rcdata.orientation); % Update handles structure guidata(hObject, handles); update_agrid(handles); % --- Executes on button press in save_button. function save_button_Callback(hObject, eventdata, handles) % hObject handle to save_button (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) global rcdata fid = fopen('ripcatout.csv','a'); tx = sprintf('%d, %s, %s, % 5.2f, % 5.2f, % 5.2f, % 5.2f, % 5.2f, % 5.2f, % 2d, % 5.2f, %d, %d, %d, %d, %d, %s',... rcdata.fno, rcdata.datestr, rcdata.timestr, rcdata.elev, rcdata.ogx, rcdata.ogy,... rcdata.spacing, rcdata.orientation, rcdata.origin, rcdata.ncrest, rcdata.lambda,... rcdata.dq, rcdata.rclass, rcdata.lsclass, rcdata.ssclass, rcdata.change, rcdata.comments); fprintf(fid,'%s\n',tx); fprintf(1,'%s\n',tx); fclose(fid); % --- Executes during object creation, after setting all properties. function fname_etext_CreateFcn(hObject, eventdata, handles) % hObject handle to fname_etext (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc set(hObject,'BackgroundColor','white'); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end function fname_etext_Callback(hObject, eventdata, handles) % hObject handle to fname_etext (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of fname_etext as text % str2double(get(hObject,'String')) returns contents of fname_etext as a double % --- Executes during object creation, after setting all properties. function fresh_text_CreateFcn(hObject, eventdata, handles) % hObject handle to fresh_text (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc set(hObject,'BackgroundColor','white'); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end function fresh_text_Callback(hObject, eventdata, handles) % hObject handle to fresh_text (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of fresh_text as text % str2double(get(hObject,'String')) returns contents of fresh_text as a double % --- Executes during object creation, after setting all properties. function change_popupmenu_CreateFcn(hObject, eventdata, handles) % hObject handle to change_popupmenu (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: popupmenu controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc set(hObject,'BackgroundColor','white'); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end % --- Executes on selection change in change_popupmenu. function change_popupmenu_Callback(hObject, eventdata, handles) % hObject handle to change_popupmenu (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: contents = get(hObject,'String') returns change_popupmenu contents as cell array % contents{get(hObject,'Value')} returns selected item from change_popupmenu global rcdata rcdata.change = get(hObject,'Value'); function update_agrid(handles) global rcdata az = rcdata.orientation; sp = rcdata.spacing; % in bottom range units ogx = rcdata.ogx; ogy = rcdata.ogy; elev = rcdata.elev; figure(1); rcdata.fig_axis = axis; cla; % calc. origin in bottom coords [rs,a]=pcoord(ogx,ogy); if(rs > elev ), rb = sqrt(rs^2 - elev^2); else rb = 0; end [xb,yb]=xycoord(rb,a); % line 1 [mpx,mpy]=xycoord(-sp/2,az); shiftr=(-1:.5:+1)'; shifta= (az+90) .* ones(size(shiftr)); [shiftx,shifty]=xycoord(shiftr,shifta); [Rb,Ab]=pcoord(xb+mpx+shiftx,yb+mpy+shifty); Rs = sqrt( elev.^2 + Rb.^2 ); [X1,Y1]=xycoord(Rs,Ab); % line 2 [mpx,mpy]=xycoord(sp/2,az); shiftr=(-1:.5:+1)'; shifta= (az+90) .* ones(size(shiftr)); [shiftx,shifty]=xycoord(shiftr,shifta); [Rb,Ab]=pcoord(xb+mpx+shiftx,yb+mpy+shifty); Rs = sqrt( elev.^2 + Rb.^2 ); [X2,Y2]=xycoord(Rs,Ab); Xplot = rcdata.Xplot; Yplot = rcdata.Yplot; Zi = rcdata.Zi; imagesc(Xplot,Yplot,Zi); set(gca,'ydir','normal') % because imagesc is sidedownup if(1), % plot range circles hold on for icirc = 1:5, h = circle(icirc,0,0); set(h,'color',[.7 .7 .6]) end end %text(0.01,0.03,fname,... % 'units','normalized','color','y','fontsize',14) text(0.8,0.95,'\uparrow North',... 'units','normalized','color','y','fontsize',14) %text(0.57,0.03,datestr(datenum(gdate)),... %'units','normalized','color','y','fontsize',14) h=line(X1,Y1); set(h,'color','y','linestyle','-'); h=line(X2,Y2); set(h,'color','y','linestyle','--'); circle(rcdata.elev,0,0,'-m'); axis('square'); axis('equal'); if(rcdata.reset_axis == 1), axis([-5 5 -5 5]); else axis(rcdata.fig1_axis); end rcdata.reset_axis = 0; colormap gray; % --- Executes during object creation, after setting all properties. function fno_etext_CreateFcn(hObject, eventdata, handles) % hObject handle to fno_etext (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc set(hObject,'BackgroundColor','white'); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end function fno_etext_Callback(hObject, eventdata, handles) % hObject handle to fno_etext (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of fno_etext as text % str2double(get(hObject,'String')) returns contents of fno_etext as a double global rcdata; fno = round(str2double(get(hObject,'String'))); fno = min(fno,rcdata.nfno); fno = max(fno,1); rcdata.fno = fno; set(handles.fno_etext,'String',num2str(rcdata.fno)); set(handles.fname_slider,'Value',rcdata.fno); set(handles.plot_button,'BackgroundColor',[.8 .5 .5]); whole_fname = sprintf('%s',rcdata.filenames{rcdata.fno}); set(handles.fname_etext,'String',whole_fname); [pathstr,fname,fext,fver]=fileparts(whole_fname); gdate = [rcdata.settings.datayear str2num(fname(3:4)) str2num(fname(5:6)) str2num(fname(7:8)) str2num(fext(3:4)) 0]; jdate = julian(gdate); dn = datenum( gdate ); rcdata.datestr = datestr(dn,2); rcdata.timestr = datestr(dn,15); set(handles.date_etext,'String',[rcdata.datestr,' ',rcdata.timestr]); % Update handles structure guidata(hObject, handles); % --- Executes during object creation, after setting all properties. function date_etext_CreateFcn(hObject, eventdata, handles) % hObject handle to date_etext (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc set(hObject,'BackgroundColor','white'); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end function date_etext_Callback(hObject, eventdata, handles) % hObject handle to date_etext (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of date_etext as text % str2double(get(hObject,'String')) returns contents of date_etext as a double % --- Executes during object creation, after setting all properties. function time_etext_CreateFcn(hObject, eventdata, handles) % hObject handle to time_etext (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc set(hObject,'BackgroundColor','white'); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end function time_etext_Callback(hObject, eventdata, handles) % hObject handle to time_etext (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of time_etext as text % str2double(get(hObject,'String')) returns contents of time_etext as a double % --- Executes during object creation, after setting all properties. function comment_etext_CreateFcn(hObject, eventdata, handles) % hObject handle to comment_etext (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc set(hObject,'BackgroundColor','white'); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end function comment_etext_Callback(hObject, eventdata, handles) % hObject handle to comment_etext (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of comment_etext as text % str2double(get(hObject,'String')) returns contents of comment_etext as a double global rcdata rcdata.comments = get(hObject,'String'); % --- Executes during object creation, after setting all properties. function fname_slider_CreateFcn(hObject, eventdata, handles) % hObject handle to fname_slider (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: slider controls usually have a light gray background, change % 'usewhitebg' to 0 to use default. See ISPC and COMPUTER. usewhitebg = 1; if usewhitebg set(hObject,'BackgroundColor',[.9 .9 .9]); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end % --- Executes on slider movement. function fname_slider_Callback(hObject, eventdata, handles) % hObject handle to fname_slider (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'Value') returns position of slider % get(hObject,'Min') and get(hObject,'Max') to determine range of slider global rcdata; fno = round( get(handles.fname_slider,'Value') ); fno = max(1,fno); fno = min(rcdata.nfno,fno); rcdata.fno = fno; set(handles.fno_etext,'String',num2str(rcdata.fno)); set(handles.fname_slider,'Value',rcdata.fno); set(handles.plot_button,'BackgroundColor',[.8 .5 .5]); whole_fname = sprintf('%s',rcdata.filenames{rcdata.fno}); set(handles.fname_etext,'String',whole_fname); [pathstr,fname,fext,fver]=fileparts(whole_fname); gdate = [rcdata.settings.datayear str2num(fname(3:4)) str2num(fname(5:6)) str2num(fname(7:8)) str2num(fext(3:4)) 0]; jdate = julian(gdate); dn = datenum( gdate ); rcdata.datestr = datestr(dn,2); rcdata.timestr = datestr(dn,15); set(handles.date_etext,'String',[rcdata.datestr,' ',rcdata.timestr]); % Update handles structure guidata(hObject, handles); % --- Executes on button press in plot_button. function plot_button_Callback(hObject, eventdata, handles) % hObject handle to plot_button (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) handles = refile(handles); % Update handles structure guidata(hObject, handles); % --- Executes during object creation, after setting all properties. function ogx_etext_CreateFcn(hObject, eventdata, handles) % hObject handle to ogx_etext (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc set(hObject,'BackgroundColor','white'); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end function ogx_etext_Callback(hObject, eventdata, handles) % hObject handle to ogx_etext (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of ogx_etext as text % str2double(get(hObject,'String')) returns contents of ogx_etext as a double global rcdata ogx = str2double( get(hObject,'String') ); ogx = round(ogx*100)/100; rcdata.ogx = ogx; set(handles.ogx_etext,'String',num2str(rcdata.ogx)); % Update handles structure guidata(hObject, handles); update_agrid; % --- Executes during object creation, after setting all properties. function ogy_etext_CreateFcn(hObject, eventdata, handles) % hObject handle to ogy_etext (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc set(hObject,'BackgroundColor','white'); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end function ogy_etext_Callback(hObject, eventdata, handles) % hObject handle to ogy_etext (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of ogy_etext as text % str2double(get(hObject,'String')) returns contents of ogy_etext as a double global rcdata ogy = str2double( get(hObject,'String')); ogy = round(ogy*100)/100; rcdata.ogy = ogy; set(handles.ogy_etext,'String',num2str(rcdata.ogy)); % Update handles structure guidata(hObject, handles); update_agrid; % --- Executes during object creation, after setting all properties. function ncrest_etext_CreateFcn(hObject, eventdata, handles) % hObject handle to ncrest_etext (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc set(hObject,'BackgroundColor','white'); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end function ncrest_etext_Callback(hObject, eventdata, handles) % hObject handle to ncrest_etext (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of ncrest_etext as text % str2double(get(hObject,'String')) returns contents of ncrest_etext as a double global rcdata rcdata.ncrest = round(str2num(get(hObject,'String'))); if(rcdata.ncrest < 2), rcdata.ncrest = -99;, end if(rcdata.ncrest > 20), rcdata.ncrest = -99;, end set(handles.ncrest_etext,'String',sprintf('%d',rcdata.ncrest)); rcdata.lambda = -99; if( (rcdata.spacing > 0)&(rcdata.ncrest>1) ), rcdata.lambda = round(100*(rcdata.spacing / (rcdata.ncrest-1)))/100; end set(handles.lambda_etext,'String',sprintf('%5.2f',rcdata.lambda)), % Update handles structure guidata(hObject, handles); update_agrid; % --- Executes during object creation, after setting all properties. function lambda_etext_CreateFcn(hObject, eventdata, handles) % hObject handle to lambda_etext (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc set(hObject,'BackgroundColor','white'); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end function lambda_etext_Callback(hObject, eventdata, handles) % hObject handle to lambda_etext (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of lambda_etext as text % str2double(get(hObject,'String')) returns contents of lambda_etext as a double % --- Executes during object creation, after setting all properties. function og_slider_CreateFcn(hObject, eventdata, handles) % hObject handle to og_slider (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: slider controls usually have a light gray background, change % 'usewhitebg' to 0 to use default. See ISPC and COMPUTER. usewhitebg = 1; if usewhitebg set(hObject,'BackgroundColor',[.9 .9 .9]); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end % --- Executes on slider movement. function og_slider_Callback(hObject, eventdata, handles) % hObject handle to og_slider (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'Value') returns position of slider % get(hObject,'Min') and get(hObject,'Max') to determine range of slider global rcdata val = get(handles.og_slider,'Value'); val = max(val,get(hObject,'Min')); val = min(val,get(hObject,'Max')); rcdata.origin= val; set(handles.og_etext,'String',num2str(rcdata.origin)); [ogx,ogy]=xycoord(rcdata.origin,rcdata.orientation); rcdata.ogx = ogx; rcdata.ogy = ogy; set(handles.ogx_etext,'String',num2str(rcdata.ogx)); set(handles.ogy_etext,'String',num2str(rcdata.ogy)); % Update handles structure guidata(hObject, handles); update_agrid; % --- Executes during object creation, after setting all properties. function og_etext_CreateFcn(hObject, eventdata, handles) % hObject handle to og_etext (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc set(hObject,'BackgroundColor','white'); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end function og_etext_Callback(hObject, eventdata, handles) % hObject handle to og_etext (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of og_etext as text % str2double(get(hObject,'String')) returns contents of og_etext as a double global rcdata val = str2double(get(handles.og_etext,'String')); val = max(val,-5); val = min(val,5); rcdata.origin= val; set(handles.og_etext,'String',num2str(rcdata.origin)); set(handles.og_slider,'Value',val); [ogx,ogy]=xycoord(rcdata.origin,rcdata.orientation); rcdata.ogx = ogx; rcdata.ogy = ogy; set(handles.ogx_etext,'String',num2str(rcdata.ogx)); set(handles.ogy_etext,'String',num2str(rcdata.ogy)); % Update handles structure guidata(hObject, handles); update_agrid; % --- Executes during object creation, after setting all properties. function dxy_etext_CreateFcn(hObject, eventdata, handles) % hObject handle to dxy_etext (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc set(hObject,'BackgroundColor','white'); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end function dxy_etext_Callback(hObject, eventdata, handles) % hObject handle to dxy_etext (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of dxy_etext as text % str2double(get(hObject,'String')) returns contents of dxy_etext as a double global rcdata dxy = str2double(get(hObject,'String')); dxy = min(dxy,.2); dxy = max(dxy,.001); rcdata.dxy = dxy; set(handles.plot_button,'BackgroundColor',[.8 .5 .5]); set(hObject,'String',num2str(rcdata.dxy)); handles = refile(handles); % Update handles structure guidata(hObject, handles); function handles=refile(handles); global rcdata rcdata.reset_axis = 1; fno = rcdata.fno; [Xplot, Yplot, Zi, settings] = ... interpfan(rcdata.filenames{fno},rcdata.settings,rcdata.dxy,0); rcdata.Xplot = Xplot; rcdata.Yplot = Yplot; rcdata.Zi = Zi; update_agrid; set(handles.plot_button,'BackgroundColor',rcdata.bgcolor); % --- Executes on button press in fig_button. function fig_button_Callback(hObject, eventdata, handles) % hObject handle to fig_button (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) global rcdata figure(1); [ogx,ogy]=ginput(1); rcdata.ogx = ogx; rcdata.ogy = ogy; [rcdata.origin,rcaz] = pcoord(ogx,ogy); set(handles.og_etext,'String',sprintf('%5.2f',rcdata.origin)); set(handles.ogx_etext,'String',sprintf('%5.2f',rcdata.ogx)); set(handles.ogy_etext,'String',sprintf('%5.2f',rcdata.ogy)); % Update handles structure guidata(hObject, handles); update_agrid; % --- Executes during object creation, after setting all properties. function elevation_etext_CreateFcn(hObject, eventdata, handles) % hObject handle to elevation_etext (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc set(hObject,'BackgroundColor','white'); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end function elevation_etext_Callback(hObject, eventdata, handles) % hObject handle to elevation_etext (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of elevation_etext as text % str2double(get(hObject,'String')) returns contents of elevation_etext as a double global rcdata elev = str2double(get(hObject,'String')); elev = min(elev,2); elev = max(elev,.1); rcdata.elev = elev; set(handles.elevation_etext,'String',sprintf('%4.2f',rcdata.elev)); guidata(hObject,handles); update_agrid; % --- Executes on button press in elevation_button. function elevation_button_Callback(hObject, eventdata, handles) % hObject handle to elevation_button (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) global rcdata figure(1); [rx,ry]=ginput(1); [rcdata.elev,raz]=pcoord(rx,ry); set(handles.elevation_etext,'String',sprintf('%4.2f',rcdata.elev)); guidata(hObject,handles); update_agrid; % --- Executes on button press in prevbutton. function prevbutton_Callback(hObject, eventdata, handles) % hObject handle to prevbutton (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) global rcdata; fno = rcdata.fno - 1; fno = min(fno,rcdata.nfno); fno = max(fno,1); rcdata.fno = fno; set(handles.fno_etext,'String',num2str(rcdata.fno)); set(handles.fname_slider,'Value',rcdata.fno); set(handles.plot_button,'BackgroundColor',[.8 .5 .5]); whole_fname = sprintf('%s',rcdata.filenames{rcdata.fno}); set(handles.fname_etext,'String',whole_fname); [pathstr,fname,fext,fver]=fileparts(whole_fname); gdate = [rcdata.settings.datayear str2num(fname(3:4)) str2num(fname(5:6)) str2num(fname(7:8)) str2num(fext(3:4)) 0]; jdate = julian(gdate); dn = datenum( gdate ); rcdata.datestr = datestr(dn,2); rcdata.timestr = datestr(dn,15); set(handles.date_etext,'String',[rcdata.datestr,' ',rcdata.timestr]); % Update handles structure guidata(hObject, handles); % --- Executes on button press in next_button. function next_button_Callback(hObject, eventdata, handles) % hObject handle to next_button (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) global rcdata; fno = rcdata.fno + 1; fno = min(fno,rcdata.nfno); fno = max(fno,1); rcdata.fno = fno; set(handles.fno_etext,'String',num2str(rcdata.fno)); set(handles.fname_slider,'Value',rcdata.fno); set(handles.plot_button,'BackgroundColor',[.8 .5 .5]); whole_fname = sprintf('%s',rcdata.filenames{rcdata.fno}); set(handles.fname_etext,'String',whole_fname); [pathstr,fname,fext,fver]=fileparts(whole_fname); gdate = [rcdata.settings.datayear str2num(fname(3:4)) str2num(fname(5:6)) str2num(fname(7:8)) str2num(fext(3:4)) 0]; jdate = julian(gdate); dn = datenum( gdate ); rcdata.datestr = datestr(dn,2); rcdata.timestr = datestr(dn,15); set(handles.date_etext,'String',[rcdata.datestr,' ',rcdata.timestr]); % Update handles structure guidata(hObject, handles); % --- Executes during object creation, after setting all properties. function ls_popupmenu_CreateFcn(hObject, eventdata, handles) % hObject handle to ls_popupmenu (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: popupmenu controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc set(hObject,'BackgroundColor','white'); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end % --- Executes on selection change in ls_popupmenu. function ls_popupmenu_Callback(hObject, eventdata, handles) % hObject handle to ls_popupmenu (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: contents = get(hObject,'String') returns ls_popupmenu contents as cell array % contents{get(hObject,'Value')} returns selected item from ls_popupmenu global rcdata rcdata.lsclass = get(hObject,'Value'); % --- Executes during object creation, after setting all properties. function ss_popupmenu_CreateFcn(hObject, eventdata, handles) % hObject handle to ss_popupmenu (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: popupmenu controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc set(hObject,'BackgroundColor','white'); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end % --- Executes on selection change in ss_popupmenu. function ss_popupmenu_Callback(hObject, eventdata, handles) % hObject handle to ss_popupmenu (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: contents = get(hObject,'String') returns ss_popupmenu contents as cell array % contents{get(hObject,'Value')} returns selected item from ss_popupmenu global rcdata rcdata.ssclass = get(hObject,'Value');