0001 function varargout = VMT_GraphicsControl(varargin)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 gui_Singleton = 1;
0016 gui_State = struct('gui_Name', mfilename, ...
0017 'gui_Singleton', gui_Singleton, ...
0018 'gui_OpeningFcn', @VMT_GraphicsControl_OpeningFcn, ...
0019 'gui_OutputFcn', @VMT_GraphicsControl_OutputFcn, ...
0020 'gui_LayoutFcn', [] , ...
0021 'gui_Callback', []);
0022 if nargin && ischar(varargin{1})
0023 gui_State.gui_Callback = str2func(varargin{1});
0024 end
0025
0026 if nargout
0027 [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
0028 else
0029 gui_mainfcn(gui_State, varargin{:});
0030 end
0031
0032
0033
0034
0035 function VMT_GraphicsControl_OpeningFcn(hObject, eventdata, handles, varargin)
0036
0037
0038
0039
0040
0041
0042
0043 handles.output = hObject;
0044
0045
0046 guidata(hObject, handles);
0047
0048
0049
0050 guiparams = createGUIparams;
0051
0052
0053
0054 setappdata(handles.figure1,'guiparams',guiparams)
0055
0056
0057
0058 load_prefs(handles.figure1)
0059
0060
0061
0062 initGUI(handles)
0063
0064
0065
0066
0067
0068
0069
0070
0071
0072 function varargout = VMT_GraphicsControl_OutputFcn(hObject, eventdata, handles)
0073
0074
0075
0076
0077
0078
0079 varargout{1} = handles.output;
0080
0081
0082
0083 function UseDataLimitsPlanview_Callback(hObject, eventdata, handles)
0084
0085
0086
0087 guiparams = getappdata(handles.figure1,'guiparams');
0088
0089
0090
0091 guiparams.use_data_limits_planview = logical(get(hObject,'Value'));
0092
0093 if ~guiparams.use_data_limits_planview
0094
0095
0096 set_enable(handles,'setplanviewon')
0097 else
0098
0099
0100
0101 PVdata = guiparams.gp_vmt.iric_anv_planview_data.outmat';
0102 PVdata(:,4:5) = PVdata(:,4:5).*100;
0103 vr = sqrt(PVdata(:,4).^2+PVdata(:,5).^2);
0104 guiparams.min_velocity_planview = nanmin(vr);
0105 guiparams.max_velocity_planview = nanmax(vr);
0106
0107
0108 if ~guiparams.gp_vmt.english_units
0109
0110 else
0111 guiparams.min_velocity_planview = guiparams.min_velocity_planview*0.03281;
0112 guiparams.max_velocity_planview = guiparams.max_velocity_planview*0.03281;
0113
0114
0115 end
0116 set(handles.MinVelocityPlanview, 'String', guiparams.min_velocity_planview);
0117 set(handles.MaxVelocityPlanview, 'String', guiparams.max_velocity_planview);
0118
0119
0120
0121 set_enable(handles,'setplanviewoff')
0122 end
0123
0124
0125
0126 setappdata(handles.figure1,'guiparams',guiparams)
0127
0128
0129
0130
0131
0132
0133
0134 function MinVelocityPlanview_Callback(hObject, eventdata, handles)
0135
0136
0137 guiparams = getappdata(handles.figure1,'guiparams');
0138
0139
0140
0141 new_value = str2double(get(hObject,'String'));
0142 is_a_number = ~isnan(new_value);
0143
0144
0145
0146 if is_a_number
0147 guiparams.min_velocity_planview = new_value;
0148
0149
0150
0151 setappdata(handles.figure1,'guiparams',guiparams)
0152
0153 else
0154 set(hObject,'String',guiparams.min_velocity_planview)
0155 end
0156
0157
0158
0159
0160
0161
0162 function MaxVelocityPlanview_Callback(hObject, eventdata, handles)
0163
0164
0165 guiparams = getappdata(handles.figure1,'guiparams');
0166
0167
0168
0169 new_value = str2double(get(hObject,'String'));
0170 is_a_number = ~isnan(new_value);
0171
0172
0173
0174 if is_a_number
0175 guiparams.max_velocity_planview = new_value;
0176
0177
0178
0179 setappdata(handles.figure1,'guiparams',guiparams)
0180
0181 else
0182 set(hObject,'String',guiparams.max_velocity_planview)
0183 end
0184
0185
0186
0187
0188
0189 function ColormapPlanview_Callback(hObject, eventdata, handles)
0190
0191
0192 guiparams = getappdata(handles.figure1,'guiparams');
0193 guiprefs = getappdata(handles.figure1,'guiprefs');
0194
0195
0196
0197 idx_variable = get(hObject,'Value');
0198 guiparams.idx_colormap_planview = idx_variable;
0199 guiparams.colormap_planview = guiparams.colormaps_planview(idx_variable).string;
0200
0201 if strcmpi('Browse for more (cpt)...',guiparams.colormap_planview)
0202 [FileName,PathName] = uigetfile('*.cpt','Select the cpt colormap file',...
0203 fullfile(guiprefs.cpt_path,guiprefs.cpt_file));
0204 guiparams.cpt_planview = fullfile(PathName,FileName);
0205
0206
0207
0208 guiprefs.cpt_path = PathName;
0209 guiprefs.cpt_file = FileName;
0210 setappdata(handles.figure1,'guiprefs',guiprefs)
0211 store_prefs(handles.figure1,'cptplanview')
0212 end
0213
0214
0215
0216 setappdata(handles.figure1,'guiparams',guiparams)
0217
0218
0219
0220
0221
0222
0223 function UseDataLimitsMCS_Callback(hObject, eventdata, handles)
0224
0225
0226 guiparams = getappdata(handles.figure1,'guiparams');
0227
0228
0229
0230 guiparams.use_data_limits_mcs = logical(get(hObject,'Value'));
0231
0232 if ~guiparams.use_data_limits_mcs
0233
0234
0235 set_enable(handles,'setmcson')
0236 else
0237
0238
0239
0240 switch guiparams.gp_vmt.contour
0241 case 'streamwise'
0242 vmin = nanmin(guiparams.gp_vmt.V.uSmooth(:));
0243 vmax = nanmax(guiparams.gp_vmt.V.uSmooth(:));
0244 case 'transverse'
0245 vmin = nanmin(guiparams.gp_vmt.V.vSmooth(:));
0246 vmax = nanmax(guiparams.gp_vmt.V.vSmooth(:));
0247 case 'vertical'
0248 vmin = nanmin(guiparams.gp_vmt.V.wSmooth(:));
0249 vmax = nanmax(guiparams.gp_vmt.V.wSmooth(:));
0250 case 'mag'
0251 vmin = nanmin(guiparams.gp_vmt.V.mcsMagSmooth(:));
0252 vmax = nanmax(guiparams.gp_vmt.V.mcsMagSmooth(:));
0253 case 'east'
0254 vmin = nanmin(guiparams.gp_vmt.V.mcsMagSmooth(:));
0255 vmax = nanmax(guiparams.gp_vmt.V.mcsMagSmooth(:));
0256 case 'north'
0257 vmin = nanmin(guiparams.gp_vmt.V.mcsEastSmooth(:));
0258 vmax = nanmax(guiparams.gp_vmt.V.mcsNorthSmooth(:));
0259 case 'primary_zsd'
0260 vmin = nanmin(guiparams.gp_vmt.V.vpSmooth(:));
0261 vmax = nanmax(guiparams.gp_vmt.V.vpSmooth(:));
0262 case 'secondary_zsd'
0263 vmin = nanmin(guiparams.gp_vmt.V.vsSmooth(:));
0264 vmax = nanmax(guiparams.gp_vmt.V.vsSmooth(:));
0265 case 'primary_roz'
0266 vmin = nanmin(guiparams.gp_vmt.V.Roz.upSmooth(:));
0267 vmax = nanmax(guiparams.gp_vmt.V.Roz.upSmooth(:));
0268 case 'secondary_roz'
0269 vmin = nanmin(guiparams.gp_vmt.V.Roz.usSmooth(:));
0270 vmax = nanmax(guiparams.gp_vmt.V.Roz.usSmooth(:));
0271 case 'primary_roz_x'
0272 vmin = nanmin(guiparams.gp_vmt.V.Roz.upxSmooth(:));
0273 vmax = nanmax(guiparams.gp_vmt.V.Roz.upxSmooth(:));
0274 case 'primary_roz_y'
0275 vmin = nanmin(guiparams.gp_vmt.V.Roz.upySmooth(:));
0276 vmax = nanmax(guiparams.gp_vmt.V.Roz.upySmooth(:));
0277 case 'secondary_roz_x'
0278 vmin = nanmin(guiparams.gp_vmt.V.Roz.usxSmooth(:));
0279 vmax = nanmax(guiparams.gp_vmt.V.Roz.usxSmooth(:));
0280 case 'secondary_roz_y'
0281 vmin = nanmin(guiparams.gp_vmt.V.Roz.usySmooth(:));
0282 vmax = nanmax(guiparams.gp_vmt.V.Roz.usySmooth(:));
0283 case 'backscatter'
0284 vmin = nanmin(guiparams.gp_vmt.V.mcsBackSmooth(:));
0285 vmax = nanmax(guiparams.gp_vmt.V.mcsBackSmooth(:));
0286 case 'flowangle'
0287 vmin = nanmin(guiparams.gp_vmt.V.mcsDirSmooth(:));
0288 vmax = nanmax(guiparams.gp_vmt.V.mcsDirSmooth(:));
0289 end
0290 guiparams.min_velocity_mcs = vmin;
0291 guiparams.max_velocity_mcs = vmax;
0292
0293
0294 if ~guiparams.gp_vmt.english_units
0295
0296 else
0297
0298
0299 guiparams.min_velocity_mcs = guiparams.min_velocity_mcs*0.03281;
0300 guiparams.max_velocity_mcs = guiparams.max_velocity_mcs*0.03281;
0301 end
0302 set(handles.MinVelocityMCS, 'String', guiparams.min_velocity_mcs);
0303 set(handles.MaxVelocityMCS, 'String', guiparams.max_velocity_mcs);
0304
0305
0306
0307 set_enable(handles,'setmcsoff')
0308 end
0309
0310
0311
0312 setappdata(handles.figure1,'guiparams',guiparams)
0313
0314
0315
0316
0317 function MinVelocityMCS_Callback(hObject, eventdata, handles)
0318
0319
0320 guiparams = getappdata(handles.figure1,'guiparams');
0321
0322
0323
0324 new_value = str2double(get(hObject,'String'));
0325 is_a_number = ~isnan(new_value);
0326
0327
0328
0329 if is_a_number
0330 guiparams.min_velocity_mcs = new_value;
0331
0332
0333
0334 setappdata(handles.figure1,'guiparams',guiparams)
0335
0336 else
0337 set(hObject,'String',guiparams.min_velocity_mcs)
0338 end
0339
0340
0341
0342
0343
0344 function MaxVelocityMCS_Callback(hObject, eventdata, handles)
0345
0346
0347 guiparams = getappdata(handles.figure1,'guiparams');
0348
0349
0350
0351 new_value = str2double(get(hObject,'String'));
0352 is_a_number = ~isnan(new_value);
0353
0354
0355
0356 if is_a_number
0357 guiparams.max_velocity_mcs = new_value;
0358
0359
0360
0361 setappdata(handles.figure1,'guiparams',guiparams)
0362
0363 else
0364 set(hObject,'String',guiparams.max_velocity_mcs)
0365 end
0366
0367
0368
0369
0370
0371 function ColormapMCS_Callback(hObject, eventdata, handles)
0372
0373
0374 guiparams = getappdata(handles.figure1,'guiparams');
0375 guiprefs = getappdata(handles.figure1,'guiprefs');
0376
0377
0378
0379 idx_variable = get(hObject,'Value');
0380 guiparams.idx_colormap_mcs = idx_variable;
0381 guiparams.colormap_mcs = guiparams.colormaps_mcs(idx_variable).string;
0382
0383 if strcmpi('Browse for more (cpt)...',guiparams.colormap_mcs)
0384 [FileName,PathName] = uigetfile('*.cpt','Select the cpt colormap file',...
0385 fullfile(guiprefs.cpt_path,guiprefs.cpt_file));
0386 guiparams.cpt_mcs = fullfile(PathName,FileName);
0387
0388
0389
0390 guiprefs.cpt_path = PathName;
0391 guiprefs.cpt_file = FileName;
0392 setappdata(handles.figure1,'guiprefs',guiprefs)
0393 store_prefs(handles.figure1,'cptmcs')
0394 end
0395
0396
0397
0398 setappdata(handles.figure1,'guiparams',guiparams)
0399
0400
0401
0402
0403
0404 function ReferenceVelocity_Callback(hObject, eventdata, handles)
0405
0406
0407 guiparams = getappdata(handles.figure1,'guiparams');
0408
0409
0410
0411 new_value = str2double(get(hObject,'String'));
0412 is_a_number = ~isnan(new_value);
0413 is_positive = new_value>=0;
0414
0415
0416
0417 if is_a_number && is_positive
0418 guiparams.reference_velocity = new_value;
0419
0420
0421
0422 setappdata(handles.figure1,'guiparams',guiparams)
0423
0424 else
0425 set(hObject,'String',guiparams.reference_velocity)
0426 end
0427
0428
0429
0430
0431
0432
0433 function UseDefaults_Callback(hObject, eventdata, handles)
0434
0435
0436 guiparams = getappdata(handles.figure1,'guiparams');
0437
0438
0439
0440 guiparams.use_defaults = logical(get(hObject,'Value'));
0441
0442 if ~guiparams.use_defaults
0443
0444
0445 set_enable(handles,'setrefon')
0446 else
0447 [~,J] = ind2sub(size(guiparams.gp_vmt.V.vp(1,:)),find(~isnan(guiparams.gp_vmt.V.vp(1,:))==1));
0448 et = J(1):guiparams.gp_vmt.horizontal_vector_spacing:J(end);
0449 [r, ~]=size(guiparams.gp_vmt.V.vp);
0450 bi = 1:guiparams.gp_vmt.vertical_vector_spacing:r;
0451 switch guiparams.gp_vmt.secondary_flow_vector_variable
0452 case 'transverse'
0453 reference_velocity = ceil(max(max(abs(guiparams.gp_vmt.V.vSmooth(bi,et)))));
0454 case 'secondary_zsd'
0455 reference_velocity = ceil(max(max(abs(guiparams.gp_vmt.V.vsSmooth(bi,et)))));
0456 case 'secondary_roz'
0457 reference_velocity = ceil(max(max(abs(guiparams.gp_vmt.V.Roz.usSmooth(bi,et)))));
0458 case 'secondary_roz_y'
0459 reference_velocity = ceil(max(max(abs(guiparams.gp_vmt.V.Roz.usySmooth(bi,et)))));
0460 case 'primary_roz_y'
0461 reference_velocity = ceil(max(max(abs(guiparams.gp_vmt.V.Roz.upySmooth(bi,et)))));
0462 end
0463
0464 distance = 0.06*max(guiparams.gp_vmt.V.mcsDist(:));
0465 depth = 0.95*max(guiparams.gp_vmt.V.mcsBed(:));
0466 if guiparams.gp_vmt.english_units
0467 reference_velocity = reference_velocity*0.03281;
0468 distance = distance*3.281;
0469 depth = depth*3.281;
0470 end
0471
0472
0473 set(handles.ReferenceVelocity, 'String', num2str(reference_velocity))
0474 set(handles.Distance, 'String', num2str(distance))
0475 set(handles.Depth, 'String', num2str(depth))
0476
0477
0478
0479 guiparams.reference_velocity = reference_velocity;
0480 guiparams.distance = distance;
0481 guiparams.depth = depth;
0482 setappdata(handles.figure1,'guiparams',guiparams)
0483
0484
0485
0486 set_enable(handles,'setrefoff')
0487 end
0488
0489
0490
0491
0492
0493 function Distance_Callback(hObject, eventdata, handles)
0494
0495
0496 guiparams = getappdata(handles.figure1,'guiparams');
0497
0498
0499
0500 new_value = str2double(get(hObject,'String'));
0501 is_a_number = ~isnan(new_value);
0502 is_positive = new_value>=0;
0503
0504
0505
0506 if is_a_number && is_positive
0507 guiparams.distance = new_value;
0508
0509
0510
0511 setappdata(handles.figure1,'guiparams',guiparams)
0512
0513 else
0514 set(hObject,'String',guiparams.distance)
0515 end
0516
0517
0518
0519
0520
0521
0522 function Depth_Callback(hObject, eventdata, handles)
0523
0524
0525 guiparams = getappdata(handles.figure1,'guiparams');
0526
0527
0528
0529 new_value = str2double(get(hObject,'String'));
0530 is_a_number = ~isnan(new_value);
0531 is_positive = new_value>=0;
0532
0533
0534
0535 if is_a_number && is_positive
0536 guiparams.depth = new_value;
0537
0538
0539
0540 setappdata(handles.figure1,'guiparams',guiparams)
0541
0542 else
0543 set(hObject,'String',guiparams.depth)
0544 end
0545
0546
0547
0548
0549
0550
0551 function ApplyChanges_Callback(hObject, eventdata, handles)
0552
0553
0554 guiparams = getappdata(handles.figure1,'guiparams');
0555 guiprefs = getappdata(handles.figure1,'guiprefs');
0556 z = guiparams.gp_vmt.z;
0557 A = guiparams.gp_vmt.A;
0558 V = guiparams.gp_vmt.V;
0559 Map = guiparams.gp_vmt.Map;
0560
0561
0562 fig_planview_handle = findobj(0,'name','Plan View Map');
0563
0564
0565 if ~isempty(fig_planview_handle) && ishandle(fig_planview_handle)
0566 figure(fig_planview_handle);
0567
0568
0569
0570 depth_range = [guiparams.gp_vmt.depth_range_min guiparams.gp_vmt.depth_range_max];
0571
0572 minrng = guiparams.min_velocity_planview;
0573 maxrng = guiparams.max_velocity_planview;
0574 usecolormap = guiparams.colormap_planview;
0575 cptfullfile = guiparams.cpt_planview;
0576 [~,~,~] = VMT_PlotPlanViewQuivers(z,A,V,Map, ...
0577 depth_range, ...
0578 guiparams.gp_vmt.vector_scale_plan_view, ...
0579 guiparams.gp_vmt.vector_spacing_plan_view, ...
0580 guiparams.gp_vmt.smoothing_window_size, ...
0581 guiparams.gp_vmt.display_shoreline, ...
0582 guiparams.gp_vmt.english_units,...
0583 guiparams.gp_vmt.mat_file, ...
0584 guiparams.gp_vmt.mat_path,...
0585 minrng,...
0586 maxrng,...
0587 usecolormap,...
0588 cptfullfile);
0589
0590
0591 if guiparams.gp_vmt.display_shoreline
0592
0593 if ischar(guiprefs.shoreline_file)
0594 mapdata = dlmread(fullfile(guiprefs.shoreline_path,guiprefs.shoreline_file));
0595 Map.UTMe = mapdata(:,1);
0596 Map.UTMn = mapdata(:,2);
0597 Map.infile = fullfile(guiprefs.shoreline_path,guiprefs.shoreline_file);
0598
0599 else
0600 Map = [];
0601 end
0602 VMT_PlotShoreline(Map)
0603 end
0604
0605
0606 if guiparams.gp_vmt.add_background
0607 [~,~] = VMT_OverlayDOQQ(guiprefs,true);
0608 end
0609 end
0610
0611
0612 fig_contour_handle = findobj(0,'name','Mean Cross Section Contour');
0613
0614
0615 if ~isempty(fig_contour_handle) && ishandle(fig_contour_handle)
0616 figure(fig_contour_handle);
0617
0618
0619 if guiparams.gp_vmt.plot_secondary_flow_vectors
0620 if ~guiparams.gp_vmt.english_units
0621 [~,A,V,plot_cont_log_text] = VMT_PlotXSContQuiver(z,A,V, ...
0622 guiparams.gp_vmt.contour, ...
0623 guiparams.gp_vmt.vector_scale_cross_section, ...
0624 guiparams.gp_vmt.vertical_exaggeration, ...
0625 guiparams.gp_vmt.horizontal_vector_spacing, ...
0626 guiparams.gp_vmt.vertical_vector_spacing, ...
0627 guiparams.gp_vmt.secondary_flow_vector_variable, ...
0628 guiparams.gp_vmt.include_vertical_velocity, ...
0629 guiparams.gp_vmt.english_units,...
0630 guiparams.reference_velocity,...
0631 guiparams.distance,...
0632 guiparams.depth);
0633 else
0634 [~,A,V,plot_cont_log_text] = VMT_PlotXSContQuiver(z,A,V, ...
0635 guiparams.gp_vmt.contour, ...
0636 guiparams.gp_vmt.vector_scale_cross_section, ...
0637 guiparams.gp_vmt.vertical_exaggeration, ...
0638 guiparams.gp_vmt.horizontal_vector_spacing, ...
0639 guiparams.gp_vmt.vertical_vector_spacing, ...
0640 guiparams.gp_vmt.secondary_flow_vector_variable, ...
0641 guiparams.gp_vmt.include_vertical_velocity, ...
0642 guiparams.gp_vmt.english_units,...
0643 guiparams.reference_velocity.*30.48,...
0644 guiparams.distance.*0.3048,...
0645 guiparams.depth.*0.3048);
0646 end
0647 end
0648
0649
0650 caxis([
0651 guiparams.min_velocity_mcs
0652 guiparams.max_velocity_mcs])
0653
0654
0655 if ~strcmpi('Browse for more (cpt)...',guiparams.colormap_mcs)
0656 colormap(guiparams.colormap_mcs)
0657 else
0658 cptcmap(guiparams.cpt_mcs)
0659 end
0660 end
0661
0662
0663
0664 if guiparams.gp_vmt.presentation
0665 UpdatePlotStyle(hObject, eventdata, handles)
0666 else
0667 UpdatePlotStyle(hObject, eventdata, handles)
0668 end
0669
0670
0671
0672
0673 function Close_Callback(hObject, eventdata, handles)
0674
0675 close(handles.figure1)
0676
0677
0678
0679
0680 function initGUI(handles)
0681
0682
0683 guiparams = getappdata(handles.figure1,'guiparams');
0684
0685
0686 set(handles.UseDataLimitsPlanview, 'Value', guiparams.use_data_limits_planview);
0687 set(handles.MinVelocityPlanview, 'String', guiparams.min_velocity_planview);
0688 set(handles.MinVelocityPlanviewUnits, 'String', guiparams.min_velocity_planview_units);
0689 set(handles.MaxVelocityPlanview, 'String', guiparams.max_velocity_planview);
0690 set(handles.MaxVelocityPlanviewUnits, 'String', guiparams.max_velocity_planview_units);
0691 set(handles.ColormapPlanview, 'String',{guiparams.colormaps_planview.string}, ...
0692 'Value', guiparams.idx_colormap_planview)
0693
0694
0695 set(handles.UseDataLimitsMCS, 'Value', guiparams.use_data_limits_mcs);
0696 set(handles.MinVelocityMCS, 'String', guiparams.min_velocity_mcs);
0697 set(handles.MinVelocityMCSUnits, 'String', guiparams.min_velocity_mcs_units);
0698 set(handles.MaxVelocityMCS, 'String', guiparams.max_velocity_mcs);
0699 set(handles.MaxVelocityMCSUnits, 'String', guiparams.max_velocity_mcs_units);
0700 set(handles.UseDefaults, 'Value', guiparams.use_defaults);
0701 set(handles.ReferenceVelocity, 'String', guiparams.reference_velocity);
0702 set(handles.ReferenceVelocityUnits, 'String', guiparams.reference_velocity_units);
0703 set(handles.Distance, 'String', guiparams.distance);
0704 set(handles.DistanceUnits, 'String', guiparams.distance_units);
0705 set(handles.Depth, 'String', guiparams.depth);
0706 set(handles.DepthUnits, 'String', guiparams.depth_units);
0707 set(handles.ColormapMCS, 'String',{guiparams.colormaps_mcs.string}, ...
0708 'Value', guiparams.idx_colormap_mcs);
0709
0710
0711
0712 if iscell(guiparams.gp_vmt.mat_file)
0713 set_enable(handles,'initmultiple')
0714 else
0715 set_enable(handles,'init')
0716 end
0717
0718
0719 function [guiparams] = createGUIparams
0720
0721
0722
0723 hVMTgui = getappdata(0,'hVMTgui');
0724 guiparams_vmt = getappdata(hVMTgui,'guiparams');
0725 guiparams.gp_vmt = guiparams_vmt;
0726
0727
0728
0729 fig_planview_handle = findobj(0,'name','Plan View Map');
0730 fig_mcs_handle = findobj(0,'name','Mean Cross Section Contour');
0731
0732
0733
0734
0735
0736
0737
0738
0739
0740
0741 guiparams.use_data_limits_planview = 1;
0742
0743 if ~isempty(fig_planview_handle) && ishandle(fig_planview_handle)
0744
0745 PVdata = guiparams.gp_vmt.iric_anv_planview_data.outmat';
0746 PVdata(:,4:5) = PVdata(:,4:5).*100;
0747 vr = sqrt(PVdata(:,4).^2+PVdata(:,5).^2);
0748 guiparams.min_velocity_planview = nanmin(vr);
0749 guiparams.max_velocity_planview = nanmax(vr);
0750 else
0751 guiparams.min_velocity_planview = 0;
0752 guiparams.max_velocity_planview = 0;
0753 end
0754
0755
0756 guiparams.idx_colormap_planview = 1;
0757 idx = 1;
0758 guiparams.colormaps_planview(idx).string = 'Jet';
0759 idx = idx + 1;
0760 guiparams.colormaps_planview(idx).string = 'HSV';
0761 idx = idx + 1;
0762 guiparams.colormaps_planview(idx).string = 'Hot';
0763 idx = idx + 1;
0764 guiparams.colormaps_planview(idx).string = 'Cool';
0765 idx = idx + 1;
0766 guiparams.colormaps_planview(idx).string = 'Spring';
0767 idx = idx + 1;
0768 guiparams.colormaps_planview(idx).string = 'Summer';
0769 idx = idx + 1;
0770 guiparams.colormaps_planview(idx).string = 'Autumn';
0771 idx = idx + 1;
0772 guiparams.colormaps_planview(idx).string = 'Winter';
0773 idx = idx + 1;
0774 guiparams.colormaps_planview(idx).string = 'Gray';
0775 idx = idx + 1;
0776 guiparams.colormaps_planview(idx).string = 'Bone';
0777 idx = idx + 1;
0778 guiparams.colormaps_planview(idx).string = 'Copper';
0779 idx = idx + 1;
0780 guiparams.colormaps_planview(idx).string = 'Pink';
0781 idx = idx + 1;
0782 guiparams.colormaps_planview(idx).string = 'Browse for more (cpt)...';
0783 guiparams.colormap_planview = ...
0784 guiparams.colormaps_planview(guiparams.idx_colormap_planview).string;
0785 guiparams.cpt_planview = [];
0786
0787
0788
0789
0790 guiparams.use_data_limits_mcs = 1;
0791 guiparams.use_defaults = 1;
0792
0793 if ~isempty(fig_mcs_handle) && ishandle(fig_mcs_handle)
0794 if iscell(guiparams.gp_vmt.mat_file)
0795 guiparams.min_velocity_mcs = 0;
0796 guiparams.max_velocity_mcs = 0;
0797 guiparams.distance = 0;
0798 guiparams.depth = 0;
0799 guiparams.reference_velocity = 0;
0800 else
0801
0802
0803 switch guiparams.gp_vmt.contour
0804 case 'streamwise'
0805 vmin = nanmin(guiparams.gp_vmt.V.uSmooth(:));
0806 vmax = nanmax(guiparams.gp_vmt.V.uSmooth(:));
0807 case 'transverse'
0808 vmin = nanmin(guiparams.gp_vmt.V.vSmooth(:));
0809 vmax = nanmax(guiparams.gp_vmt.V.vSmooth(:));
0810 case 'vertical'
0811 vmin = nanmin(guiparams.gp_vmt.V.wSmooth(:));
0812 vmax = nanmax(guiparams.gp_vmt.V.wSmooth(:));
0813 case 'mag'
0814 vmin = nanmin(guiparams.gp_vmt.V.mcsMagSmooth(:));
0815 vmax = nanmax(guiparams.gp_vmt.V.mcsMagSmooth(:));
0816 case 'east'
0817 vmin = nanmin(guiparams.gp_vmt.V.mcsMagSmooth(:));
0818 vmax = nanmax(guiparams.gp_vmt.V.mcsMagSmooth(:));
0819 case 'north'
0820 vmin = nanmin(guiparams.gp_vmt.V.mcsEastSmooth(:));
0821 vmax = nanmax(guiparams.gp_vmt.V.mcsNorthSmooth(:));
0822 case 'error'
0823 vmin = nanmin(guiparams.gp_vmt.V.mcsError(:));
0824 vmax = nanmax(guiparams.gp_vmt.V.mcsError(:));
0825 case 'primary_zsd'
0826 vmin = nanmin(guiparams.gp_vmt.V.vpSmooth(:));
0827 vmax = nanmax(guiparams.gp_vmt.V.vpSmooth(:));
0828 case 'secondary_zsd'
0829 vmin = nanmin(guiparams.gp_vmt.V.vsSmooth(:));
0830 vmax = nanmax(guiparams.gp_vmt.V.vsSmooth(:));
0831 case 'primary_roz'
0832 vmin = nanmin(guiparams.gp_vmt.V.Roz.upSmooth(:));
0833 vmax = nanmax(guiparams.gp_vmt.V.Roz.upSmooth(:));
0834 case 'secondary_roz'
0835 vmin = nanmin(guiparams.gp_vmt.V.Roz.usSmooth(:));
0836 vmax = nanmax(guiparams.gp_vmt.V.Roz.usSmooth(:));
0837 case 'primary_roz_x'
0838 vmin = nanmin(guiparams.gp_vmt.V.Roz.upxSmooth(:));
0839 vmax = nanmax(guiparams.gp_vmt.V.Roz.upxSmooth(:));
0840 case 'primary_roz_y'
0841 vmin = nanmin(guiparams.gp_vmt.V.Roz.upySmooth(:));
0842 vmax = nanmax(guiparams.gp_vmt.V.Roz.upySmooth(:));
0843 case 'secondary_roz_x'
0844 vmin = nanmin(guiparams.gp_vmt.V.Roz.usxSmooth(:));
0845 vmax = nanmax(guiparams.gp_vmt.V.Roz.usxSmooth(:));
0846 case 'secondary_roz_y'
0847 vmin = nanmin(guiparams.gp_vmt.V.Roz.usySmooth(:));
0848 vmax = nanmax(guiparams.gp_vmt.V.Roz.usySmooth(:));
0849 case 'backscatter'
0850 vmin = nanmin(guiparams.gp_vmt.V.mcsBackSmooth(:));
0851 vmax = nanmax(guiparams.gp_vmt.V.mcsBackSmooth(:));
0852 case 'flowangle'
0853 vmin = nanmin(guiparams.gp_vmt.V.mcsDirSmooth(:));
0854 vmax = nanmax(guiparams.gp_vmt.V.mcsDirSmooth(:));
0855 end
0856 guiparams.min_velocity_mcs = vmin;
0857 guiparams.max_velocity_mcs = vmax;
0858
0859
0860
0861
0862 i = 1;
0863 while any(isnan(guiparams.gp_vmt.V.vp(i,:)))
0864 i=i+1;
0865 if i > size(guiparams.gp_vmt.V.vp,1)
0866 break
0867 end
0868 end
0869
0870
0871
0872
0873
0874
0875
0876
0877
0878
0879 i = 1;
0880 while any(isnan(guiparams.gp_vmt.V.vp(i,:)))
0881 i=i+1;
0882 if i > size(guiparams.gp_vmt.V.vp,1)
0883 break
0884 end
0885 end
0886 i=5;
0887
0888
0889 try
0890 [I,J] = ind2sub(size(guiparams.gp_vmt.V.vp(i,:)),find(~isnan(guiparams.gp_vmt.V.vp(i,:))==1));
0891 catch err
0892 [I,J] = ind2sub(size(guiparams.gp_vmt.V.vp(1,:)),find(~isnan(guiparams.gp_vmt.V.vp(1,:))==1));
0893 end
0894
0895 et = J(1):guiparams.gp_vmt.horizontal_vector_spacing:J(end);
0896 [r, ~]=size(guiparams.gp_vmt.V.vp);
0897 bi = 1:guiparams.gp_vmt.vertical_vector_spacing:r;
0898 switch guiparams.gp_vmt.secondary_flow_vector_variable
0899 case 'transverse'
0900 guiparams.reference_velocity = ceil(max(max(abs(guiparams.gp_vmt.V.vSmooth(bi,et)))));
0901 case 'secondary_zsd'
0902 guiparams.reference_velocity = ceil(max(max(abs(guiparams.gp_vmt.V.vsSmooth(bi,et)))));
0903 case 'secondary_roz'
0904 guiparams.reference_velocity = ceil(max(max(abs(guiparams.gp_vmt.V.Roz.usSmooth(bi,et)))));
0905 case 'secondary_roz_y'
0906 guiparams.reference_velocity = ceil(max(max(abs(guiparams.gp_vmt.V.Roz.usySmooth(bi,et)))));
0907 case 'primary_roz_y'
0908 guiparams.reference_velocity = ceil(max(max(abs(guiparams.gp_vmt.V.Roz.upySmooth(bi,et)))));
0909 end
0910
0911 guiparams.distance = 0.06*max(guiparams.gp_vmt.V.mcsDist(:));
0912 guiparams.depth = 0.95*max(guiparams.gp_vmt.V.mcsBed(:));
0913 if guiparams.gp_vmt.english_units
0914 guiparams.reference_velocity = guiparams.reference_velocity*0.03281;
0915 guiparams.distance = guiparams.distance*3.281;
0916 guiparams.depth = guiparams.depth*3.281;
0917 end
0918 end
0919 else
0920 guiparams.min_velocity_mcs = 0;
0921 guiparams.max_velocity_mcs = 0;
0922 guiparams.distance = 0;
0923 guiparams.depth = 0;
0924 guiparams.reference_velocity = 0;
0925 end
0926
0927 guiparams.idx_colormap_mcs = 1;
0928
0929
0930 idx = 1;
0931 guiparams.colormaps_mcs(idx).string = 'Jet';
0932 idx = idx + 1;
0933 guiparams.colormaps_mcs(idx).string = 'HSV';
0934 idx = idx + 1;
0935 guiparams.colormaps_mcs(idx).string = 'Hot';
0936 idx = idx + 1;
0937 guiparams.colormaps_mcs(idx).string = 'Cool';
0938 idx = idx + 1;
0939 guiparams.colormaps_mcs(idx).string = 'Spring';
0940 idx = idx + 1;
0941 guiparams.colormaps_mcs(idx).string = 'Summer';
0942 idx = idx + 1;
0943 guiparams.colormaps_mcs(idx).string = 'Autumn';
0944 idx = idx + 1;
0945 guiparams.colormaps_mcs(idx).string = 'Winter';
0946 idx = idx + 1;
0947 guiparams.colormaps_mcs(idx).string = 'Gray';
0948 idx = idx + 1;
0949 guiparams.colormaps_mcs(idx).string = 'Bone';
0950 idx = idx + 1;
0951 guiparams.colormaps_mcs(idx).string = 'Copper';
0952 idx = idx + 1;
0953 guiparams.colormaps_mcs(idx).string = 'Pink';
0954 idx = idx + 1;
0955 guiparams.colormaps_mcs(idx).string = 'Browse for more (cpt)...';
0956 guiparams.colormap_mcs = ...
0957 guiparams.colormaps_mcs(guiparams.idx_colormap_mcs).string;
0958 guiparams.cpt_mcs = [];
0959
0960
0961 switch guiparams.gp_vmt.contour
0962 case 'backscatter'
0963 guiparams.min_velocity_mcs_units = 'dB';
0964 guiparams.max_velocity_mcs_units = 'dB';
0965 if ~guiparams.gp_vmt.english_units
0966 guiparams.min_velocity_planview_units = 'cm/s';
0967 guiparams.max_velocity_planview_units = 'cm/s';
0968
0969
0970 guiparams.reference_velocity_units = 'cm/s';
0971 guiparams.distance_units = 'm';
0972 guiparams.depth_units = 'm';
0973 else
0974 guiparams.min_velocity_planview_units = 'ft/s';
0975 guiparams.max_velocity_planview_units = 'ft/s';
0976
0977
0978 guiparams.reference_velocity_units = 'ft/s';
0979 guiparams.distance_units = 'ft';
0980 guiparams.depth_units = 'ft';
0981 end
0982 case 'flowangle'
0983 guiparams.min_velocity_mcs_units = 'deg';
0984 guiparams.max_velocity_mcs_units = 'deg';
0985 if ~guiparams.gp_vmt.english_units
0986 guiparams.min_velocity_planview_units = 'cm/s';
0987 guiparams.max_velocity_planview_units = 'cm/s';
0988
0989
0990 guiparams.reference_velocity_units = 'cm/s';
0991 guiparams.distance_units = 'm';
0992 guiparams.depth_units = 'm';
0993 else
0994 guiparams.min_velocity_planview_units = 'ft/s';
0995 guiparams.max_velocity_planview_units = 'ft/s';
0996
0997
0998 guiparams.reference_velocity_units = 'ft/s';
0999 guiparams.distance_units = 'ft';
1000 guiparams.depth_units = 'ft';
1001 end
1002 otherwise
1003 if ~guiparams.gp_vmt.english_units
1004 guiparams.min_velocity_planview_units = 'cm/s';
1005 guiparams.max_velocity_planview_units = 'cm/s';
1006
1007 guiparams.min_velocity_mcs_units = 'cm/s';
1008 guiparams.max_velocity_mcs_units = 'cm/s';
1009 guiparams.reference_velocity_units = 'cm/s';
1010 guiparams.distance_units = 'm';
1011 guiparams.depth_units = 'm';
1012 else
1013 guiparams.min_velocity_planview_units = 'ft/s';
1014 guiparams.max_velocity_planview_units = 'ft/s';
1015
1016 guiparams.min_velocity_mcs_units = 'ft/s';
1017 guiparams.max_velocity_mcs_units = 'ft/s';
1018 guiparams.reference_velocity_units = 'ft/s';
1019 guiparams.distance_units = 'ft';
1020 guiparams.depth_units = 'ft';
1021
1022 guiparams.min_velocity_planview = guiparams.min_velocity_planview*0.03281;
1023 guiparams.max_velocity_planview = guiparams.max_velocity_planview*0.03281;
1024 guiparams.min_velocity_mcs = guiparams.min_velocity_mcs*0.03281;
1025 guiparams.max_velocity_mcs = guiparams.max_velocity_mcs*0.03281;
1026 end
1027 end
1028
1029
1030
1031 function set_enable(handles,enable_state)
1032
1033 guiparams = getappdata(handles.figure1,'guiparams');
1034
1035 switch enable_state
1036 case 'init'
1037
1038 set([handles.UseDataLimitsPlanview
1039 handles.ColormapPlanview],'Enable', 'on');
1040 set([handles.MinVelocityPlanview
1041 handles.MinVelocityPlanviewUnits
1042 handles.MaxVelocityPlanview
1043 handles.MaxVelocityPlanviewUnits], 'Enable', 'off');
1044
1045
1046 set([handles.UseDataLimitsMCS
1047 handles.UseDefaults
1048 handles.ColormapMCS],'Enable', 'on');
1049 set([handles.MinVelocityMCS
1050 handles.MinVelocityMCSUnits
1051 handles.MaxVelocityMCS
1052 handles.MaxVelocityMCSUnits
1053 handles.ReferenceVelocity
1054 handles.ReferenceVelocityUnits
1055 handles.Distance
1056 handles.DistanceUnits
1057 handles.Depth
1058 handles.DepthUnits], 'Enable', 'off');
1059 case 'initmultiple'
1060
1061 set([handles.UseDataLimitsPlanview
1062 handles.ColormapPlanview],'Enable', 'on');
1063 set([handles.MinVelocityPlanview
1064 handles.MinVelocityPlanviewUnits
1065 handles.MaxVelocityPlanview
1066 handles.MaxVelocityPlanviewUnits], 'Enable', 'off');
1067
1068
1069 set([handles.UseDataLimitsMCS
1070 handles.UseDefaults
1071 handles.ColormapMCS],'Enable', 'off');
1072 set([handles.MinVelocityMCS
1073 handles.MinVelocityMCSUnits
1074 handles.MaxVelocityMCS
1075 handles.MaxVelocityMCSUnits
1076 handles.ReferenceVelocity
1077 handles.ReferenceVelocityUnits
1078 handles.Distance
1079 handles.DistanceUnits
1080 handles.Depth
1081 handles.DepthUnits], 'Enable', 'off');
1082 case 'setplanviewon'
1083
1084 set([handles.UseDataLimitsPlanview
1085 handles.ColormapPlanview],'Enable', 'on');
1086 set([handles.MinVelocityPlanview
1087 handles.MinVelocityPlanviewUnits
1088 handles.MaxVelocityPlanview
1089 handles.MaxVelocityPlanviewUnits], 'Enable', 'on');
1090 case 'setplanviewoff'
1091
1092 set([handles.UseDataLimitsPlanview
1093 handles.ColormapPlanview],'Enable', 'on');
1094 set([handles.MinVelocityPlanview
1095 handles.MinVelocityPlanviewUnits
1096 handles.MaxVelocityPlanview
1097 handles.MaxVelocityPlanviewUnits], 'Enable', 'off');
1098 case 'setmcson'
1099
1100 set([handles.UseDataLimitsMCS
1101 handles.ColormapMCS],'Enable', 'on');
1102 set([handles.MinVelocityMCS
1103 handles.MinVelocityMCSUnits
1104 handles.MaxVelocityMCS
1105 handles.MaxVelocityMCSUnits
1106 ], 'Enable', 'on');
1107 case 'setmcsoff'
1108
1109 set([handles.UseDataLimitsMCS
1110 handles.ColormapMCS],'Enable', 'on');
1111 set([handles.MinVelocityMCS
1112 handles.MinVelocityMCSUnits
1113 handles.MaxVelocityMCS
1114 handles.MaxVelocityMCSUnits
1115 ], 'Enable', 'off');
1116 case 'setrefon'
1117 set([handles.ReferenceVelocity
1118 handles.ReferenceVelocityUnits
1119 handles.Distance
1120 handles.DistanceUnits
1121 handles.Depth
1122 handles.DepthUnits], 'Enable', 'on');
1123 case 'setrefoff'
1124 set([handles.ReferenceVelocity
1125 handles.ReferenceVelocityUnits
1126 handles.Distance
1127 handles.DistanceUnits
1128 handles.Depth
1129 handles.DepthUnits], 'Enable', 'off');
1130 otherwise
1131 end
1132
1133
1134
1135 function UpdatePlotStyle(hObject, eventdata, handles)
1136
1137
1138 guiparams = getappdata(handles.figure1,'guiparams');
1139
1140
1141
1142
1143 hf = findobj('type','figure');
1144 valid_names = {'Plan View Map'; 'Mean Cross Section Contour'};
1145
1146 if guiparams.gp_vmt.presentation
1147
1148 BkgdColor = 'black';
1149 AxColor = 'white';
1150 FigColor = 'black';
1151 FntSize = 14;
1152 else
1153
1154 BkgdColor = 'white';
1155 AxColor = 'black';
1156 FigColor = 'white';
1157 FntSize = 14;
1158 end
1159
1160
1161 if ~isempty(hf) && any(ishandle(hf))
1162
1163 for i = 1:length(valid_names)
1164 switch valid_names{i}
1165 case 'Plan View Map'
1166
1167 hff = findobj('name','Plan View Map');
1168 if ~isempty(hff) && ishandle(hff)
1169 figure(hff)
1170
1171
1172 set(gcf,'Color',BkgdColor);
1173 set(gca,'FontSize',FntSize)
1174 set(get(gca,'Title'),'FontSize',FntSize)
1175 set(gca,'Color',FigColor)
1176 set(gca,'XColor',AxColor)
1177 set(gca,'YColor',AxColor)
1178 set(gca,'ZColor',AxColor)
1179 set(findobj(gcf,'tag','Colorbar'),'FontSize',FntSize,'XColor',AxColor,'YColor',AxColor);
1180 set(get(gca,'Title'),'FontSize',FntSize,'Color',AxColor)
1181 set(get(gca,'xLabel'),'FontSize',FntSize,'Color',AxColor)
1182 set(get(gca,'yLabel'),'FontSize',FntSize,'Color',AxColor)
1183 end
1184 case 'Mean Cross Section Contour'
1185
1186 hff = findobj('name','Mean Cross Section Contour');
1187 if ~isempty(hff) && ishandle(hff)
1188 figure(hff)
1189
1190
1191 set(gcf,'Color',BkgdColor);
1192 set(gca,'FontSize',FntSize)
1193 set(get(gca,'Title'),'FontSize',FntSize)
1194 set(gca,'Color',[0.3 0.3 0.3])
1195 set(gca,'XColor',AxColor)
1196 set(gca,'YColor',AxColor)
1197 set(gca,'ZColor',AxColor)
1198 set(findobj(gcf,'tag','Colorbar'),'FontSize',FntSize,'XColor',AxColor,'YColor',AxColor);
1199 set(get(gca,'Title'),'FontSize',FntSize,'Color',AxColor)
1200 set(get(gca,'xLabel'),'FontSize',FntSize,'Color',AxColor)
1201 set(get(gca,'yLabel'),'FontSize',FntSize,'Color',AxColor)
1202 set(findobj(gca,'tag','PlotBedElevation') ,'color' ,AxColor)
1203 set(findobj(gca,'tag','ReferenceVectorText'),'color' ,AxColor)
1204 end
1205 otherwise
1206 end
1207 end
1208
1209
1210 end
1211
1212
1213
1214
1215
1216 function load_prefs(hfigure)
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226 if ispref('VMT','cptplanview')
1227 cptplanview = getpref('VMT','cptplanview');
1228 if exist(cptplanview.path,'dir')
1229 guiprefs.cpt_path = cptplanview.path;
1230 else
1231 guiprefs.cpt_path = pwd;
1232 end
1233
1234 if exist(fullfile(cptplanview.path,cptplanview.file),'file')
1235 guiprefs.cpt_file = cptplanview.file;
1236 else
1237 guiprefs.cpt_file = [];
1238 end
1239
1240 else
1241 guiprefs.cpt_path = pwd;
1242 guiprefs.cpt_file = [];
1243
1244 cptplanview.path = pwd;
1245 cptplanview.file = [];
1246 setpref('VMT','cptplanview',cptplanview)
1247 end
1248
1249 if ispref('VMT','cptmcs')
1250 cptmcs = getpref('VMT','cptmcs');
1251 if exist(cptmcs.path,'dir')
1252 guiprefs.cpt_path = cptmcs.path;
1253 else
1254 guiprefs.cpt_path = pwd;
1255 end
1256
1257 if exist(fullfile(cptmcs.path,cptmcs.file),'file')
1258 guiprefs.cpt_file = cptmcs.file;
1259 else
1260 guiprefs.cpt_file = [];
1261 end
1262
1263 else
1264 guiprefs.cpt_path = pwd;
1265 guiprefs.cpt_file = [];
1266
1267 cptmcs.path = pwd;
1268 cptmcs.file = [];
1269 setpref('VMT','cptplanview',cptplanview)
1270 end
1271 if ispref('VMT','shoreline')
1272 shoreline = getpref('VMT','shoreline');
1273 if exist(shoreline.path,'dir')
1274 guiprefs.shoreline_path = shoreline.path;
1275 else
1276 guiprefs.shoreline_path = pwd;
1277 end
1278
1279 if exist(fullfile(shoreline.path,shoreline.file),'file')
1280 guiprefs.shoreline_file = shoreline.file;
1281 else
1282 guiprefs.shoreline_file = [];
1283 end
1284 end
1285 if ispref('VMT','aerial')
1286 aerial = getpref('VMT','aerial');
1287 if exist(aerial.path,'dir')
1288 guiprefs.aerial_path = aerial.path;
1289 else
1290 guiprefs.aerial_path = pwd;
1291 end
1292 if iscell(aerial.file)
1293 if exist(fullfile(aerial.path,aerial.file{1}),'file')
1294 guiprefs.aerial_file = aerial.file;
1295 else
1296 guiprefs.aerial_file = [];
1297 end
1298 else
1299 if exist(fullfile(aerial.path,aerial.file),'file')
1300 guiprefs.aerial_file = aerial.file;
1301 else
1302 guiprefs.aerial_file = [];
1303 end
1304 end
1305 end
1306
1307
1308
1309 setappdata(hfigure,'guiprefs',guiprefs)
1310
1311 function store_prefs(hfigure,pref)
1312
1313
1314
1315
1316
1317
1318
1319 guiprefs = getappdata(hfigure,'guiprefs');
1320
1321 switch pref
1322 case 'cptplanview'
1323 cptplanview.path = guiprefs.cpt_path;
1324 cptplanview.file = guiprefs.cpt_file;
1325 setpref('VMT','cptplanview',cptplanview)
1326 case 'cptmcs'
1327 cptmcs.path = guiprefs.cpt_path;
1328 cptmcs.file = guiprefs.cpt_file;
1329 setpref('VMT','cptmcs',cptmcs)
1330 otherwise
1331 end
1332
1333