Commit 825798480b2e1a0cbc5dfe5a7d94d20504047e8f

Authored by Jean-Luc Shaw
1 parent 6b6023ba
Exists in master

Added option to flag beginning and end of deployment.

GUI_drifter_cleanup.m
... ... @@ -22,7 +22,7 @@ function varargout = GUI_drifter_cleanup(varargin)
22 22  
23 23 % Edit the above text to modify the response to help GUI_drifter_cleanup
24 24  
25   -% Last Modified by GUIDE v2.5 11-Apr-2018 13:27:51
  25 +% Last Modified by GUIDE v2.5 12-Apr-2018 10:49:43
26 26  
27 27 % Begin initialization code - DO NOT EDIT
28 28 gui_Singleton = 1;
... ... @@ -294,3 +294,21 @@ function menu_tide_files_CreateFcn(hObject, eventdata, handles)
294 294 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
295 295 set(hObject,'BackgroundColor','white');
296 296 end
  297 +
  298 +
  299 +% --- Executes on button press in rad_flag_deploy.
  300 +function rad_flag_deploy_Callback(hObject, eventdata, handles)
  301 +% hObject handle to rad_flag_deploy (see GCBO)
  302 +% eventdata reserved - to be defined in a future version of MATLAB
  303 +% handles structure with handles and user data (see GUIDATA)
  304 +
  305 +% Hint: get(hObject,'Value') returns toggle state of rad_flag_deploy
  306 +
  307 +
  308 +% --- Executes on button press in rad_flag_end.
  309 +function rad_flag_end_Callback(hObject, eventdata, handles)
  310 +% hObject handle to rad_flag_end (see GCBO)
  311 +% eventdata reserved - to be defined in a future version of MATLAB
  312 +% handles structure with handles and user data (see GUIDATA)
  313 +
  314 +% Hint: get(hObject,'Value') returns toggle state of rad_flag_end
... ...
documentation.txt
... ... @@ -27,6 +27,13 @@ Feel free to contact me if you have any questions.
27 27 Jean-Luc Shaw, M Sc student in physical oceanography
28 28 jean-luc.shaw@uqar.ca
29 29  
  30 +
  31 +Repository link:
  32 +
  33 +git@gitlasso.uqar.ca:shaj0004/Coastal-drifter-deployment-cleanup-utility.git
  34 +
  35 +
  36 +
30 37 ===== WORKFLOW =====
31 38  
32 39 First, your directory tree should be set up as follows:
... ... @@ -143,6 +150,11 @@ PUNCH OUT function is used and be incremented every following time,
143 150 producing a sequence of cleaned data tracks stored in independent '.mat'
144 151 files for every raw input file analysed.
145 152  
  153 + The two radio buttons adjacent to the punch out button provide with
  154 +the option to flag element I0 as the first data point after deployment,
  155 +and element If as the last recorded data point from this deployment. They
  156 +are optionnal and not mutually exclusive.
  157 +
146 158 OPERATION LOG :
147 159  
148 160 Operations DELETE, FILTER Z > X, INTERPOLATE, and PUNCH OUT are
... ...
lib/but_punch_out_Callback.m
... ... @@ -2,10 +2,12 @@ function but_punch_out_Callback(hObject, eventdata, handles)
2 2  
3 3 global S O tide cnt
4 4  
5   -I0 = str2num(handles.edit_I0.String);
6   -If = str2num(handles.edit_If.String);
7   -I = handles.menu_files.Value;
8   -fname = handles.menu_files.String{I}(1:end-4) ;
  5 +I0 = str2num(handles.edit_I0.String);
  6 +If = str2num(handles.edit_If.String);
  7 +I = handles.menu_files.Value;
  8 +fname = handles.menu_files.String{I}(1:end-4) ;
  9 +F_deploy = handles.rad_flag_deploy.Value ;
  10 +F_end = handles.rad_flag_end.Value ;
9 11  
10 12 %% Make output structure
11 13 O = [] ;
... ... @@ -15,6 +17,12 @@ O.dnum = S.dnum(I0:If) ;
15 17 [O.u,O.v,O.spd,head] = llt2spd(O.lon,O.lat,O.dnum) ;
16 18 O.head = theta2heading(head) ;
17 19  
  20 +% Flag beginning and end if warranted
  21 +O.flag = repmat({'OCN'},[numel(O.dnum) 1]) ;
  22 +if F_deploy ; O.flag{1} = 'DPL' ; end
  23 +if F_end ; O.flag{end} = 'END' ; end
  24 +
  25 +% Create optionnal fields according to available data
18 26 if isstruct(tide); O.time_AHT = interp1(tide.dnum,tide.time_AHT,S.dnum(I0:If)) ; end
19 27 if isfield(S,'z'); O.z = S.z(I0:If) ; end
20 28  
... ... @@ -40,6 +48,10 @@ handles.edit_If.String = num2str(N) ;
40 48 guidata(hObject, handles);
41 49 update_plots(hObject, eventdata, handles) ;
42 50  
  51 +% Reset flag radio buttons
  52 +handles.rad_flag_deploy.Value = false;
  53 +handles.rad_flag_end.Value = false;
  54 +
43 55 % Update handles structure
44 56 guidata(hObject, handles);
45 57  
... ...