NCCOOS Trac Projects: Top | Web | Platforms | Processing | Viz | Sprints | Sandbox | (Wind)

root/gliderproc/trunk/gliderCTD_DataViz.m

Revision 495 (checked in by cbc, 11 years ago)

Initial import of Stark code.

Line 
1 %
2 %   gliderCTD_DataViz.m
3 %
4 %   Purpose:  glider CTD data plots user interface
5 %
6 %   Requires:
7 %       gliderCTD_GeneratePlots.m
8 %       gliderCTD_2DPlots.m
9 %       gliderCTD_3DPlots.m
10 %       BATHYMETRY folder - contains bathymetry data
11 %       MATLAB folder - contains util, matutil, seawater, plots, strfun, opnml
12 %       CLIDER_CTD_DATA_LEVEL1 folder - contains Level 1 .mat files
13 %
14 %
15 %   Author:  William Stark
16 %            Marine Sciences Department
17 %            UNC-Chapel Hill
18 %
19 %   Created: 18 June 2012
20 %
21 %//////////////////////////////////////////////////////////////////////////
22
23
24 function varargout = gliderCTD_DataViz(varargin)
25 %       Description:  User interface for specifying and displaying
26 %                     Slocum glider CTD data visualization plots.
27
28 % (Leave a blank line following the help.)
29
30
31 % global variables...
32 global mGliderIndex;
33 global mDeploymentNumber;
34 global mLegNumber;
35 global mPlotFlag_TS;
36 global mPlotFlag_TS_AllLegs;
37 global mPlotFlag_TS_Chlorophyll;
38 global mPlotFlag_Temperature;
39 global mPlotFlag_Salinity;
40 global mPlotFlag_Density;
41 global mPlotFlag_Chlorophyll;
42 global mPlotFlag_TemperatureProfile;
43 global mPlotFlag_SalinityProfile;
44 global mPlotFlag_DensityProfile;
45 global mPlotFlag_ChlorophyllProfile;
46 global mPlotFlag_Temperature3D;
47 global mPlotFlag_Salinity3D;
48 global mPlotFlag_Density3D;
49 global mPlotFlag_Chlorophyll3D;
50 global mPlotFlag_AllGliderTracks;
51
52 global mStrPelagiaD1Complete_DateRange;
53 global mStrPelagiaD1L1_DateRange;
54 global mStrPelagiaD1L2_DateRange;
55 global mStrPelagiaD1L3_DateRange;
56 global mStrPelagiaD2Complete_DateRange;
57 global mStrPelagiaD2L1_DateRange;
58 global mStrPelagiaD2L2_DateRange;
59 global mStrPelagiaD2L3_DateRange;
60 global mStrPelagiaD2L4_DateRange;
61 global mStrPelagiaD2L5_DateRange;
62 global mStrPelagiaD3Complete_DateRange;
63 global mStrPelagiaD3L1_DateRange;
64 global mStrPelagiaD3L2_DateRange;
65 global mStrPelagiaD3L3_DateRange;
66 global mStrPelagiaD3L4_DateRange;
67 global mStrPelagiaD3L5_DateRange;
68 global mStrPelagiaD3L6_DateRange;
69
70 global mStrRamsesD1Complete_DateRange;
71 global mStrRamsesD1L1_DateRange;
72 global mStrRamsesD1L2_DateRange;
73 global mStrRamsesD1L3_DateRange;
74 global mStrRamsesD1L4_DateRange;
75 global mStrRamsesD1L5_DateRange;
76 global mStrRamsesD2Complete_DateRange;
77 global mStrRamsesD2L1_DateRange;
78 global mStrRamsesD2L2_DateRange;
79 global mStrRamsesD2L3_DateRange;
80 global mStrRamsesD2L4_DateRange;
81 global mStrRamsesD3Complete_DateRange;
82 global mStrRamsesD3L1_DateRange;
83 global mStrRamsesD3L2_DateRange;
84 global mStrRamsesD3L3_DateRange;
85 global mStrRamsesD3L4_DateRange;
86
87 global mStrComplete_DateRange;
88 global mStrLeg1_DateRange;
89 global mStrLeg2_DateRange;
90 global mStrLeg3_DateRange;
91 global mStrLeg4_DateRange;
92 global mStrLeg5_DateRange;
93 global mStrLeg6_DateRange;
94
95 % initial values...
96 mGliderIndex = 1;
97 mDeploymentNumber = 1;
98 mLegNumber = 0;
99 mPlotFlag_TS = 0;
100 mPlotFlag_TS_AllLegs = 0;
101 mPlotFlag_TS_Chlorophyll = 0;
102 mPlotFlag_Temperature = 0;
103 mPlotFlag_Salinity = 0;
104 mPlotFlag_Density = 0;
105 mPlotFlag_Chlorophyll = 0;
106 mPlotFlag_TemperatureProfile = 0;
107 mPlotFlag_SalinityProfile = 0;
108 mPlotFlag_DensityProfile = 0;
109 mPlotFlag_ChlorophyllProfile = 0;
110 mPlotFlag_Temperature3D = 0;
111 mPlotFlag_Salinity3D = 0;
112 mPlotFlag_Density3D = 0;
113 mPlotFlag_Chlorophyll3D = 0;
114 mPlotFlag_AllGliderTracks = 0;
115
116 mStrPelagiaD1Complete_DateRange = '26-Jan-2012 01:57:14  to  14-Feb-2012 17:10:38';
117 mStrPelagiaD1L1_DateRange =       '26-Jan-2012 01:57:14  to  31-Jan-2012 12:00:00';
118 mStrPelagiaD1L2_DateRange =       '31-Jan-2012 12:00:01  to  08-Feb-2012 12:00:00';
119 mStrPelagiaD1L3_DateRange =       '08-Feb-2012 12:00:01  to  14-Feb-2012 17:10:38';
120
121 mStrPelagiaD2Complete_DateRange = '16-Feb-2012 13:47:27  to  08-Mar-2012 12:36:28';
122 mStrPelagiaD2L1_DateRange =       '16-Feb-2012 13:47:27  to  18-Feb-2012 10:30:00';
123 mStrPelagiaD2L2_DateRange =       '18-Feb-2012 10:30:01  to  20-Feb-2012 06:00:00';
124 mStrPelagiaD2L3_DateRange =       '20-Feb-2012 06:00:01  to  23-Feb-2012 05:30:00';
125 mStrPelagiaD2L4_DateRange =       '23-Feb-2012 05:30:01  to  29-Feb-2012 02:30:00';
126 mStrPelagiaD2L5_DateRange =       '29-Feb-2012 02:30:01  to  08-Mar-2012 12:36:28';
127
128 mStrPelagiaD3Complete_DateRange = '16-Mar-2012 12:58:45  to  04-Apr-2012 10:36:01';
129 mStrPelagiaD3L1_DateRange =       '16-Mar-2012 12:58:45  to  18-Mar-2012 21:40:00';
130 mStrPelagiaD3L2_DateRange =       '18-Mar-2012 21:40:01  to  22-Mar-2012 17:30:00';
131 mStrPelagiaD3L3_DateRange =       '22-Mar-2012 17:30:01  to  25-Mar-2012 14:00:00';
132 mStrPelagiaD3L4_DateRange =       '25-Mar-2012 14:00:01  to  28-Mar-2012 22:00:00';
133 mStrPelagiaD3L5_DateRange =       '28-Mar-2012 22:00:01  to  31-Mar-2012 19:00:00';
134 mStrPelagiaD3L6_DateRange =       '31-Mar-2012 19:00:01  to  04-Apr-2012 10:36:01';
135
136 mStrRamsesD1Complete_DateRange =  '26-Jan-2012 01:06:22  to  14-Feb-2012 12:35:11';
137 mStrRamsesD1L1_DateRange =        '26-Jan-2012 01:06:22  to  28-Jan-2012 20:00:00';
138 mStrRamsesD1L2_DateRange =        '28-Jan-2012 20:00:01  to  30-Jan-2012 03:00:00';
139 mStrRamsesD1L3_DateRange =        '30-Jan-2012 03:00:01  to  31-Jan-2012 14:00:00';
140 mStrRamsesD1L4_DateRange =        '31-Jan-2012 14:00:01  to  07-Feb-2012 10:30:00';
141 mStrRamsesD1L5_DateRange =        '07-Feb-2012 10:30:01  to  14-Feb-2012 12:35:11';
142
143 mStrRamsesD2Complete_DateRange =  '16-Feb-2012 01:29:39  to  12-Mar-2012 16:24:18';
144 mStrRamsesD2L1_DateRange =        '16-Feb-2012 01:29:39  to  28-Feb-2012 12:00:00';
145 mStrRamsesD2L2_DateRange =        '28-Feb-2012 12:00:01  to  04-Mar-2012 12:00:00';
146 mStrRamsesD2L3_DateRange =        '04-Mar-2012 12:00:01  to  07-Mar-2012 11:30:00';
147 mStrRamsesD2L4_DateRange =        '07-Mar-2012 11:30:01  to  12-Mar-2012 16:24:18';
148
149 mStrRamsesD3Complete_DateRange =  '16-Mar-2012 15:41:35  to  03-Apr-2012 19:24:45';
150 mStrRamsesD3L1_DateRange =        '16-Mar-2012 15:41:35  to  22-Mar-2012 12:00:00';
151 mStrRamsesD3L2_DateRange =        '22-Mar-2012 12:00:01  to  27-Mar-2012 03:00:00';
152 mStrRamsesD3L3_DateRange =        '27-Mar-2012 03:00:01  to  29-Mar-2012 02:00:00';
153 mStrRamsesD3L4_DateRange =        '29-Mar-2012 02:00:01  to  03-Apr-2012 19:24:45';
154
155 % initial date range label strings...
156 mStrComplete_DateRange = mStrPelagiaD1Complete_DateRange;
157 mStrLeg1_DateRange = mStrPelagiaD1L1_DateRange;
158 mStrLeg2_DateRange = mStrPelagiaD1L2_DateRange;
159 mStrLeg3_DateRange = mStrPelagiaD1L3_DateRange;
160 mStrLeg4_DateRange = '';
161 mStrLeg5_DateRange = '';
162 mStrLeg6_DateRange = '';
163
164
165
166 % BEGIN GUI Initialization /////////////////////////////////////////////////////////////////////
167
168 figureWidth = 790;
169 %figureHeight = 690;
170 figureHeight = 770;
171
172 titleTextPosFromLeft = 180;
173 titleTextPosFromBottom = 720;
174 titleTextWidth = 410;
175 titleTextHeight = 25;
176
177 gliderBGPosFromLeft = 20;
178 gliderBGPosFromBottom = 580;
179 gliderBGWidth = 200;
180 gliderBGHeight = 120;
181
182 deploymentBGPosFromLeft = 20;
183 deploymentBGPosFromBottom = 400;
184 deploymentBGWidth = 200;
185 deploymentBGHeight = 160;
186
187 legBGPosFromLeft = 250;
188 legBGPosFromBottom = 400;
189 legBGWidth = 500;
190 legBGHeight = 300;
191
192 plotsBGPosFromLeft = 20;
193 plotsBGPosFromBottom = 110;
194 plotsBGWidth = 730;
195 %plotsBGHeight = 190;
196 plotsBGHeight = 270;
197
198
199 % create figure...
200 guih = figure('MenuBar', 'none', 'Position', [360, 500, figureWidth, figureHeight]);
201
202 % add title text...
203 uicontrol(guih, 'Style', 'text', 'String', ' Slocum Glider CTD Data Visualization', 'FontSize', 22,...
204           'FontWeight', 'bold', 'BackgroundColor', [0.8 0.8 0.8], 'Units', 'pixels',...
205           'Position', [titleTextPosFromLeft titleTextPosFromBottom titleTextWidth titleTextHeight]);
206
207 % add button group to select glider...
208 bghGlider = uibuttongroup('Parent', guih, 'Title', 'Glider', 'FontSize', 14, 'FontWeight', 'bold',...
209                           'Units', 'pixels', 'Position', [gliderBGPosFromLeft gliderBGPosFromBottom gliderBGWidth gliderBGHeight],...
210                           'SelectionChangeFcn', @hGliderSelectionChanged);
211 rbhGlider_Pelagia = uicontrol(bghGlider, 'Style', 'radiobutton', 'String', 'Pelagia', 'FontSize', 14,...
212                               'Units', 'pixels', 'Position', [30 60 100 30]);
213 rbhGlider_Ramses = uicontrol(bghGlider, 'Style', 'radiobutton', 'String', 'Ramses', 'FontSize', 14,...
214                              'Units', 'pixels', 'Position', [30 20 100 30]);
215
216 % add button group to select deployment number...
217 bghDeployment = uibuttongroup('Parent', guih, 'Title', 'Deployment', 'FontSize', 14, 'FontWeight', 'bold',...
218                               'Units', 'pixels', 'Position', [deploymentBGPosFromLeft deploymentBGPosFromBottom deploymentBGWidth deploymentBGHeight],...
219                               'SelectionChangeFcn', @hDeploymentNumberSelectionChanged);                             
220 rbhDeployment_1 = uicontrol(bghDeployment, 'Style', 'radiobutton', 'String', 'Deployment 1', 'FontSize', 14,...
221                             'Units', 'pixels', 'Position', [30 100 140 30]);
222 rbhDeployment_2 = uicontrol(bghDeployment, 'Style', 'radiobutton', 'String', 'Deployment 2', 'FontSize', 14,...
223                            'Units', 'pixels', 'Position', [30 60 140 30]);
224 rbhDeployment_3 = uicontrol(bghDeployment, 'Style', 'radiobutton', 'String', 'Deployment 3', 'FontSize', 14,...
225                            'Units', 'pixels', 'Position', [30 20 140 30]);
226                          
227 % add button group to select leg number...
228 bghLeg = uibuttongroup('Parent', guih, 'Title', 'Leg', 'FontSize', 14, 'FontWeight', 'bold',...
229                        'Units', 'pixels', 'Position', [legBGPosFromLeft legBGPosFromBottom legBGWidth legBGHeight],...
230                        'SelectionChangeFcn', @hLegNumberSelectionChanged);
231                    
232 rbhLeg_0 = uicontrol(bghLeg, 'Style', 'radiobutton', 'String', 'Complete', 'FontSize', 14,...
233                      'Units', 'pixels', 'Position', [30 235 100 30]);
234 sthLeg_0 = uicontrol(bghLeg, 'Style', 'text', 'String', mStrComplete_DateRange, 'FontSize', 14,...
235                      'Units', 'pixels', 'Position', [120 229 350 30]);
236
237 rbhLeg_1 = uicontrol(bghLeg, 'Style', 'radiobutton', 'String', 'Leg 1', 'FontSize', 14,...
238                      'Units', 'pixels', 'Position', [30 200 70 30]);
239 sthLeg_1 = uicontrol(bghLeg, 'Style', 'text', 'String', mStrLeg1_DateRange, 'FontSize', 14,...
240                      'Units', 'pixels', 'Position', [120 194 350 30]);
241                  
242 rbhLeg_2 = uicontrol(bghLeg, 'Style', 'radiobutton', 'String', 'Leg 2', 'FontSize', 14,...
243                     'Units', 'pixels', 'Position', [30 165 70 30]);
244 sthLeg_2 = uicontrol(bghLeg, 'Style', 'text', 'String', mStrLeg2_DateRange, 'FontSize', 14,...
245                      'Units', 'pixels', 'Position', [120 159 350 30]);
246                
247 rbhLeg_3 = uicontrol(bghLeg, 'Style', 'radiobutton', 'String', 'Leg 3', 'FontSize', 14,...
248                      'Units', 'pixels', 'Position', [30 130 70 30]);
249 sthLeg_3 = uicontrol(bghLeg, 'Style', 'text', 'String', mStrLeg3_DateRange, 'FontSize', 14,...
250                      'Units', 'pixels', 'Position', [120 124 350 30]);
251                  
252 rbhLeg_4 = uicontrol(bghLeg, 'Style', 'radiobutton', 'String', 'Leg 4', 'FontSize', 14,...
253                      'Units', 'pixels', 'Position', [30 95 70 30]);
254 sthLeg_4 = uicontrol(bghLeg, 'Style', 'text', 'String', mStrLeg4_DateRange, 'FontSize', 14,...
255                      'Units', 'pixels', 'Position', [120 89 350 30]);
256
257 rbhLeg_5 = uicontrol(bghLeg, 'Style', 'radiobutton', 'String', 'Leg 5', 'FontSize', 14,...
258                      'Units', 'pixels', 'Position', [30 60 70 30]);
259 sthLeg_5 = uicontrol(bghLeg, 'Style', 'text', 'String', mStrLeg5_DateRange, 'FontSize', 14,...
260                      'Units', 'pixels', 'Position', [120 54 350 30]);
261                  
262 rbhLeg_6 = uicontrol(bghLeg, 'Style', 'radiobutton', 'String', 'Leg 6', 'FontSize', 14,...
263                      'Units', 'pixels', 'Position', [30 25 70 30]);
264 sthLeg_6 = uicontrol(bghLeg, 'Style', 'text', 'String', mStrLeg6_DateRange, 'FontSize', 14,...
265                      'Units', 'pixels', 'Position', [120 19 350 30]);
266
267                  
268 % initial visibility settings for leg radio buttons...
269 set(rbhLeg_0, 'Visible', 'on');
270 set(rbhLeg_1, 'Visible', 'on');
271 set(rbhLeg_2, 'Visible', 'on');
272 set(rbhLeg_3, 'Visible', 'on');
273 set(rbhLeg_4, 'Visible', 'off');
274 set(rbhLeg_5, 'Visible', 'off');
275 set(rbhLeg_6, 'Visible', 'off');
276
277
278
279 % add button group to select which data plots to display...
280 bghPlotType = uibuttongroup('Parent', guih, 'Title', 'Data Plots', 'FontSize', 14, 'FontWeight', 'bold',...
281                             'Units', 'pixels', 'Position', [plotsBGPosFromLeft plotsBGPosFromBottom plotsBGWidth plotsBGHeight]);
282 cbhPlot_1 = uicontrol(bghPlotType, 'Style', 'checkbox', 'String', 'All Glider Tracks', 'FontSize', 14,...
283                       'Units', 'pixels', 'Position', [30 210 160 30], 'Callback', @checkbox1_Callback);
284 cbhPlot_2 = uicontrol(bghPlotType, 'Style', 'checkbox', 'String', 'TS', 'FontSize', 14,...
285                       'Units', 'pixels', 'Position', [30 175 160 30], 'Callback', @checkbox2_Callback);
286 cbhPlot_3 = uicontrol(bghPlotType, 'Style', 'checkbox', 'String', 'TS (all legs)', 'FontSize', 14,...
287                       'Units', 'pixels', 'Position', [30 140 160 30], 'Callback', @checkbox3_Callback);
288 cbhPlot_4 = uicontrol(bghPlotType, 'Style', 'checkbox', 'String', 'TS (with Chlorophyll)', 'FontSize', 14,...
289                       'Units', 'pixels', 'Position', [30 105 160 30], 'Callback', @checkbox4_Callback);
290 cbhPlot_5 = uicontrol(bghPlotType, 'Style', 'checkbox', 'String', 'Temperature', 'FontSize', 14,...
291                       'Units', 'pixels', 'Position', [220 210 160 30], 'Callback', @checkbox5_Callback);                 
292 cbhPlot_6 = uicontrol(bghPlotType, 'Style', 'checkbox', 'String', 'Salinity', 'FontSize', 14,...
293                       'Units', 'pixels', 'Position', [220 175 160 30], 'Callback', @checkbox6_Callback);
294 cbhPlot_7 = uicontrol(bghPlotType, 'Style', 'checkbox', 'String', 'Density', 'FontSize', 14,...
295                       'Units', 'pixels', 'Position', [220 140 160 30], 'Callback', @checkbox7_Callback);
296 cbhPlot_8 = uicontrol(bghPlotType, 'Style', 'checkbox', 'String', 'Chlorophyll', 'FontSize', 14,...
297                       'Units', 'pixels', 'Position', [220 105 160 30], 'Callback', @checkbox8_Callback);
298 cbhPlot_9 = uicontrol(bghPlotType, 'Style', 'checkbox', 'String', 'Temperature Profile', 'FontSize', 14,...
299                       'Units', 'pixels', 'Position', [370 210 160 30], 'Callback', @checkbox9_Callback);
300 cbhPlot_10 = uicontrol(bghPlotType, 'Style', 'checkbox', 'String', 'Salinity Profile', 'FontSize', 14,...
301                       'Units', 'pixels', 'Position', [370 175 160 30], 'Callback', @checkbox10_Callback);
302 cbhPlot_11 = uicontrol(bghPlotType, 'Style', 'checkbox', 'String', 'Density Profile', 'FontSize', 14,...
303                       'Units', 'pixels', 'Position', [370 140 160 30], 'Callback', @checkbox11_Callback);
304 cbhPlot_12 = uicontrol(bghPlotType, 'Style', 'checkbox', 'String', 'Chlorophyll Profile', 'FontSize', 14,...
305                        'Units', 'pixels', 'Position', [370 105 160 30], 'Callback', @checkbox12_Callback);
306 cbhPlot_13 = uicontrol(bghPlotType, 'Style', 'checkbox', 'String', '3D Temperature', 'FontSize', 14,...
307                        'Units', 'pixels', 'Position', [560 210 160 30], 'Callback', @checkbox13_Callback);
308 cbhPlot_14 = uicontrol(bghPlotType, 'Style', 'checkbox', 'String', '3D Salinity', 'FontSize', 14,...
309                        'Units', 'pixels', 'Position', [560 175 160 30], 'Callback', @checkbox14_Callback);
310 cbhPlot_15 = uicontrol(bghPlotType, 'Style', 'checkbox', 'String', '3D Density', 'FontSize', 14,...
311                        'Units', 'pixels', 'Position', [560 140 160 30], 'Callback', @checkbox15_Callback);
312 cbhPlot_16 = uicontrol(bghPlotType, 'Style', 'checkbox', 'String', '3D Chlorophyll', 'FontSize', 14,...
313                        'Units', 'pixels', 'Position', [560 105 160 30], 'Callback', @checkbox16_Callback);
314
315                  
316                  
317 % add push button to display plots                 
318 pbhGeneratePlots = uicontrol(guih, 'Style', 'pushbutton',...
319                              'String', 'Generate Plots', 'FontSize', 14, 'FontWeight', 'bold',...
320                              'Units', 'pixels', 'Position', [280 30 200 60],...
321                              'Callback', @generatePlots_Callback);
322
323
324 % END GUI Initialization /////////////////////////////////////////////////////////////////////
325
326
327
328
329 % BEGIN GUI Callbacks ////////////////////////////////////////////////////////////////////////
330
331     %/// CALLBACK - RADIO BUTTONS FOR GLIDER NAME //////////////////////////////////////
332     %----------------------------------------------------------------------
333     function hGliderSelectionChanged(hObject, eventdata)
334     % callback called when the selected glider is changed
335         selected = get(bghGlider, 'SelectedObject');
336         radioButtonLabel = get(selected, 'String');
337        
338         if (strcmp(radioButtonLabel, 'Pelagia'))
339             mGliderIndex = 1;
340         else
341             mGliderIndex = 2;
342         end
343        
344         updateLegRadioButtons(mGliderIndex, mDeploymentNumber);
345     end
346
347     %/// CALLBACK - RADIO BUTTONS FOR DEPLOYMENT NUMBER //////////////////////////////////////
348     %----------------------------------------------------------------------
349     function hDeploymentNumberSelectionChanged(hObject, eventdata)
350     % callback called when the selected deployment number is changed
351         selected = get(bghDeployment, 'SelectedObject');
352         radioButtonLabel = get(selected, 'String');
353        
354         if (strcmp(radioButtonLabel, 'Deployment 1'))
355             mDeploymentNumber = 1;
356         elseif (strcmp(radioButtonLabel, 'Deployment 2'))
357             mDeploymentNumber = 2;
358         else
359             mDeploymentNumber = 3;
360         end
361        
362         updateLegRadioButtons(mGliderIndex, mDeploymentNumber);
363     end
364
365
366     %/// CALLBACK - RADIO BUTTONS FOR LEG NUMBER //////////////////////////////////////
367     %----------------------------------------------------------------------
368     function hLegNumberSelectionChanged(hObject, eventdata)
369     % callback called when the selected leg number is changed
370         selected = get(bghLeg, 'SelectedObject');
371         radioButtonLabel = get(selected, 'String');
372        
373         if (strcmp(radioButtonLabel, 'Complete'))
374             mLegNumber = 0;
375         elseif (strcmp(radioButtonLabel, 'Leg 1'))
376             mLegNumber = 1;
377         elseif (strcmp(radioButtonLabel, 'Leg 2'))
378             mLegNumber = 2;
379         elseif (strcmp(radioButtonLabel, 'Leg 3'))
380             mLegNumber = 3;
381         elseif (strcmp(radioButtonLabel, 'Leg 4'))
382             mLegNumber = 4;
383         elseif (strcmp(radioButtonLabel, 'Leg 5'))
384             mLegNumber = 5;
385         else
386             mLegNumber = 6;
387         end
388     end
389
390
391     %/// CALLBACKS - CHECKBOXES FOR PLOT TYPES //////////////////////////////////////
392     %----------------------------------------------------------------------
393     function checkbox1_Callback(hObject, eventdata, handles)
394         % callback called when the All Glider Tracks plot checkbox is checked
395         if (get(hObject,'Value') == get(hObject,'Max'))
396             mPlotFlag_AllGliderTracks = 1;
397         else
398             mPlotFlag_AllGliderTracks = 0;
399         end
400     end
401
402     %----------------------------------------------------------------------
403     function checkbox2_Callback(hObject, eventdata, handles)
404         % callback called when the TS plot checkbox is checked
405         if (get(hObject,'Value') == get(hObject,'Max'))
406             mPlotFlag_TS = 1;
407         else
408             mPlotFlag_TS = 0;
409         end
410     end
411
412     %----------------------------------------------------------------------
413     function checkbox3_Callback(hObject, eventdata, handles)
414         % callback called when the TS-All Legs plot checkbox is checked
415         if (get(hObject,'Value') == get(hObject,'Max'))
416             mPlotFlag_TS_AllLegs = 1;
417         else
418             mPlotFlag_TS_AllLegs = 0;
419         end
420     end
421
422     %----------------------------------------------------------------------
423     function checkbox4_Callback(hObject, eventdata, handles)
424         % callback called when the TS-Chlorophyll plot checkbox is checked
425         if (get(hObject,'Value') == get(hObject,'Max'))
426             mPlotFlag_TS_Chlorophyll = 1;
427         else
428             mPlotFlag_TS_Chlorophyll = 0;
429         end
430     end
431
432     %----------------------------------------------------------------------
433     function checkbox5_Callback(hObject, eventdata, handles)
434         % callback called when the temperature plot checkbox is checked
435         if (get(hObject,'Value') == get(hObject,'Max'))
436             mPlotFlag_Temperature = 1;
437         else
438             mPlotFlag_Temperature = 0;
439         end
440     end
441
442     %----------------------------------------------------------------------
443     function checkbox6_Callback(hObject, eventdata, handles)
444         % callback called when the salinity plot checkbox is checked
445         if (get(hObject,'Value') == get(hObject,'Max'))
446             mPlotFlag_Salinity = 1;
447         else
448             mPlotFlag_Salinity = 0;
449         end
450     end
451
452     %----------------------------------------------------------------------
453     function checkbox7_Callback(hObject, eventdata, handles)
454         % callback called when the density plot checkbox is checked
455         if (get(hObject,'Value') == get(hObject,'Max'))
456             mPlotFlag_Density = 1;
457         else
458             mPlotFlag_Density = 0;
459         end
460     end
461
462     %----------------------------------------------------------------------
463     function checkbox8_Callback(hObject, eventdata, handles)
464         % callback called when the chlorophyll plot checkbox is checked
465         if (get(hObject,'Value') == get(hObject,'Max'))
466             mPlotFlag_Chlorophyll = 1;
467         else
468             mPlotFlag_Chlorophyll = 0;
469         end
470     end
471
472     %----------------------------------------------------------------------
473     function checkbox9_Callback(hObject, eventdata, handles)
474         % callback called when the temperature profile plot checkbox is checked
475         if (get(hObject,'Value') == get(hObject,'Max'))
476             mPlotFlag_TemperatureProfile = 1;
477         else
478             mPlotFlag_TemperatureProfile = 0;
479         end
480     end
481
482     %----------------------------------------------------------------------
483     function checkbox10_Callback(hObject, eventdata, handles)
484         % callback called when the salinity profile plot checkbox is checked
485         if (get(hObject,'Value') == get(hObject,'Max'))
486             mPlotFlag_SalinityProfile = 1;
487         else
488             mPlotFlag_SalinityProfile = 0;
489         end
490     end
491
492     %----------------------------------------------------------------------
493     function checkbox11_Callback(hObject, eventdata, handles)
494         % callback called when the density profile plot checkbox is checked
495         if (get(hObject,'Value') == get(hObject,'Max'))
496             mPlotFlag_DensityProfile = 1;
497         else
498             mPlotFlag_DensityProfile = 0;
499         end
500     end
501
502     %----------------------------------------------------------------------
503     function checkbox12_Callback(hObject, eventdata, handles)
504         % callback called when the chlorophyll profile plot checkbox is checked
505         if (get(hObject,'Value') == get(hObject,'Max'))
506             mPlotFlag_ChlorophyllProfile = 1;
507         else
508             mPlotFlag_ChlorophyllProfile = 0;
509         end
510     end
511
512     %----------------------------------------------------------------------
513     function checkbox13_Callback(hObject, eventdata, handles)
514         % callback called when the 3D temperature plot checkbox is checked
515         if (get(hObject,'Value') == get(hObject,'Max'))
516             mPlotFlag_Temperature3D = 1;
517         else
518             mPlotFlag_Temperature3D = 0;
519         end
520     end
521
522     %----------------------------------------------------------------------
523     function checkbox14_Callback(hObject, eventdata, handles)
524         % callback called when the 3D salinity plot checkbox is checked
525         if (get(hObject,'Value') == get(hObject,'Max'))
526             mPlotFlag_Salinity3D = 1;
527         else
528             mPlotFlag_Salinity3D = 0;
529         end
530     end
531
532     %----------------------------------------------------------------------
533     function checkbox15_Callback(hObject, eventdata, handles)
534         % callback called when the 3D density plot checkbox is checked
535         if (get(hObject,'Value') == get(hObject,'Max'))
536             mPlotFlag_Density3D = 1;
537         else
538             mPlotFlag_Density3D = 0;
539         end
540     end
541
542     %----------------------------------------------------------------------
543     function checkbox16_Callback(hObject, eventdata, handles)
544         % callback called when the 3D chlorophyll plot checkbox is checked
545         if (get(hObject,'Value') == get(hObject,'Max'))
546             mPlotFlag_Chlorophyll3D = 1;
547         else
548             mPlotFlag_Chlorophyll3D = 0;
549         end
550     end
551
552
553
554
555     %----------------------------------------------------------------------
556     function updateLegRadioButtons(mGliderIndex, mDeploymentNumber)
557        
558         switch mGliderIndex
559             case 1  % Pelagia
560                 switch mDeploymentNumber
561                     case 1  % Deployment 1
562                         set(rbhLeg_0, 'Visible', 'on');
563                         set(sthLeg_0, 'String', mStrPelagiaD1Complete_DateRange, 'Visible', 'on');                       
564                         set(rbhLeg_1, 'Visible', 'on');
565                         set(sthLeg_1, 'String', mStrPelagiaD1L1_DateRange, 'Visible', 'on');                       
566                         set(rbhLeg_2, 'Visible', 'on');
567                         set(sthLeg_2, 'String', mStrPelagiaD1L2_DateRange, 'Visible', 'on');                       
568                         set(rbhLeg_3, 'Visible', 'on');
569                         set(sthLeg_3, 'String', mStrPelagiaD1L3_DateRange, 'Visible', 'on');                       
570                         set(rbhLeg_4, 'Visible', 'off');
571                         set(sthLeg_4, 'Visible', 'off');
572                         set(rbhLeg_5, 'Visible', 'off');
573                         set(sthLeg_5, 'Visible', 'off');
574                         set(rbhLeg_6, 'Visible', 'off');
575                         set(sthLeg_6, 'Visible', 'off');
576                     case 2  % Deployment 2
577                         set(rbhLeg_0, 'Visible', 'on');
578                         set(sthLeg_0, 'String', mStrPelagiaD2Complete_DateRange, 'Visible', 'on');                       
579                         set(rbhLeg_1, 'Visible', 'on');
580                         set(sthLeg_1, 'String', mStrPelagiaD2L1_DateRange, 'Visible', 'on');
581                         set(rbhLeg_2, 'Visible', 'on');
582                         set(sthLeg_2, 'String', mStrPelagiaD2L2_DateRange, 'Visible', 'on');
583                         set(rbhLeg_3, 'Visible', 'on');
584                         set(sthLeg_3, 'String', mStrPelagiaD2L3_DateRange, 'Visible', 'on');
585                         set(rbhLeg_4, 'Visible', 'on');
586                         set(sthLeg_4, 'String', mStrPelagiaD2L4_DateRange, 'Visible', 'on');
587                         set(rbhLeg_5, 'Visible', 'on');
588                         set(sthLeg_5, 'String', mStrPelagiaD2L5_DateRange, 'Visible', 'on');
589                         set(rbhLeg_6, 'Visible', 'off');
590                         set(sthLeg_6, 'Visible', 'off');
591                     case 3  % Deployment 3
592                         set(rbhLeg_0, 'Visible', 'on');
593                         set(sthLeg_0, 'String', mStrPelagiaD3Complete_DateRange, 'Visible', 'on');                       
594                         set(rbhLeg_1, 'Visible', 'on');
595                         set(sthLeg_1, 'String', mStrPelagiaD3L1_DateRange, 'Visible', 'on');
596                         set(rbhLeg_2, 'Visible', 'on');
597                         set(sthLeg_2, 'String', mStrPelagiaD3L2_DateRange, 'Visible', 'on');
598                         set(rbhLeg_3, 'Visible', 'on');
599                         set(sthLeg_3, 'String', mStrPelagiaD3L3_DateRange, 'Visible', 'on');
600                         set(rbhLeg_4, 'Visible', 'on');
601                         set(sthLeg_4, 'String', mStrPelagiaD3L4_DateRange, 'Visible', 'on');
602                         set(rbhLeg_5, 'Visible', 'on');
603                         set(sthLeg_5, 'String', mStrPelagiaD3L5_DateRange, 'Visible', 'on');
604                         set(rbhLeg_6, 'Visible', 'on');
605                         set(sthLeg_6, 'String', mStrPelagiaD3L6_DateRange, 'Visible', 'on');
606                 end
607             case 2  % Ramses
608                 switch mDeploymentNumber
609                     case 1  % Deployment 1
610                         set(rbhLeg_0, 'Visible', 'on');
611                         set(sthLeg_0, 'String', mStrRamsesD1Complete_DateRange, 'Visible', 'on');                       
612                         set(rbhLeg_1, 'Visible', 'on');
613                         set(sthLeg_1, 'String', mStrRamsesD1L1_DateRange, 'Visible', 'on');
614                         set(rbhLeg_2, 'Visible', 'on');
615                         set(sthLeg_2, 'String', mStrRamsesD1L2_DateRange, 'Visible', 'on');
616                         set(rbhLeg_3, 'Visible', 'on');
617                         set(sthLeg_3, 'String', mStrRamsesD1L3_DateRange, 'Visible', 'on');
618                         set(rbhLeg_4, 'Visible', 'on');
619                         set(sthLeg_4, 'String', mStrRamsesD1L4_DateRange, 'Visible', 'on');
620                         set(rbhLeg_5, 'Visible', 'on');
621                         set(sthLeg_5, 'String', mStrRamsesD1L5_DateRange, 'Visible', 'on');
622                         set(rbhLeg_6, 'Visible', 'off');
623                         set(sthLeg_6, 'Visible', 'off');
624                     case 2  % Deployment 2
625                         set(rbhLeg_0, 'Visible', 'on');
626                         set(sthLeg_0, 'String', mStrRamsesD2Complete_DateRange, 'Visible', 'on');               
627                         set(rbhLeg_1, 'Visible', 'on');
628                         set(sthLeg_1, 'String', mStrRamsesD2L1_DateRange, 'Visible', 'on');
629                         set(rbhLeg_2, 'Visible', 'on');
630                         set(sthLeg_2, 'String', mStrRamsesD2L2_DateRange, 'Visible', 'on');
631                         set(rbhLeg_3, 'Visible', 'on');
632                         set(sthLeg_3, 'String', mStrRamsesD2L3_DateRange, 'Visible', 'on');
633                         set(rbhLeg_4, 'Visible', 'on');
634                         set(sthLeg_4, 'String', mStrRamsesD2L4_DateRange, 'Visible', 'on');
635                         set(rbhLeg_5, 'Visible', 'off');
636                         set(sthLeg_5, 'Visible', 'off');
637                         set(rbhLeg_6, 'Visible', 'off');
638                         set(sthLeg_6, 'Visible', 'off');
639                     case 3  % Deployment 3
640                         set(rbhLeg_0, 'Visible', 'on');
641                         set(sthLeg_0, 'String', mStrRamsesD3Complete_DateRange, 'Visible', 'on');               
642                         set(rbhLeg_1, 'Visible', 'on');
643                         set(sthLeg_1, 'String', mStrRamsesD3L1_DateRange, 'Visible', 'on');
644                         set(rbhLeg_2, 'Visible', 'on');
645                         set(sthLeg_2, 'String', mStrRamsesD3L2_DateRange, 'Visible', 'on');
646                         set(rbhLeg_3, 'Visible', 'on');
647                         set(sthLeg_3, 'String', mStrRamsesD3L3_DateRange, 'Visible', 'on');
648                         set(rbhLeg_4, 'Visible', 'on');
649                         set(sthLeg_4, 'String', mStrRamsesD3L4_DateRange, 'Visible', 'on');
650                         set(rbhLeg_5, 'Visible', 'off');
651                         set(sthLeg_5, 'Visible', 'off');
652                         set(rbhLeg_6, 'Visible', 'off');
653                         set(sthLeg_6, 'Visible', 'off');
654                 end
655         end
656     end
657
658
659     %----------------------------------------------------------------------
660     function generatePlots_Callback(hObject, eventdata, handles)
661         % callback called when the Generate Plots button is clicked
662        
663         gliderCTD_GeneratePlots(mGliderIndex, mDeploymentNumber, mLegNumber,...
664                                 mPlotFlag_TS, mPlotFlag_TS_AllLegs, mPlotFlag_TS_Chlorophyll,...
665                                 mPlotFlag_Temperature, mPlotFlag_Salinity, mPlotFlag_Density,...
666                                 mPlotFlag_Chlorophyll, mPlotFlag_TemperatureProfile,...
667                                 mPlotFlag_SalinityProfile, mPlotFlag_DensityProfile,...
668                                 mPlotFlag_ChlorophyllProfile, mPlotFlag_Temperature3D,...
669                                 mPlotFlag_Salinity3D, mPlotFlag_Density3D,...
670                                 mPlotFlag_Chlorophyll3D, mPlotFlag_AllGliderTracks);
671                            
672     end
673
674 % END GUI Callbacks //////////////////////////////////////////////////////////////////////////
675
676
677 end
Note: See TracBrowser for help on using the browser.