1 | function varargout = roms_gui(varargin) |
---|
2 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
3 | % |
---|
4 | %% ROMS_GUI Application M-file for roms_gui.fig |
---|
5 | % |
---|
6 | % Visualization of ROMS model outputs |
---|
7 | % |
---|
8 | % Further Information: |
---|
9 | % http://www.brest.ird.fr/Roms_tools/ |
---|
10 | % |
---|
11 | % This file is part of ROMSTOOLS |
---|
12 | % |
---|
13 | % ROMSTOOLS is free software; you can redistribute it and/or modify |
---|
14 | % it under the terms of the GNU General Public License as published |
---|
15 | % by the Free Software Foundation; either version 2 of the License, |
---|
16 | % or (at your option) any later version. |
---|
17 | % |
---|
18 | % ROMSTOOLS is distributed in the hope that it will be useful, but |
---|
19 | % WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
20 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
21 | % GNU General Public License for more details. |
---|
22 | % |
---|
23 | % You should have received a copy of the GNU General Public License |
---|
24 | % along with this program; if not, write to the Free Software |
---|
25 | % Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
---|
26 | % MA 02111-1307 USA |
---|
27 | % |
---|
28 | % Copyright (c) 2002-2006 by Pierrick Penven |
---|
29 | % e-mail:Pierrick.Penven@ird.fr |
---|
30 | % |
---|
31 | % Updated 02-Nov-2006 by Pierrick Penven (Yorig) |
---|
32 | % |
---|
33 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
34 | |
---|
35 | % ------------------------------------------------------------ |
---|
36 | % LAUNCH GUI |
---|
37 | % ------------------------------------------------------------ |
---|
38 | if nargin == 0 |
---|
39 | warning off |
---|
40 | fig = openfig(mfilename,'reuse'); |
---|
41 | warning on |
---|
42 | % Use system color scheme for figure: |
---|
43 | set(fig,'Color',get(0,'defaultUicontrolBackgroundColor')); |
---|
44 | % Generate a structure of handles to pass to callbacks, and store it. |
---|
45 | handles = guihandles(fig); |
---|
46 | hisfile_callback(fig, [], handles, varargin) |
---|
47 | if nargout > 0 |
---|
48 | varargout{1} = fig; |
---|
49 | end |
---|
50 | elseif ischar(varargin{1}) % INVOKE NAMED SUBFUNCTION OR CALLBACK |
---|
51 | try |
---|
52 | [varargout{1:nargout}] = feval(varargin{:}); % FEVAL switchyard |
---|
53 | catch |
---|
54 | disp(lasterr); |
---|
55 | end |
---|
56 | end |
---|
57 | return |
---|
58 | % ------------------------------------------------------------ |
---|
59 | % Callback for the Close button |
---|
60 | % ------------------------------------------------------------ |
---|
61 | function varargout = close_Callback(h, eventdata, handles, varargin) |
---|
62 | delete(handles.figure1) |
---|
63 | return |
---|
64 | % ------------------------------------------------------------ |
---|
65 | % ------------------------------------------------------------ |
---|
66 | |
---|
67 | %% ------------------------------------------------------------ |
---|
68 | % ------------------------------------------------------------ |
---|
69 | % Reset everything |
---|
70 | % ------------------------------------------------------------ |
---|
71 | % ------------------------------------------------------------ |
---|
72 | function handles = reset_handles(h,handles) |
---|
73 | handles.hisfile=''; |
---|
74 | handles.gridfile=''; |
---|
75 | handles.L=[]; |
---|
76 | handles.M=[]; |
---|
77 | handles.N=[]; |
---|
78 | handles.T=[]; |
---|
79 | handles.hmax=[]; |
---|
80 | handles.ng=[]; |
---|
81 | handles.coastfile=[]; |
---|
82 | handles.vname='zeta'; |
---|
83 | handles.vlevel=-10; |
---|
84 | handles.pltstyle=1; |
---|
85 | handles.lonmin=-99; |
---|
86 | handles.tindex=1; |
---|
87 | handles.lonmax=99; |
---|
88 | handles.latmin=-99; |
---|
89 | handles.latmax=99; |
---|
90 | handles.cstep=0; |
---|
91 | handles.cscale=1; |
---|
92 | handles.cunit=0.1; |
---|
93 | handles.colmin=[]; |
---|
94 | handles.colmax=[]; |
---|
95 | handles.ncol=10; |
---|
96 | handles.coef=1; |
---|
97 | handles.gridlevs=0; |
---|
98 | handles.day=[]; |
---|
99 | handles.month=[]; |
---|
100 | handles.year=[]; |
---|
101 | handles.thedate=''; |
---|
102 | handles.rempts=[1 1 1 1]; |
---|
103 | handles.units=''; |
---|
104 | handles.longname=''; |
---|
105 | handles.townfile=[]; |
---|
106 | handles.isobath='0 500 1000'; |
---|
107 | handles.skipanim=1; |
---|
108 | handles.plot=1; |
---|
109 | handles.Yorig=NaN; |
---|
110 | set(handles.slidercscale,'Value',handles.cscale/20); |
---|
111 | set(handles.editcoef,'String',num2str(handles.coef)) |
---|
112 | set(handles.editlonmin,'String',num2str(round(handles.lonmin*10)/10)) |
---|
113 | set(handles.editlonmax,'String',num2str(round(handles.lonmax*10)/10)) |
---|
114 | set(handles.editlatmin,'String',num2str(round(handles.latmin*10)/10)) |
---|
115 | set(handles.editlatmax,'String',num2str(round(handles.latmax*10)/10)) |
---|
116 | guidata(h,handles) |
---|
117 | return |
---|
118 | % ------------------------------------------------------------ |
---|
119 | % ------------------------------------------------------------ |
---|
120 | |
---|
121 | % ------------------------------------------------------------ |
---|
122 | % -------------------- OPEN FILES ---------------------------- |
---|
123 | % ------------------------------------------------------------ |
---|
124 | % Callback for Open History file |
---|
125 | % ------------------------------------------------------------ |
---|
126 | function varargout = hisfile_callback(h, eventdata, handles, varargin) |
---|
127 | % Use UIGETFILE to allow for the selection of a custom address book. |
---|
128 | |
---|
129 | [filename, pathname] = uigetfile( ... |
---|
130 | {'*.nc', 'All netcdf-Files (*.nc)'; ... |
---|
131 | '*.*','All Files (*.*)'}, ... |
---|
132 | 'SELECT A ROMS HISTORY NETCDF FILE'); |
---|
133 | % If "Cancel" is selected then return |
---|
134 | if isequal([filename,pathname],[0,0]) |
---|
135 | return |
---|
136 | % Otherwise construct the fullfilename and Check and load the file. |
---|
137 | else |
---|
138 | handles=reset_handles(h,handles); |
---|
139 | handles.hisfile = fullfile(pathname,filename); |
---|
140 | nc=netcdf(handles.hisfile,'nowrite'); |
---|
141 | if isempty(nc) |
---|
142 | disp('Warning : this is not a netcdf file !!!') |
---|
143 | handles.hisfile=''; |
---|
144 | return |
---|
145 | else |
---|
146 | pm=nc{'pm'}; |
---|
147 | if isempty(pm) |
---|
148 | close(nc) |
---|
149 | guidata(h,handles) |
---|
150 | gridfile_callback(h, eventdata, handles, varargin) |
---|
151 | return |
---|
152 | end |
---|
153 | close(nc) |
---|
154 | hisfile=handles.hisfile; |
---|
155 | gridfile=handles.gridfile; |
---|
156 | handles = reset_handles(h,handles); |
---|
157 | handles.hisfile=hisfile; |
---|
158 | handles.gridfile=gridfile; |
---|
159 | guidata(h,handles) |
---|
160 | handles=update_listbox(h, eventdata, handles, varargin); |
---|
161 | end |
---|
162 | end |
---|
163 | return |
---|
164 | % ------------------------------------------------------------ |
---|
165 | % Callback for Open Grid file |
---|
166 | % ------------------------------------------------------------ |
---|
167 | function varargout = gridfile_callback(h, eventdata, handles, varargin) |
---|
168 | % Use UIGETFILE to allow for the selection of a custom address book. |
---|
169 | [filename, pathname] = uigetfile( ... |
---|
170 | {'*.nc', 'All netcdf-Files (*.nc)'; ... |
---|
171 | '*.*','All Files (*.*)'}, ... |
---|
172 | 'SELECT A ROMS GRID NETCDF FILE'); |
---|
173 | % If "Cancel" is selected then return |
---|
174 | if isequal([filename,pathname],[0,0]) |
---|
175 | return |
---|
176 | % Otherwise construct the fullfilename and Check and load the file. |
---|
177 | else |
---|
178 | handles.gridfile = fullfile(pathname,filename); |
---|
179 | nc=netcdf(handles.gridfile,'nowrite'); |
---|
180 | if isempty(nc) |
---|
181 | disp('Warning : this is not a netcdf file !!!') |
---|
182 | handles.gridfile=''; |
---|
183 | return |
---|
184 | else |
---|
185 | close(nc) |
---|
186 | guidata(h,handles) |
---|
187 | handles=update_listbox(h, eventdata, handles, varargin); |
---|
188 | end |
---|
189 | end |
---|
190 | return |
---|
191 | % ------------------------------------------------------------ |
---|
192 | % Callback for Open Coastfile |
---|
193 | % ------------------------------------------------------------ |
---|
194 | function varargout = coastfile_callback(h, eventdata, handles, varargin) |
---|
195 | % Use UIGETFILE to allow for the selection of a custom address book. |
---|
196 | [filename, pathname] = uigetfile( ... |
---|
197 | {'*.mat', 'All MAT-Files (*.mat)'; ... |
---|
198 | '*.*','All Files (*.*)'}, ... |
---|
199 | 'SELECT A GHRR COASTLINE FILE'); |
---|
200 | % If "Cancel" is selected then return |
---|
201 | if isequal([filename,pathname],[0,0]) |
---|
202 | return |
---|
203 | % Otherwise construct the fullfilename and Check and load the file. |
---|
204 | else |
---|
205 | handles.coastfile = fullfile(pathname,filename); |
---|
206 | if handles.plot==1 |
---|
207 | inplot(h, eventdata, handles, varargin); |
---|
208 | else |
---|
209 | disp('Push ''PLOT'' button') |
---|
210 | end |
---|
211 | guidata(h,handles) |
---|
212 | end |
---|
213 | return |
---|
214 | % ------------------------------------------------------------ |
---|
215 | % Callback for remove the coastline |
---|
216 | % ------------------------------------------------------------ |
---|
217 | function varargout = remcoast_Callback(h, eventdata, handles, varargin) |
---|
218 | handles.coastfile=[]; |
---|
219 | if handles.plot==1 |
---|
220 | inplot(h, eventdata, handles, varargin); |
---|
221 | else |
---|
222 | disp('Push ''PLOT'' button') |
---|
223 | end |
---|
224 | guidata(h,handles) |
---|
225 | return |
---|
226 | % ------------------------------------------------------------ |
---|
227 | % Callback for Open Townfile |
---|
228 | % ------------------------------------------------------------ |
---|
229 | function varargout = townfile_callback(h, eventdata, handles, varargin) |
---|
230 | % Use UIGETFILE to allow for the selection of a custom address book. |
---|
231 | [filename, pathname] = uigetfile( ... |
---|
232 | {'*.dat', 'All MAT-Files (*.dat)'; ... |
---|
233 | '*.*','All Files (*.*)'}, ... |
---|
234 | 'SELECT A ASCII TOWN FILE'); |
---|
235 | % If "Cancel" is selected then return |
---|
236 | if isequal([filename,pathname],[0,0]) |
---|
237 | return |
---|
238 | % Otherwise construct the fullfilename and Check and load the file. |
---|
239 | else |
---|
240 | handles.townfile = fullfile(pathname,filename); |
---|
241 | if handles.plot==1 |
---|
242 | inplot(h, eventdata, handles, varargin); |
---|
243 | else |
---|
244 | disp('Push ''PLOT'' button') |
---|
245 | end |
---|
246 | guidata(h,handles) |
---|
247 | end |
---|
248 | return |
---|
249 | % ------------------------------------------------------------ |
---|
250 | % Callback for remove the towns |
---|
251 | % ------------------------------------------------------------ |
---|
252 | function varargout = remtowns_Callback(h, eventdata, handles, varargin) |
---|
253 | handles.townfile=[]; |
---|
254 | if handles.plot==1 |
---|
255 | inplot(h, eventdata, handles, varargin); |
---|
256 | else |
---|
257 | disp('Push ''PLOT'' button') |
---|
258 | end |
---|
259 | guidata(h,handles) |
---|
260 | return |
---|
261 | % ------------------------------------------------------------ |
---|
262 | % ------------------------------------------------------------ |
---|
263 | % ------------------------------------------------------------ |
---|
264 | % ------------------------------------------------------------ |
---|
265 | |
---|
266 | % ------------------------------------------------------------ |
---|
267 | % Callback for update button |
---|
268 | % ------------------------------------------------------------ |
---|
269 | function varargout = update_Callback(h, eventdata, handles, varargin) |
---|
270 | % Stub for Callback of the uicontrol handles.pushbutton1. |
---|
271 | handles=update_listbox(h, eventdata, handles, varargin); |
---|
272 | guidata(h,handles) |
---|
273 | return |
---|
274 | % ------------------------------------------------------------ |
---|
275 | % Update the variable list box |
---|
276 | % ------------------------------------------------------------ |
---|
277 | function handles = update_listbox(h, eventdata, handles, varargin) |
---|
278 | % Updates the listbox to show the printable variables |
---|
279 | vname2=[]; |
---|
280 | index_selected=[]; |
---|
281 | hisfile=handles.hisfile; |
---|
282 | nc=netcdf(hisfile,'nowrite'); |
---|
283 | Vars = var(nc); |
---|
284 | Varnames = [ncnames(Vars)]; |
---|
285 | nvar=length(Vars); |
---|
286 | ndims=0*(1:nvar); |
---|
287 | myindex=0; |
---|
288 | lwrd=length(handles.vname); |
---|
289 | for i=1:nvar |
---|
290 | vname=char(Varnames(i)); |
---|
291 | myvar=nc{vname}; |
---|
292 | ndims(i)=length(dim(myvar)); |
---|
293 | if ndims(i)>2 |
---|
294 | if isempty(vname2) |
---|
295 | vname2=vname; |
---|
296 | end |
---|
297 | myindex=myindex+1; |
---|
298 | if length(vname)==lwrd |
---|
299 | if vname==handles.vname |
---|
300 | index_selected=myindex; |
---|
301 | end |
---|
302 | end |
---|
303 | end |
---|
304 | end |
---|
305 | if isempty(index_selected) |
---|
306 | disp([handles.vname,' not found...']) |
---|
307 | index_selected=1; |
---|
308 | handles.vname=vname2; |
---|
309 | if isempty(handles.vname) |
---|
310 | error('No variable with a least 2 dimensions found') |
---|
311 | end |
---|
312 | end |
---|
313 | handles.colmin=[]; |
---|
314 | handles.colmax=[]; |
---|
315 | set(handles.editcolmin,'String',num2str(handles.colmin)) |
---|
316 | set(handles.editcolmax,'String',num2str(handles.colmax)) |
---|
317 | handles.units=nc{handles.vname}.units(:); |
---|
318 | set(handles.editunits,'String',num2str(handles.units)) |
---|
319 | handles.longname=nc{handles.vname}.long_name(:); |
---|
320 | set(handles.editlongname,'String',num2str(handles.longname)) |
---|
321 | handles.coef=1; |
---|
322 | set(handles.editcoef,'String',num2str(handles.coef)) |
---|
323 | set(handles.listvar,'String',Varnames(ndims>2)); |
---|
324 | set(handles.listvar,'Value',index_selected) |
---|
325 | close(nc) |
---|
326 | if isempty(handles.gridfile) |
---|
327 | handles.gridfile=handles.hisfile; |
---|
328 | end |
---|
329 | nc=netcdf(handles.hisfile,'nowrite'); |
---|
330 | handles.N=length(nc('s_rho')); |
---|
331 | handles.T=length(nc('time')); |
---|
332 | if handles.T==0 |
---|
333 | disp('Warning no time dimension found.. looking for tclm_time') |
---|
334 | handles.T=length(nc('tclm_time')); |
---|
335 | end |
---|
336 | if handles.T==0 |
---|
337 | error('Warning no time dimension found') |
---|
338 | end |
---|
339 | close(nc) |
---|
340 | nc=netcdf(handles.gridfile,'nowrite'); |
---|
341 | handles.L=length(nc('xi_rho')); |
---|
342 | handles.M=length(nc('eta_rho')); |
---|
343 | handles.hmax=max(max((nc{'h'}(:)))); |
---|
344 | lat=rempoints(readlat(nc),handles.rempts); |
---|
345 | lon=rempoints(readlon(nc),handles.rempts); |
---|
346 | handles.lonmin=min(min(lon)); |
---|
347 | handles.lonmax=max(max(lon)); |
---|
348 | handles.latmin=min(min(lat)); |
---|
349 | handles.latmax=max(max(lat)); |
---|
350 | set(handles.editlonmin,'String',num2str(round(handles.lonmin*10)/10)) |
---|
351 | set(handles.editlonmax,'String',num2str(round(handles.lonmax*10)/10)) |
---|
352 | set(handles.editlatmin,'String',num2str(round(handles.latmin*10)/10)) |
---|
353 | set(handles.editlatmax,'String',num2str(round(handles.latmax*10)/10)) |
---|
354 | close(nc) |
---|
355 | if handles.plot==1 |
---|
356 | inplot(h, eventdata, handles, varargin); |
---|
357 | else |
---|
358 | disp('Push ''PLOT'' button') |
---|
359 | end |
---|
360 | guidata(h,handles) |
---|
361 | return |
---|
362 | % ------------------------------------------------------------ |
---|
363 | % Callback for variable listbox |
---|
364 | % ------------------------------------------------------------ |
---|
365 | function varargout = listvar_Callback(h, eventdata, handles, varargin) |
---|
366 | % Stub for Callback of the uicontrol handles.listvar. |
---|
367 | list_entries = get(handles.listvar,'String'); |
---|
368 | index_selected = get(handles.listvar,'Value'); |
---|
369 | if length(index_selected) ~= 1 |
---|
370 | errordlg('You must select 1 variables','Incorrect Selection','modal') |
---|
371 | else |
---|
372 | varname = list_entries{index_selected(1)}; |
---|
373 | handles.vname=varname; |
---|
374 | handles.colmin=[]; |
---|
375 | set(handles.editcolmin,'String',num2str(handles.colmin)); |
---|
376 | handles.colmax=[]; |
---|
377 | set(handles.editcolmax,'String',num2str(handles.colmax)); |
---|
378 | nc=netcdf(handles.hisfile,'nowrite'); |
---|
379 | handles.units=nc{handles.vname}.units(:); |
---|
380 | set(handles.editunits,'String',num2str(handles.units)) |
---|
381 | handles.longname=nc{handles.vname}.long_name(:); |
---|
382 | set(handles.editlongname,'String',num2str(handles.longname)) |
---|
383 | close(nc) |
---|
384 | handles.coef=1; |
---|
385 | set(handles.editcoef,'String',num2str(handles.coef)) |
---|
386 | if handles.plot==1 |
---|
387 | inplot(h, eventdata, handles, varargin); |
---|
388 | else |
---|
389 | disp('Push ''PLOT'' button') |
---|
390 | end |
---|
391 | guidata(h,handles) |
---|
392 | end |
---|
393 | return |
---|
394 | % ------------------------------------------------------------ |
---|
395 | % Callback for derived variable listbox |
---|
396 | % ------------------------------------------------------------ |
---|
397 | function varargout = listdvar_Callback(h, eventdata, handles, varargin) |
---|
398 | list_entries = get(handles.listdvar,'String'); |
---|
399 | index_selected = get(handles.listdvar,'Value'); |
---|
400 | if length(index_selected) ~= 1 |
---|
401 | errordlg('You must select 1 variables','Incorrect Selection','modal') |
---|
402 | else |
---|
403 | varname = list_entries{index_selected(1)}; |
---|
404 | if ~isempty(varname) |
---|
405 | handles.vname=varname; |
---|
406 | handles.colmin=[]; |
---|
407 | set(handles.editcolmin,'String',num2str(handles.colmin)); |
---|
408 | handles.colmax=[]; |
---|
409 | set(handles.editcolmax,'String',num2str(handles.colmax)); |
---|
410 | handles.units=''; |
---|
411 | set(handles.editunits,'String',num2str(handles.units)) |
---|
412 | handles.longname=''; |
---|
413 | set(handles.editlongname,'String',num2str(handles.vname)) |
---|
414 | handles.coef=1; |
---|
415 | set(handles.editcoef,'String',num2str(handles.coef)) |
---|
416 | if handles.plot==1 |
---|
417 | inplot(h, eventdata, handles, varargin); |
---|
418 | else |
---|
419 | disp('Push ''PLOT'' button') |
---|
420 | end |
---|
421 | guidata(h,handles) |
---|
422 | end |
---|
423 | end |
---|
424 | return |
---|
425 | % ------------------------------------------------------------ |
---|
426 | % ------------------------------------------------------------ |
---|
427 | % ------------------------------------------------------------ |
---|
428 | % ------------------------------------------------------------ |
---|
429 | |
---|
430 | % ------------------------------------------------------------ |
---|
431 | % vertical levels |
---|
432 | % ------------------------------------------------------------ |
---|
433 | function varargout = upvlevel_Callback(h, eventdata, handles, varargin) |
---|
434 | % Stub for Callback of the pushbutton 'up vertical level' |
---|
435 | if handles.vlevel < 0. |
---|
436 | handles.vlevel=handles.vlevel+100; |
---|
437 | if handles.vlevel >= 0. |
---|
438 | handles.vlevel=handles.N; |
---|
439 | end |
---|
440 | else |
---|
441 | handles.vlevel=handles.vlevel + 1; |
---|
442 | if handles.vlevel >= handles.N |
---|
443 | handles.vlevel=handles.N; |
---|
444 | end |
---|
445 | end |
---|
446 | set(handles.editvlev,'String',num2str(handles.vlevel)) |
---|
447 | if handles.plot==1 |
---|
448 | inplot(h, eventdata, handles, varargin); |
---|
449 | else |
---|
450 | disp('Push ''PLOT'' button') |
---|
451 | end |
---|
452 | guidata(h,handles) |
---|
453 | return |
---|
454 | % ------------------------------------------------------------ |
---|
455 | function varargout = downvlevel_Callback(h, eventdata, handles, varargin) |
---|
456 | % Stub for Callback of the pushbutton 'down vertical level' |
---|
457 | if handles.vlevel < 1 |
---|
458 | handles.vlevel=handles.vlevel-100; |
---|
459 | if handles.vlevel <= -handles.hmax |
---|
460 | handles.vlevel=round(100-handles.hmax); |
---|
461 | end |
---|
462 | else |
---|
463 | handles.vlevel=handles.vlevel - 1; |
---|
464 | if handles.vlevel < 1 |
---|
465 | handles.vlevel=handles.vlevel-100; |
---|
466 | if handles.vlevel <= 100-handles.hmax |
---|
467 | handles.vlevel=round(100-handles.hmax); |
---|
468 | end |
---|
469 | end |
---|
470 | end |
---|
471 | set(handles.editvlev,'String',num2str(handles.vlevel)) |
---|
472 | if handles.plot==1 |
---|
473 | inplot(h, eventdata, handles, varargin); |
---|
474 | else |
---|
475 | disp('Push ''PLOT'' button') |
---|
476 | end |
---|
477 | guidata(h,handles) |
---|
478 | return |
---|
479 | % ------------------------------------------------------------ |
---|
480 | function varargout = editvlev_Callback(h, eventdata, handles, varargin) |
---|
481 | % Stub for Callback of the vlevel text box |
---|
482 | handles.vlevel = str2num(get(handles.editvlev,'String')); |
---|
483 | if handles.vlevel >= handles.N |
---|
484 | handles.vlevel=handles.N; |
---|
485 | set(handles.editvlev,'String',num2str(handles.vlevel)) |
---|
486 | end |
---|
487 | if handles.vlevel <= 100-handles.hmax |
---|
488 | handles.vlevel=round(100-handles.hmax); |
---|
489 | set(handles.editvlev,'String',num2str(handles.vlevel)) |
---|
490 | end |
---|
491 | if handles.plot==1 |
---|
492 | inplot(h, eventdata, handles, varargin); |
---|
493 | else |
---|
494 | disp('Push ''PLOT'' button') |
---|
495 | end |
---|
496 | guidata(h,handles) |
---|
497 | return |
---|
498 | % ------------------------------------------------------------ |
---|
499 | % end vertical levels |
---|
500 | % ------------------------------------------------------------ |
---|
501 | |
---|
502 | % ------------------------------------------------------------ |
---|
503 | % plot style (pcolor, contourf, etc..) |
---|
504 | % ------------------------------------------------------------ |
---|
505 | function varargout = pcolor_Callback(h, eventdata, handles, varargin) |
---|
506 | handles.pltstyle=1; |
---|
507 | if handles.plot==1 |
---|
508 | inplot(h, eventdata, handles, varargin); |
---|
509 | else |
---|
510 | disp('Push ''PLOT'' button') |
---|
511 | end |
---|
512 | guidata(h,handles) |
---|
513 | return |
---|
514 | % ------------------------------------------------------------ |
---|
515 | function varargout = contourf_Callback(h, eventdata, handles, varargin) |
---|
516 | handles.pltstyle=2; |
---|
517 | if handles.plot==1 |
---|
518 | inplot(h, eventdata, handles, varargin); |
---|
519 | else |
---|
520 | disp('Push ''PLOT'' button') |
---|
521 | end |
---|
522 | guidata(h,handles) |
---|
523 | return |
---|
524 | % ------------------------------------------------------------ |
---|
525 | function varargout = contour_Callback(h, eventdata, handles, varargin) |
---|
526 | handles.pltstyle=3; |
---|
527 | if handles.plot==1 |
---|
528 | inplot(h, eventdata, handles, varargin); |
---|
529 | else |
---|
530 | disp('Push ''PLOT'' button') |
---|
531 | end |
---|
532 | guidata(h,handles) |
---|
533 | return |
---|
534 | % ------------------------------------------------------------ |
---|
535 | function varargout = graycontour_Callback(h, eventdata, handles, varargin) |
---|
536 | handles.pltstyle=4; |
---|
537 | if handles.plot==1 |
---|
538 | inplot(h, eventdata, handles, varargin); |
---|
539 | else |
---|
540 | disp('Push ''PLOT'' button') |
---|
541 | end |
---|
542 | guidata(h,handles) |
---|
543 | return |
---|
544 | % ------------------------------------------------------------ |
---|
545 | function varargout = seawifs_Callback(h, eventdata, handles, varargin) |
---|
546 | handles.pltstyle=5; |
---|
547 | if handles.plot==1 |
---|
548 | inplot(h, eventdata, handles, varargin); |
---|
549 | else |
---|
550 | disp('Push ''PLOT'' button') |
---|
551 | end |
---|
552 | guidata(h,handles) |
---|
553 | return |
---|
554 | % ------------------------------------------------------------ |
---|
555 | % end plotbutton style |
---|
556 | % ------------------------------------------------------------ |
---|
557 | |
---|
558 | % ------------------------------------------------------------ |
---|
559 | % lon min |
---|
560 | % ------------------------------------------------------------ |
---|
561 | function varargout = uplonmin_Callback(h, eventdata, handles, varargin) |
---|
562 | % Stub for Callback of the pushbutton 'up longitude minimum' |
---|
563 | handles.lonmin=handles.lonmin + 1; |
---|
564 | if handles.lonmin >= handles.lonmax |
---|
565 | handles.lonmin=handles.lonmax-0.01; |
---|
566 | end |
---|
567 | set(handles.editlonmin,'String',num2str(round(handles.lonmin*10)/10)) |
---|
568 | if handles.plot==1 |
---|
569 | inplot(h, eventdata, handles, varargin); |
---|
570 | else |
---|
571 | disp('Push ''PLOT'' button') |
---|
572 | end |
---|
573 | guidata(h,handles) |
---|
574 | return |
---|
575 | % ------------------------------------------------------------ |
---|
576 | function varargout = downlonmin_Callback(h, eventdata, handles, varargin) |
---|
577 | % Stub for Callback of the pushbutton 'down longitude minimum' |
---|
578 | handles.lonmin=handles.lonmin - 1; |
---|
579 | set(handles.editlonmin,'String',num2str(round(handles.lonmin*10)/10)) |
---|
580 | if handles.plot==1 |
---|
581 | inplot(h, eventdata, handles, varargin); |
---|
582 | else |
---|
583 | disp('Push ''PLOT'' button') |
---|
584 | end |
---|
585 | guidata(h,handles) |
---|
586 | return |
---|
587 | % ------------------------------------------------------------ |
---|
588 | function varargout = editlonmin_Callback(h, eventdata, handles, varargin) |
---|
589 | % Stub for Callback of the lonmin text box |
---|
590 | handles.lonmin = str2num(get(handles.editlonmin,'String')); |
---|
591 | if handles.lonmin >= handles.lonmax |
---|
592 | handles.lonmin=handles.lonmax-0.01; |
---|
593 | set(handles.editlonmin,'String',num2str(handles.lonmin)) |
---|
594 | end |
---|
595 | if handles.plot==1 |
---|
596 | inplot(h, eventdata, handles, varargin); |
---|
597 | else |
---|
598 | disp('Push ''PLOT'' button') |
---|
599 | end |
---|
600 | guidata(h,handles) |
---|
601 | return |
---|
602 | % ------------------------------------------------------------ |
---|
603 | % end lon min |
---|
604 | % ------------------------------------------------------------ |
---|
605 | |
---|
606 | % ------------------------------------------------------------ |
---|
607 | % lon max |
---|
608 | % ------------------------------------------------------------ |
---|
609 | function varargout = uplonmax_Callback(h, eventdata, handles, varargin) |
---|
610 | % Stub for Callback of the pushbutton 'up longitude maximum' |
---|
611 | handles.lonmax=handles.lonmax + 1; |
---|
612 | set(handles.editlonmax,'String',num2str(round(handles.lonmax*10)/10)) |
---|
613 | if handles.plot==1 |
---|
614 | inplot(h, eventdata, handles, varargin); |
---|
615 | else |
---|
616 | disp('Push ''PLOT'' button') |
---|
617 | end |
---|
618 | guidata(h,handles) |
---|
619 | return |
---|
620 | % ------------------------------------------------------------ |
---|
621 | function varargout = downlonmax_Callback(h, eventdata, handles, varargin) |
---|
622 | % Stub for Callback of the pushbutton 'down longitude maximum' |
---|
623 | handles.lonmax=handles.lonmax - 1; |
---|
624 | if handles.lonmax <= handles.lonmin |
---|
625 | handles.lonmax=handles.lonmin+0.01; |
---|
626 | end |
---|
627 | set(handles.editlonmax,'String',num2str(round(handles.lonmax*10)/10)) |
---|
628 | if handles.plot==1 |
---|
629 | inplot(h, eventdata, handles, varargin); |
---|
630 | else |
---|
631 | disp('Push ''PLOT'' button') |
---|
632 | end |
---|
633 | guidata(h,handles) |
---|
634 | return |
---|
635 | % ------------------------------------------------------------ |
---|
636 | function varargout = editlonmax_Callback(h, eventdata, handles, varargin) |
---|
637 | % Stub for Callback of the lonmax text box |
---|
638 | handles.lonmax = str2num(get(handles.editlonmax,'String')); |
---|
639 | if handles.lonmax <= handles.lonmin |
---|
640 | handles.lonmax=handles.lonmax+0.01; |
---|
641 | set(handles.editlonmax,'String',num2str(handles.lonmax)) |
---|
642 | end |
---|
643 | if handles.plot==1 |
---|
644 | inplot(h, eventdata, handles, varargin); |
---|
645 | else |
---|
646 | disp('Push ''PLOT'' button') |
---|
647 | end |
---|
648 | guidata(h,handles) |
---|
649 | return |
---|
650 | % ------------------------------------------------------------ |
---|
651 | % end lon max |
---|
652 | % ------------------------------------------------------------ |
---|
653 | |
---|
654 | % ------------------------------------------------------------ |
---|
655 | % lat min |
---|
656 | % ------------------------------------------------------------ |
---|
657 | function varargout = uplatmin_Callback(h, eventdata, handles, varargin) |
---|
658 | % Stub for Callback of the pushbutton 'up latitude minimum' |
---|
659 | handles.latmin=handles.latmin + 1; |
---|
660 | if handles.latmin >= handles.latmax |
---|
661 | handles.latmin=handles.latmax-0.01; |
---|
662 | end |
---|
663 | set(handles.editlatmin,'String',num2str(round(handles.latmin*10)/10)) |
---|
664 | if handles.plot==1 |
---|
665 | inplot(h, eventdata, handles, varargin); |
---|
666 | else |
---|
667 | disp('Push ''PLOT'' button') |
---|
668 | end |
---|
669 | guidata(h,handles) |
---|
670 | return |
---|
671 | % ------------------------------------------------------------ |
---|
672 | function varargout = downlatmin_Callback(h, eventdata, handles, varargin) |
---|
673 | % Stub for Callback of the pushbutton 'down latitude minimum' |
---|
674 | handles.latmin=handles.latmin - 1; |
---|
675 | set(handles.editlatmin,'String',num2str(round(handles.latmin*10)/10)) |
---|
676 | if handles.plot==1 |
---|
677 | inplot(h, eventdata, handles, varargin); |
---|
678 | else |
---|
679 | disp('Push ''PLOT'' button') |
---|
680 | end |
---|
681 | guidata(h,handles) |
---|
682 | return |
---|
683 | % ------------------------------------------------------------ |
---|
684 | function varargout = editlatmin_Callback(h, eventdata, handles, varargin) |
---|
685 | % Stub for Callback of the latmin text box |
---|
686 | handles.latmin = str2num(get(handles.editlatmin,'String')); |
---|
687 | if handles.latmin >= handles.latmax |
---|
688 | handles.latmin=handles.latmax-0.01; |
---|
689 | set(handles.editlatmin,'String',num2str(handles.latmin)) |
---|
690 | end |
---|
691 | if handles.plot==1 |
---|
692 | inplot(h, eventdata, handles, varargin); |
---|
693 | else |
---|
694 | disp('Push ''PLOT'' button') |
---|
695 | end |
---|
696 | guidata(h,handles) |
---|
697 | return |
---|
698 | % ------------------------------------------------------------ |
---|
699 | % end lat min |
---|
700 | % ------------------------------------------------------------ |
---|
701 | |
---|
702 | % ------------------------------------------------------------ |
---|
703 | % lat max |
---|
704 | % ------------------------------------------------------------ |
---|
705 | function varargout = uplatmax_Callback(h, eventdata, handles, varargin) |
---|
706 | % Stub for Callback of the pushbutton 'up latitude maximum' |
---|
707 | handles.latmax=handles.latmax + 1; |
---|
708 | set(handles.editlatmax,'String',num2str(round(handles.latmax*10)/10)) |
---|
709 | if handles.plot==1 |
---|
710 | inplot(h, eventdata, handles, varargin); |
---|
711 | else |
---|
712 | disp('Push ''PLOT'' button') |
---|
713 | end |
---|
714 | guidata(h,handles) |
---|
715 | return |
---|
716 | % ------------------------------------------------------------ |
---|
717 | function varargout = downlatmax_Callback(h, eventdata, handles, varargin) |
---|
718 | % Stub for Callback of the pushbutton 'down latitude maximum' |
---|
719 | handles.latmax=handles.latmax - 1; |
---|
720 | if handles.latmax <= handles.latmin |
---|
721 | handles.latmax=handles.latmin+0.01; |
---|
722 | end |
---|
723 | set(handles.editlatmax,'String',num2str(round(handles.latmax*10)/10)) |
---|
724 | if handles.plot==1 |
---|
725 | inplot(h, eventdata, handles, varargin); |
---|
726 | else |
---|
727 | disp('Push ''PLOT'' button') |
---|
728 | end |
---|
729 | guidata(h,handles) |
---|
730 | return |
---|
731 | % ------------------------------------------------------------ |
---|
732 | function varargout = editlatmax_Callback(h, eventdata, handles, varargin) |
---|
733 | % Stub for Callback of the latmax text box |
---|
734 | handles.latmax = str2num(get(handles.editlatmax,'String')); |
---|
735 | if handles.latmax <= handles.latmin |
---|
736 | handles.latmax=handles.latmax+0.01; |
---|
737 | set(handles.editlatmax,'String',num2str(handles.latmax)) |
---|
738 | end |
---|
739 | if handles.plot==1 |
---|
740 | inplot(h, eventdata, handles, varargin); |
---|
741 | else |
---|
742 | disp('Push ''PLOT'' button') |
---|
743 | end |
---|
744 | guidata(h,handles) |
---|
745 | return |
---|
746 | % ------------------------------------------------------------ |
---|
747 | % end lat max |
---|
748 | % ------------------------------------------------------------ |
---|
749 | % ------------------------------------------------------------ |
---|
750 | % zoom in |
---|
751 | % ------------------------------------------------------------ |
---|
752 | function varargout = zoom_in_Callback(h, eventdata, handles, varargin) |
---|
753 | handles.latmin=handles.latmin + 1; |
---|
754 | handles.latmax=handles.latmax - 1; |
---|
755 | handles.lonmin=handles.lonmin + 1; |
---|
756 | handles.lonmax=handles.lonmax - 1; |
---|
757 | if handles.lonmax <= handles.lonmin |
---|
758 | handles.lonmax=handles.lonmax+1; |
---|
759 | handles.lonmin=handles.lonmin-1; |
---|
760 | end |
---|
761 | if handles.latmax <= handles.latmin |
---|
762 | handles.latmax=handles.latmax+1; |
---|
763 | handles.latmin=handles.latmin-1; |
---|
764 | end |
---|
765 | set(handles.editlatmin,'String',num2str(round(handles.latmin*10)/10)) |
---|
766 | set(handles.editlatmax,'String',num2str(round(handles.latmax*10)/10)) |
---|
767 | set(handles.editlonmin,'String',num2str(round(handles.lonmin*10)/10)) |
---|
768 | set(handles.editlonmax,'String',num2str(round(handles.lonmax*10)/10)) |
---|
769 | if handles.plot==1 |
---|
770 | inplot(h, eventdata, handles, varargin); |
---|
771 | else |
---|
772 | disp('Push ''PLOT'' button') |
---|
773 | end |
---|
774 | guidata(h,handles) |
---|
775 | return |
---|
776 | % ------------------------------------------------------------ |
---|
777 | % end zoom in |
---|
778 | % ------------------------------------------------------------ |
---|
779 | % ------------------------------------------------------------ |
---|
780 | % zoom out |
---|
781 | % ------------------------------------------------------------ |
---|
782 | function varargout = zoom_out_Callback(h, eventdata, handles, varargin) |
---|
783 | handles.latmin=handles.latmin - 1; |
---|
784 | handles.latmax=handles.latmax + 1; |
---|
785 | handles.lonmin=handles.lonmin - 1; |
---|
786 | handles.lonmax=handles.lonmax + 1; |
---|
787 | set(handles.editlatmin,'String',num2str(round(handles.latmin*10)/10)) |
---|
788 | set(handles.editlatmax,'String',num2str(round(handles.latmax*10)/10)) |
---|
789 | set(handles.editlonmin,'String',num2str(round(handles.lonmin*10)/10)) |
---|
790 | set(handles.editlonmax,'String',num2str(round(handles.lonmax*10)/10)) |
---|
791 | if handles.plot==1 |
---|
792 | inplot(h, eventdata, handles, varargin); |
---|
793 | else |
---|
794 | disp('Push ''PLOT'' button') |
---|
795 | end |
---|
796 | guidata(h,handles) |
---|
797 | return |
---|
798 | % ------------------------------------------------------------ |
---|
799 | % end zoom out |
---|
800 | % ------------------------------------------------------------ |
---|
801 | |
---|
802 | % ------------------------------------------------------------ |
---|
803 | % tindex |
---|
804 | % ------------------------------------------------------------ |
---|
805 | function varargout = uptindex_Callback(h, eventdata, handles, varargin) |
---|
806 | handles.tindex=handles.tindex + 1; |
---|
807 | if handles.tindex >= handles.T |
---|
808 | handles.tindex=handles.T; |
---|
809 | end |
---|
810 | set(handles.edittindex,'String',num2str(handles.tindex)) |
---|
811 | if handles.plot==1 |
---|
812 | inplot(h, eventdata, handles, varargin); |
---|
813 | else |
---|
814 | disp('Push ''PLOT'' button') |
---|
815 | end |
---|
816 | guidata(h,handles) |
---|
817 | return |
---|
818 | % ------------------------------------------------------------ |
---|
819 | function varargout = downtindex_Callback(h, eventdata, handles, varargin) |
---|
820 | handles.tindex=handles.tindex - 1; |
---|
821 | if handles.tindex <= 1 |
---|
822 | handles.tindex=1; |
---|
823 | end |
---|
824 | set(handles.edittindex,'String',num2str(handles.tindex)) |
---|
825 | if handles.plot==1 |
---|
826 | inplot(h, eventdata, handles, varargin); |
---|
827 | else |
---|
828 | disp('Push ''PLOT'' button') |
---|
829 | end |
---|
830 | guidata(h,handles) |
---|
831 | return |
---|
832 | % ------------------------------------------------------------ |
---|
833 | function varargout = edittindex_Callback(h, eventdata, handles, varargin) |
---|
834 | handles.tindex = floor(str2num(get(handles.edittindex,'String'))); |
---|
835 | if handles.tindex <= 1 |
---|
836 | handles.tindex=1; |
---|
837 | set(handles.edittindex,'String',num2str(handles.tindex)) |
---|
838 | end |
---|
839 | if handles.tindex >= handles.T |
---|
840 | handles.tindex=handles.T; |
---|
841 | set(handles.edittindex,'String',num2str(handles.tindex)) |
---|
842 | end |
---|
843 | if handles.plot==1 |
---|
844 | inplot(h, eventdata, handles, varargin); |
---|
845 | else |
---|
846 | disp('Push ''PLOT'' button') |
---|
847 | end |
---|
848 | guidata(h,handles) |
---|
849 | return |
---|
850 | % ------------------------------------------------------------ |
---|
851 | % end tindex |
---|
852 | % ------------------------------------------------------------ |
---|
853 | |
---|
854 | % ------------------------------------------------------------ |
---|
855 | % cstep |
---|
856 | % ------------------------------------------------------------ |
---|
857 | function varargout = upcstep_Callback(h, eventdata, handles, varargin) |
---|
858 | % Stub for Callback of the pushbutton 'up cstep' |
---|
859 | handles.cstep=handles.cstep + 1; |
---|
860 | set(handles.editcstep,'String',num2str(handles.cstep)) |
---|
861 | if handles.plot==1 |
---|
862 | inplot(h, eventdata, handles, varargin); |
---|
863 | else |
---|
864 | disp('Push ''PLOT'' button') |
---|
865 | end |
---|
866 | guidata(h,handles) |
---|
867 | return |
---|
868 | % ------------------------------------------------------------ |
---|
869 | function varargout = downcstep_Callback(h, eventdata, handles, varargin) |
---|
870 | % Stub for Callback of the pushbutton 'down cstep' |
---|
871 | handles.cstep=handles.cstep - 1; |
---|
872 | if handles.cstep <= 0 |
---|
873 | handles.cstep=0; |
---|
874 | end |
---|
875 | set(handles.editcstep,'String',num2str(handles.cstep)) |
---|
876 | if handles.plot==1 |
---|
877 | inplot(h, eventdata, handles, varargin); |
---|
878 | else |
---|
879 | disp('Push ''PLOT'' button') |
---|
880 | end |
---|
881 | guidata(h,handles) |
---|
882 | return |
---|
883 | % ------------------------------------------------------------ |
---|
884 | function varargout = editcstep_Callback(h, eventdata, handles, varargin) |
---|
885 | % Stub for Callback of the cstep text box |
---|
886 | handles.cstep = floor(str2num(get(handles.editcstep,'String'))); |
---|
887 | if handles.cstep <= 0 |
---|
888 | handles.cstep=0; |
---|
889 | set(handles.editcstep,'String',num2str(handles.cstep)) |
---|
890 | end |
---|
891 | if handles.plot==1 |
---|
892 | inplot(h, eventdata, handles, varargin); |
---|
893 | else |
---|
894 | disp('Push ''PLOT'' button') |
---|
895 | end |
---|
896 | guidata(h,handles) |
---|
897 | return |
---|
898 | % ------------------------------------------------------------ |
---|
899 | % end cstep |
---|
900 | % ------------------------------------------------------------ |
---|
901 | |
---|
902 | % ------------------------------------------------------------ |
---|
903 | % cscale |
---|
904 | % ------------------------------------------------------------ |
---|
905 | function varargout = slidercscale_Callback(h, eventdata, handles, varargin) |
---|
906 | % Stub for Callback of the cscale slider |
---|
907 | handles.cscale = 100*get(handles.slidercscale,'Value'); |
---|
908 | set(handles.editcscale,'String',num2str(handles.cscale,3)) |
---|
909 | if handles.plot==1 |
---|
910 | inplot(h, eventdata, handles, varargin); |
---|
911 | else |
---|
912 | disp('Push ''PLOT'' button') |
---|
913 | end |
---|
914 | guidata(h,handles) |
---|
915 | return |
---|
916 | % ------------------------------------------------------------ |
---|
917 | function varargout = editcscale_Callback(h, eventdata, handles, varargin) |
---|
918 | % Stub for Callback of the cscale text box |
---|
919 | handles.cscale = str2num(get(handles.editcscale,'String')); |
---|
920 | if handles.cscale <= 0.01 |
---|
921 | handles.cscale=0.01; |
---|
922 | set(handles.editcscale,'String',num2str(handles.cscale)) |
---|
923 | end |
---|
924 | if handles.cscale >= 100 |
---|
925 | handles.cscale=100; |
---|
926 | set(handles.editcscale,'String',num2str(handles.cscale)) |
---|
927 | end |
---|
928 | set(handles.slidercscale,'Value',handles.cscale/100) |
---|
929 | if handles.plot==1 |
---|
930 | inplot(h, eventdata, handles, varargin); |
---|
931 | else |
---|
932 | disp('Push ''PLOT'' button') |
---|
933 | end |
---|
934 | guidata(h,handles) |
---|
935 | return |
---|
936 | % ------------------------------------------------------------ |
---|
937 | % end cscale |
---|
938 | % ------------------------------------------------------------ |
---|
939 | |
---|
940 | % ------------------------------------------------------------ |
---|
941 | % cunit |
---|
942 | % ------------------------------------------------------------ |
---|
943 | function varargout = upcunit_Callback(h, eventdata, handles, varargin) |
---|
944 | % Stub for Callback of the pushbutton 'up cunit' |
---|
945 | handles.cunit=handles.cunit + 0.01; |
---|
946 | set(handles.editcunit,'String',num2str(handles.cunit)) |
---|
947 | if handles.plot==1 |
---|
948 | inplot(h, eventdata, handles, varargin); |
---|
949 | else |
---|
950 | disp('Push ''PLOT'' button') |
---|
951 | end |
---|
952 | guidata(h,handles) |
---|
953 | return |
---|
954 | % ------------------------------------------------------------ |
---|
955 | function varargout = downcunit_Callback(h, eventdata, handles, varargin) |
---|
956 | % Stub for Callback of the pushbutton 'down cunit' |
---|
957 | handles.cunit=handles.cunit - 0.01; |
---|
958 | if handles.cunit <= 0.01 |
---|
959 | handles.cunit=0.01; |
---|
960 | end |
---|
961 | set(handles.editcunit,'String',num2str(handles.cunit)) |
---|
962 | if handles.plot==1 |
---|
963 | inplot(h, eventdata, handles, varargin); |
---|
964 | else |
---|
965 | disp('Push ''PLOT'' button') |
---|
966 | end |
---|
967 | guidata(h,handles) |
---|
968 | return |
---|
969 | % ------------------------------------------------------------ |
---|
970 | function varargout = editcunit_Callback(h, eventdata, handles, varargin) |
---|
971 | % Stub for Callback of the cunit text box |
---|
972 | handles.cunit = str2num(get(handles.editcunit,'String')); |
---|
973 | |
---|
974 | if handles.cunit < 0.01 |
---|
975 | handles.cunit=0.01; |
---|
976 | set(handles.editcunit,'String',num2str(handles.cunit)) |
---|
977 | end |
---|
978 | if handles.plot==1 |
---|
979 | inplot(h, eventdata, handles, varargin); |
---|
980 | else |
---|
981 | disp('Push ''PLOT'' button') |
---|
982 | end |
---|
983 | guidata(h,handles) |
---|
984 | return |
---|
985 | % ------------------------------------------------------------ |
---|
986 | % end cunit |
---|
987 | % ------------------------------------------------------------ |
---|
988 | |
---|
989 | % ------------------------------------------------------------ |
---|
990 | % ncol |
---|
991 | % ------------------------------------------------------------ |
---|
992 | function varargout = upncol_Callback(h, eventdata, handles, varargin) |
---|
993 | % Stub for Callback of the pushbutton 'up ncol' |
---|
994 | handles.ncol=handles.ncol + 1; |
---|
995 | set(handles.editncol,'String',num2str(handles.ncol)) |
---|
996 | if handles.plot==1 |
---|
997 | inplot(h, eventdata, handles, varargin); |
---|
998 | else |
---|
999 | disp('Push ''PLOT'' button') |
---|
1000 | end |
---|
1001 | guidata(h,handles) |
---|
1002 | return |
---|
1003 | % ------------------------------------------------------------ |
---|
1004 | function varargout = downncol_Callback(h, eventdata, handles, varargin) |
---|
1005 | % Stub for Callback of the pushbutton 'down ncol' |
---|
1006 | handles.ncol=handles.ncol - 1; |
---|
1007 | if handles.ncol <= 2 |
---|
1008 | handles.ncol=2; |
---|
1009 | end |
---|
1010 | set(handles.editncol,'String',num2str(handles.ncol)) |
---|
1011 | if handles.plot==1 |
---|
1012 | inplot(h, eventdata, handles, varargin); |
---|
1013 | else |
---|
1014 | disp('Push ''PLOT'' button') |
---|
1015 | end |
---|
1016 | guidata(h,handles) |
---|
1017 | return |
---|
1018 | % ------------------------------------------------------------ |
---|
1019 | function varargout = editncol_Callback(h, eventdata, handles, varargin) |
---|
1020 | % Stub for Callback of the ncol text box |
---|
1021 | handles.ncol = floor(str2num(get(handles.editncol,'String'))); |
---|
1022 | if handles.ncol <= 2 |
---|
1023 | handles.ncol=2; |
---|
1024 | set(handles.editncol,'String',num2str(handles.ncol)) |
---|
1025 | end |
---|
1026 | if handles.plot==1 |
---|
1027 | inplot(h, eventdata, handles, varargin); |
---|
1028 | else |
---|
1029 | disp('Push ''PLOT'' button') |
---|
1030 | end |
---|
1031 | guidata(h,handles) |
---|
1032 | return |
---|
1033 | % ------------------------------------------------------------ |
---|
1034 | % end ncol |
---|
1035 | % ------------------------------------------------------------ |
---|
1036 | |
---|
1037 | % ------------------------------------------------------------ |
---|
1038 | % colmin |
---|
1039 | % ------------------------------------------------------------ |
---|
1040 | function varargout = editcolmin_Callback(h, eventdata, handles, varargin) |
---|
1041 | % Stub for Callback of the ncol text box |
---|
1042 | handles.colmin = str2num(get(handles.editcolmin,'String')); |
---|
1043 | if handles.colmin >= handles.colmax |
---|
1044 | handles.colmin=handles.colmax-0.01; |
---|
1045 | set(handles.editcolmin,'String',num2str(handles.colmin)) |
---|
1046 | end |
---|
1047 | if handles.plot==1 |
---|
1048 | inplot(h, eventdata, handles, varargin); |
---|
1049 | else |
---|
1050 | disp('Push ''PLOT'' button') |
---|
1051 | end |
---|
1052 | guidata(h,handles) |
---|
1053 | return |
---|
1054 | % ------------------------------------------------------------ |
---|
1055 | % end colmin |
---|
1056 | % ------------------------------------------------------------ |
---|
1057 | |
---|
1058 | % ------------------------------------------------------------ |
---|
1059 | % colmax |
---|
1060 | % ------------------------------------------------------------ |
---|
1061 | function varargout = editcolmax_Callback(h, eventdata, handles, varargin) |
---|
1062 | % Stub for Callback of the ncol text box |
---|
1063 | handles.colmax = str2num(get(handles.editcolmax,'String')); |
---|
1064 | if handles.colmax <= handles.colmin |
---|
1065 | handles.colmax=handles.colmin+0.01; |
---|
1066 | set(handles.editcolmax,'String',num2str(handles.colmax)) |
---|
1067 | end |
---|
1068 | if handles.plot==1 |
---|
1069 | inplot(h, eventdata, handles, varargin); |
---|
1070 | else |
---|
1071 | disp('Push ''PLOT'' button') |
---|
1072 | end |
---|
1073 | guidata(h,handles) |
---|
1074 | return |
---|
1075 | % ------------------------------------------------------------ |
---|
1076 | % end colmax |
---|
1077 | % ------------------------------------------------------------ |
---|
1078 | |
---|
1079 | % ------------------------------------------------------------ |
---|
1080 | % resetcolors |
---|
1081 | % ------------------------------------------------------------ |
---|
1082 | function varargout = resetcolors_Callback(h, eventdata, handles, varargin) |
---|
1083 | % Stub for Callback of the uicontrol handles.pushbutton25. |
---|
1084 | handles.colmax = []; |
---|
1085 | handles.colmin = []; |
---|
1086 | if handles.plot==1 |
---|
1087 | inplot(h, eventdata, handles, varargin); |
---|
1088 | else |
---|
1089 | disp('Push ''PLOT'' button') |
---|
1090 | end |
---|
1091 | guidata(h,handles) |
---|
1092 | return |
---|
1093 | % ------------------------------------------------------------ |
---|
1094 | % end resetcolors |
---|
1095 | % ------------------------------------------------------------ |
---|
1096 | |
---|
1097 | % ------------------------------------------------------------ |
---|
1098 | % boundary points |
---|
1099 | % ------------------------------------------------------------ |
---|
1100 | function varargout = editnptsW_Callback(h, eventdata, handles, varargin) |
---|
1101 | % Stub for Callback of the uicontrol handles.editnptsW. |
---|
1102 | handles.rempts(1)=floor(min([((handles.L-4)/2) ... |
---|
1103 | abs(str2num(get(handles.editnptsW,'String')))])); |
---|
1104 | set(handles.editnptsW,'String',num2str(handles.rempts(1))) |
---|
1105 | if handles.plot==1 |
---|
1106 | inplot(h, eventdata, handles, varargin); |
---|
1107 | else |
---|
1108 | disp('Push ''PLOT'' button') |
---|
1109 | end |
---|
1110 | guidata(h,handles) |
---|
1111 | return |
---|
1112 | % ------------------------------------------------------------ |
---|
1113 | function varargout = editnptsE_Callback(h, eventdata, handles, varargin) |
---|
1114 | % Stub for Callback of the uicontrol handles.editnptsE. |
---|
1115 | handles.rempts(2)=floor(min([((handles.L-4)/2) ... |
---|
1116 | abs(str2num(get(handles.editnptsE,'String')))])); |
---|
1117 | set(handles.editnptsE,'String',num2str(handles.rempts(2))) |
---|
1118 | if handles.plot==1 |
---|
1119 | inplot(h, eventdata, handles, varargin); |
---|
1120 | else |
---|
1121 | disp('Push ''PLOT'' button') |
---|
1122 | end |
---|
1123 | guidata(h,handles) |
---|
1124 | return |
---|
1125 | % ------------------------------------------------------------ |
---|
1126 | function varargout = editnptsS_Callback(h, eventdata, handles, varargin) |
---|
1127 | % Stub for Callback of the uicontrol handles.editnptsS. |
---|
1128 | handles.rempts(3)=floor(min([((handles.M-4)/2) ... |
---|
1129 | abs(str2num(get(handles.editnptsS,'String')))])); |
---|
1130 | set(handles.editnptsS,'String',num2str(handles.rempts(3))) |
---|
1131 | if handles.plot==1 |
---|
1132 | inplot(h, eventdata, handles, varargin); |
---|
1133 | else |
---|
1134 | disp('Push ''PLOT'' button') |
---|
1135 | end |
---|
1136 | guidata(h,handles) |
---|
1137 | return |
---|
1138 | % ------------------------------------------------------------ |
---|
1139 | function varargout = editnptsN_Callback(h, eventdata, handles, varargin) |
---|
1140 | % Stub for Callback of the uicontrol handles.editnptsN. |
---|
1141 | handles.rempts(4)=floor(min([((handles.M-4)/2) ... |
---|
1142 | abs(str2num(get(handles.editnptsN,'String')))])); |
---|
1143 | set(handles.editnptsN,'String',num2str(handles.rempts(4))) |
---|
1144 | if handles.plot==1 |
---|
1145 | inplot(h, eventdata, handles, varargin); |
---|
1146 | else |
---|
1147 | disp('Push ''PLOT'' button') |
---|
1148 | end |
---|
1149 | guidata(h,handles) |
---|
1150 | return |
---|
1151 | % ------------------------------------------------------------ |
---|
1152 | % end boundary points |
---|
1153 | % ------------------------------------------------------------ |
---|
1154 | |
---|
1155 | % ------------------------------------------------------------ |
---|
1156 | % isobath |
---|
1157 | % ------------------------------------------------------------ |
---|
1158 | function varargout = editisobath_Callback(h, eventdata, handles, varargin) |
---|
1159 | handles.isobath=get(handles.editisobath,'String'); |
---|
1160 | if handles.plot==1 |
---|
1161 | inplot(h, eventdata, handles, varargin); |
---|
1162 | else |
---|
1163 | disp('Push ''PLOT'' button') |
---|
1164 | end |
---|
1165 | guidata(h,handles) |
---|
1166 | return |
---|
1167 | % ------------------------------------------------------------ |
---|
1168 | % end isobath |
---|
1169 | % ------------------------------------------------------------ |
---|
1170 | |
---|
1171 | % ------------------------------------------------------------ |
---|
1172 | % coeff |
---|
1173 | % ------------------------------------------------------------ |
---|
1174 | function varargout = editcoef_Callback(h, eventdata, handles, varargin) |
---|
1175 | handles.coef=str2num(get(handles.editcoef,'String')); |
---|
1176 | guidata(h,handles) |
---|
1177 | resetcolors_Callback(h, eventdata, handles, varargin); |
---|
1178 | return |
---|
1179 | % ------------------------------------------------------------ |
---|
1180 | % end coeff |
---|
1181 | % ------------------------------------------------------------ |
---|
1182 | |
---|
1183 | % ------------------------------------------------------------ |
---|
1184 | % Number of embedded levels |
---|
1185 | % ------------------------------------------------------------ |
---|
1186 | function varargout = editnlev_Callback(h, eventdata, handles, varargin) |
---|
1187 | handles.gridlevs=str2num(get(handles.editnlev,'String')); |
---|
1188 | if handles.plot==1 |
---|
1189 | inplot(h, eventdata, handles, varargin); |
---|
1190 | else |
---|
1191 | disp('Push ''PLOT'' button') |
---|
1192 | end |
---|
1193 | guidata(h,handles) |
---|
1194 | return |
---|
1195 | % ------------------------------------------------------------ |
---|
1196 | % end number of embedded levels |
---|
1197 | % ------------------------------------------------------------ |
---|
1198 | |
---|
1199 | % ------------------------------------------------------------ |
---|
1200 | % ------------------------------------------------------------ |
---|
1201 | % ------------------------------------------------------------ |
---|
1202 | % ------------------------------------------------------------ |
---|
1203 | % Hold plot in the gui |
---|
1204 | % ------------------------------------------------------------ |
---|
1205 | function holdplot_Callback(h, eventdata, handles, varargin) |
---|
1206 | handles.plot=0; |
---|
1207 | guidata(h,handles) |
---|
1208 | return |
---|
1209 | % ------------------------------------------------------------ |
---|
1210 | % Restore plot in the gui |
---|
1211 | % ------------------------------------------------------------ |
---|
1212 | function plotbutton_Callback(h, eventdata, handles, varargin) |
---|
1213 | handles.plot=1; |
---|
1214 | guidata(h,handles) |
---|
1215 | inplot(h, eventdata, handles, varargin); |
---|
1216 | return |
---|
1217 | % ------------------------------------------------------------ |
---|
1218 | % Do a plotbutton in the GUI |
---|
1219 | % ------------------------------------------------------------ |
---|
1220 | function varargout = inplot(h, eventdata, handles, varargin) |
---|
1221 | horizslice(handles.hisfile,handles.vname,handles.tindex,... |
---|
1222 | handles.vlevel,handles.rempts,handles.coef,handles.gridlevs,... |
---|
1223 | handles.colmin,handles.colmax,handles.lonmin,handles.lonmax,... |
---|
1224 | handles.latmin,handles.latmax,handles.ncol,... |
---|
1225 | handles.pltstyle,handles.isobath,handles.cstep,... |
---|
1226 | handles.cscale,handles.cunit,handles.coastfile,... |
---|
1227 | handles.townfile,handles.gridfile,h,handles,... |
---|
1228 | handles.Yorig) |
---|
1229 | return |
---|
1230 | % ------------------------------------------------------------ |
---|
1231 | % Do a plotbutton outside of the GUI |
---|
1232 | % ------------------------------------------------------------ |
---|
1233 | function varargout = outplot_Callback(h, eventdata, handles, varargin) |
---|
1234 | figure(1) |
---|
1235 | horizslice(handles.hisfile,handles.vname,handles.tindex,... |
---|
1236 | handles.vlevel,handles.rempts,handles.coef,handles.gridlevs,... |
---|
1237 | handles.colmin,handles.colmax,handles.lonmin,handles.lonmax,... |
---|
1238 | handles.latmin,handles.latmax,handles.ncol,... |
---|
1239 | handles.pltstyle,handles.isobath,handles.cstep,... |
---|
1240 | handles.cscale,handles.cunit,handles.coastfile,... |
---|
1241 | handles.townfile,handles.gridfile,[],[],... |
---|
1242 | handles.Yorig) |
---|
1243 | return |
---|
1244 | % ------------------------------------------------------------ |
---|
1245 | % Print |
---|
1246 | % ------------------------------------------------------------ |
---|
1247 | function varargout = print_Callback(h, eventdata, handles, varargin) |
---|
1248 | outplot_Callback(h, eventdata, handles, varargin) |
---|
1249 | [day,month,year,imonth,thedate]=... |
---|
1250 | get_date(handles.hisfile,handles.tindex,handles.Yorig); |
---|
1251 | if handles.vname(1)=='*' |
---|
1252 | fname=[handles.vname(2:3),... |
---|
1253 | num2str(day),month,num2str(year),... |
---|
1254 | '_z',num2str(handles.vlevel),'.eps']; |
---|
1255 | else |
---|
1256 | fname=[handles.vname,num2str(day),month,num2str(year),... |
---|
1257 | '_z',num2str(handles.vlevel),'.eps']; |
---|
1258 | end |
---|
1259 | disp(['EPS file : ',fname]) |
---|
1260 | eval(['print -painter -depsc2 ',fname]) |
---|
1261 | return |
---|
1262 | % ------------------------------------------------------------ |
---|
1263 | % ------------------------------------------------------------ |
---|
1264 | |
---|
1265 | % ------------------------------------------------------------ |
---|
1266 | % ------------------------------------------------------------ |
---|
1267 | % Animation |
---|
1268 | % ------------------------------------------------------------ |
---|
1269 | % ------------------------------------------------------------ |
---|
1270 | function varargout = animation_Callback(h, eventdata, handles, varargin) |
---|
1271 | animation(handles) |
---|
1272 | |
---|
1273 | return |
---|
1274 | function varargout = editskipanim_Callback(h, eventdata, handles, varargin) |
---|
1275 | handles.skipanim=floor(abs(str2num(get(handles.editskipanim,'String')))); |
---|
1276 | set(handles.editskipanim,'String',num2str(handles.skipanim)) |
---|
1277 | guidata(h,handles) |
---|
1278 | return |
---|
1279 | % ------------------------------------------------------------ |
---|
1280 | % ------------------------------------------------------------ |
---|
1281 | |
---|
1282 | % ------------------------------------------------------------ |
---|
1283 | % --------------------- SPECIAL PLOTS ------------------------ |
---|
1284 | % ------------------------------------------------------------ |
---|
1285 | % ------------------------------------------------------------ |
---|
1286 | % Vertical section |
---|
1287 | % ------------------------------------------------------------ |
---|
1288 | function varargout = vsection_Callback(h, eventdata, handles, varargin) |
---|
1289 | [lon1,lat1,lon2,lat2]=get_mouse(handles); |
---|
1290 | figure(1) |
---|
1291 | vertslice(handles.hisfile,handles.gridfile,[lon1 lon2],[lat1 lat2],... |
---|
1292 | handles.vname,handles.tindex,handles.coef,[],[],... |
---|
1293 | handles.ncol,[],[],[],[],handles.pltstyle,[],[],... |
---|
1294 | handles.Yorig) |
---|
1295 | return |
---|
1296 | % ------------------------------------------------------------ |
---|
1297 | % Hovmuller diagram |
---|
1298 | % ------------------------------------------------------------ |
---|
1299 | function varargout = hovmull_Callback(h, eventdata, handles, varargin) |
---|
1300 | [lon1,lat1,lon2,lat2]=get_mouse(handles); |
---|
1301 | figure(1) |
---|
1302 | hovmuller(handles.hisfile,handles.gridfile,[lon1 lon2],[lat1 lat2],... |
---|
1303 | handles.vname,[1:handles.T],handles.vlevel,handles.coef,... |
---|
1304 | [],[],handles.ncol,[],[],[],[],handles.pltstyle) |
---|
1305 | return |
---|
1306 | % ------------------------------------------------------------ |
---|
1307 | % Time series |
---|
1308 | % ------------------------------------------------------------ |
---|
1309 | function varargout = tseries_Callback(h, eventdata, handles, varargin) |
---|
1310 | [lon0,lat0]=get_mouse_1(handles); |
---|
1311 | figure(1) |
---|
1312 | time_series(handles.hisfile,handles.gridfile,lon0,lat0,... |
---|
1313 | handles.vname,handles.vlevel,handles.coef) |
---|
1314 | return |
---|
1315 | % ------------------------------------------------------------ |
---|
1316 | % Vertical profile |
---|
1317 | % ------------------------------------------------------------ |
---|
1318 | function varargout = vprofile_Callback(h, eventdata, handles, varargin) |
---|
1319 | [lon0,lat0]=get_mouse_1(handles); |
---|
1320 | figure(1) |
---|
1321 | vert_profile(handles.hisfile,handles.gridfile,lon0,lat0,... |
---|
1322 | handles.vname,handles.tindex,handles.coef,... |
---|
1323 | handles.Yorig) |
---|
1324 | return |
---|
1325 | % ------------------------------------------------------------ |
---|
1326 | % View bathymetry |
---|
1327 | % ------------------------------------------------------------ |
---|
1328 | function varargout = viewtopo_Callback(h, eventdata, handles, varargin) |
---|
1329 | handles.vname='h'; |
---|
1330 | handles.vlevel=0; |
---|
1331 | if handles.plot==1 |
---|
1332 | inplot(h, eventdata, handles, varargin); |
---|
1333 | else |
---|
1334 | disp('Push ''PLOT'' button') |
---|
1335 | end |
---|
1336 | guidata(h,handles) |
---|
1337 | return |
---|
1338 | % ------------------------------------------------------------ |
---|
1339 | % ------------------------------------------------------------ |
---|
1340 | |
---|
1341 | % ------------------------------------------------------------ |
---|
1342 | % Year origin |
---|
1343 | % ------------------------------------------------------------ |
---|
1344 | function edit_Yorig_Callback(h, eventdata, handles, varargin) |
---|
1345 | handles.Yorig=str2num(get(handles.edit_Yorig,'String')); |
---|
1346 | if handles.plot==1 |
---|
1347 | inplot(h, eventdata, handles, varargin); |
---|
1348 | else |
---|
1349 | disp('Push ''PLOT'' button') |
---|
1350 | end |
---|
1351 | guidata(h,handles) |
---|
1352 | % ------------------------------------------------------------ |
---|
1353 | % ------------------------------------------------------------ |
---|
1354 | |
---|
1355 | |
---|
1356 | |
---|
1357 | % ------------------------------------------------------------ |
---|
1358 | % ------------------------------------------------------------ |
---|
1359 | % ------------------------------------------------------------ |
---|
1360 | % ------------------------------------------------------------ |
---|
1361 | % ------------------------------------------------------------ |
---|
1362 | % --------------------------- fin ------------------------ |
---|
1363 | % ------------------------------------------------------------ |
---|
1364 | % ------------------------------------------------------------ |
---|
1365 | |
---|
1366 | |
---|
1367 | |
---|