0001 function [z,A,V,log_text] = VMT_PlotXSContQuiver(z,A,V,var,sf,exag,qspchorz,qspcvert,secvecvar,vvelcomp,plot_english,varargin)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 if exist('plot_english') == 0
0016 plot_english = 0;
0017 disp('No units specified, plotting in metric units by default')
0018 end
0019
0020 AS = 1;
0021 if AS == 0
0022 MANrefvel = 25;
0023 end
0024
0025
0026
0027 if any(size(varargin)>0)
0028 reference_velocity = varargin{1};
0029 distance = varargin{2};
0030 depth = varargin{3};
0031 else
0032 reference_velocity = [];
0033 distance = [];
0034 depth = [];
0035 end
0036
0037
0038 if isempty(z) & isempty(A) & isempty(V)
0039 [z,A,V,zmin,zmax,cont_log_text,fig_contour_handle] = VMT_PlotXSCont([],[],[],var,exag,plot_english);
0040 else
0041 [z,A,V,zmin,zmax,cont_log_text,fig_contour_handle] = VMT_PlotXSCont(z,A,V,var,exag,plot_english);
0042 end
0043 log_text = cont_log_text;
0044
0045
0046
0047
0048
0049
0050
0051
0052 if plot_english
0053 sf = sf/0.01;
0054 end
0055
0056
0057
0058 clvls = 60;
0059
0060
0061
0062
0063
0064 if 0
0065 [I,J] = ind2sub(size(V.vp(2,:)),find(~isnan(V.vp(2,:))==1));
0066 et = J(1):qspchorz:J(end);
0067 [r c]=size(V.vp);
0068 bi = 1:2:r;
0069 else
0070 [I,J] = ind2sub(size(V.vp(1,:)),find(~isnan(V.vp(1,:))==1));
0071 et = J(1):qspchorz:J(end);
0072 [r c]=size(V.vp);
0073 bi = 1:qspcvert:r;
0074 end
0075
0076
0077
0078
0079
0080
0081
0082 if vvelcomp
0083 vertcomp = V.wSmooth;
0084 else
0085 vertcomp = zeros(size(V.wSmooth));
0086 end
0087
0088 figure(fig_contour_handle); hold all
0089
0090 switch secvecvar
0091 case{'transverse'}
0092 vr = sqrt(abs((-sf.*V.vSmooth(bi,et)).^2 + (-sf./exag.*vertcomp(bi,et)).^2));
0093 case{'secondary_zsd'}
0094 vr = sqrt(abs((-sf.*V.vsSmooth(bi,et)).^2 + (-sf./exag.*vertcomp(bi,et)).^2));
0095 case{'secondary_roz'}
0096 vr = sqrt(abs((-sf.*V.Roz.usSmooth(bi,et)).^2 + (-sf./exag.*vertcomp(bi,et)).^2));
0097 case{'secondary_roz_y'}
0098 vr = sqrt(abs((-sf.*V.Roz.usySmooth(bi,et)).^2 + (-sf./exag.*vertcomp(bi,et)).^2));
0099 case{'primary_roz_y'}
0100 vr = sqrt(abs((-sf.*V.Roz.upySmooth(bi,et)).^2 + (-sf./exag.*vertcomp(bi,et)).^2));
0101 end
0102
0103
0104 [rw cl] = size(V.mcsDist(bi,et));
0105 toquiv(:,1) = reshape(V.mcsDist(bi,et),rw*cl,1);
0106 toquiv(:,2) = reshape(V.mcsDepth(bi,et),rw*cl,1);
0107 switch secvecvar
0108 case{'transverse'}
0109 toquiv(:,3) = reshape(-sf.*V.vSmooth(bi,et),rw*cl,1);
0110 refvel = ceil(max(max(abs(V.vSmooth(bi,et)))));
0111
0112 case{'secondary_zsd'}
0113 toquiv(:,3) = reshape(-sf.*V.vsSmooth(bi,et),rw*cl,1);
0114 refvel = ceil(max(max(abs(V.vsSmooth(bi,et)))));
0115
0116 case{'secondary_roz'}
0117 toquiv(:,3) = reshape(-sf.*V.Roz.usSmooth(bi,et),rw*cl,1);
0118 refvel = ceil(max(max(abs(V.Roz.usSmooth(bi,et)))));
0119
0120 case{'secondary_roz_y'}
0121 toquiv(:,3) = reshape(-sf.*V.Roz.usySmooth(bi,et),rw*cl,1);
0122 refvel = ceil(max(max(abs(V.Roz.usySmooth(bi,et)))));
0123
0124 case{'primary_roz_y'}
0125 toquiv(:,3) = reshape(-sf.*V.Roz.upySmooth(bi,et),rw*cl,1);
0126 refvel = ceil(max(max(abs(V.Roz.upySmooth(bi,et)))));
0127
0128 end
0129 toquiv(:,4) = reshape(-sf./exag.*vertcomp(bi,et),rw*cl,1);
0130 toquiv(:,5) = reshape(vr,rw*cl,1);
0131
0132
0133 if isempty(distance)
0134 x1 = 0.06*max(max(V.mcsDist));
0135 x2 = 0.95*max(max(V.mcsBed));
0136 if AS == 0
0137 refvel = MANrefvel;
0138 end
0139 else
0140 x1 = distance;
0141 x2 = depth;
0142 refvel = reference_velocity;
0143 end
0144 x3=sf.*refvel;
0145 x4=0;
0146 x5=x3;
0147 toquiv(end+1,1) = x1;
0148 toquiv(end,2) = x2;
0149 toquiv(end,3) = x3;
0150 toquiv(end,4) = x4;
0151 toquiv(end,5) = x5;
0152
0153
0154 if plot_english
0155 unitlabel = '(ft/s)';
0156 else
0157 unitlabel = '(cm/s)';
0158 end
0159
0160 if plot_english
0161 convfact = 0.03281;
0162 switch var
0163 case{'backscatter'}
0164 convfact = 1.0;
0165 case{'flowangle'}
0166 convfact = 1.0;
0167 end
0168
0169 hh = quiverc2wcmap(toquiv(:,1)*3.281,toquiv(:,2)*3.281,toquiv(:,3)*0.03281,toquiv(:,4)*0.03281,0,toquiv(:,5)*0.03281,exag);
0170
0171 ylim([0 max(V.mcsBed*3.281)])
0172 caxis([zmin*convfact zmax*convfact])
0173 switch var
0174 case{'streamwise'}
0175 title_handle = title({['Streamwise Velocity ' unitlabel];['with secondary flow vectors (' secvecvar ')']},'Interpreter','none');
0176 case{'transverse'}
0177 title_handle = title({['Transverse Velocity ' unitlabel];['with secondary flow vectors (' secvecvar ')']},'Interpreter','none');
0178 case{'vertical'}
0179 title_handle = title({['Vertical Velocity ' unitlabel];['with secondary flow vectors (' secvecvar ')']},'Interpreter','none');
0180 case{'mag'}
0181 title_handle = title({['Velocity Magnitude (Streamwise and Transverse) ' unitlabel];['with secondary flow vectors (' secvecvar ')']},'Interpreter','none');
0182 case{'east'}
0183 title_handle = title({'East Velocity';['with secondary flow vectors (' secvecvar ')']},'Interpreter','none');
0184 case{'north'}
0185 title_handle = title({'North Velocity';['with secondary flow vectors (' secvecvar ')']},'Interpreter','none');
0186 case{'primary_zsd'}
0187 title_handle = title({['Primary Velocity (Zero Secondary Discharge Definition) ' unitlabel];['with secondary flow vectors (' secvecvar ')']},'Interpreter','none');
0188 case{'secondary_zsd'}
0189 title_handle = title({['Secondary Velocity (Zero Secondary Discharge Definition) ' unitlabel];['with secondary flow vectors (' secvecvar ')']},'Interpreter','none');
0190 case{'primary_roz'}
0191 title_handle = title({['Primary Velocity (Rozovskii Definition) ' unitlabel];['with secondary flow vectors (' secvecvar ')']},'Interpreter','none');
0192 case{'secondary_roz'}
0193 title_handle = title({['Secondary Velocity (Rozovskii Definition) ' unitlabel];['with secondary flow vectors (' secvecvar ')']},'Interpreter','none');
0194 case{'primary_roz_x'}
0195 title_handle = title({['Primary Velocity (Rozovskii Definition; Downstream Component) ' unitlabel];['with secondary flow vectors (' secvecvar ')']},'Interpreter','none');
0196 case{'primary_roz_y'}
0197 title_handle = title({['Primary Velocity (Rozovskii Definition; Cross-Stream Component) ' unitlabel];['with secondary flow vectors (' secvecvar ')']},'Interpreter','none');
0198 case{'secondary_roz_x'}
0199 title_handle = title({['Secondary Velocity (Rozovskii Definition; Downstream Component) ' unitlabel];['with secondary flow vectors (' secvecvar ')']},'Interpreter','none');
0200 case{'secondary_roz_y'}
0201 title_handle = title({['Secondary Velocity (Rozovskii Definition; Cross-Stream Component) ' unitlabel];['with secondary flow vectors (' secvecvar ')']},'Interpreter','none');
0202 case{'backscatter'}
0203 title({'Backscatter Intensity (dB)';['with secondary flow vectors (' secvecvar ')']},'Interpreter','none');
0204 case{'flowangle'}
0205 title_handle = title({'Flow Direction (deg)';['with secondary flow vectors (' secvecvar ')']},'Interpreter','none');
0206 end
0207
0208 ylabel_handle = ylabel('Depth (ft)');
0209 xlabel_handle = xlabel('Distance (ft)');
0210 ref_vector_text_handle = text(x1*3.281, x2*3.281+.5,[num2str(refvel*0.03281,3) ' ft/s'],'FontSize',12,'Color','w');
0211 else
0212 hh = quiverc2wcmap(toquiv(:,1),toquiv(:,2),toquiv(:,3),toquiv(:,4),0,toquiv(:,5),exag);
0213
0214 ylim([0 max(V.mcsBed)])
0215
0216 if strcmp(var,'vorticity_vw')||strcmp(var,'vorticity_zsd')||strcmp(var,'vorticity_roz')
0217 rng = zmax - zmin;
0218 caxis([-rng/2 rng/2])
0219 else
0220 caxis([zmin zmax])
0221 end
0222 switch var
0223 case{'streamwise'}
0224 title_handle = title({'Streamwise Velocity (cm/s)';['with secondary flow vectors (' secvecvar ')']},'Interpreter','none');
0225 case{'transverse'}
0226 title_handle = title({'Transverse Velocity (cm/s)';['with secondary flow vectors (' secvecvar ')']},'Interpreter','none');
0227 case{'vertical'}
0228 title_handle = title({'Vertical Velocity (cm/s)';['with secondary flow vectors (' secvecvar ')']},'Interpreter','none');
0229 case{'mag'}
0230 title_handle = title({'Velocity Magnitude (Streamwise and Transverse) (cm/s)';['with secondary flow vectors (' secvecvar ')']},'Interpreter','none');
0231 case{'east'}
0232 title_handle = title({'East Velocity (cm/s)';['with secondary flow vectors (' secvecvar ')']},'Interpreter','none');
0233 case{'north'}
0234 title_handle = title({'North Velocity (cm/s)';['with secondary flow vectors (' secvecvar ')']},'Interpreter','none');
0235 case{'primary_zsd'}
0236 title_handle = title({'Primary Velocity (Zero Secondary Discharge Definition) (cm/s)';['with secondary flow vectors (' secvecvar ')']},'Interpreter','none');
0237 case{'secondary_zsd'}
0238 title_handle = title({'Secondary Velocity (Zero Secondary Discharge Definition) (cm/s)';['with secondary flow vectors (' secvecvar ')']},'Interpreter','none');
0239 case{'primary_roz'}
0240 title_handle = title({'Primary Velocity (Rozovskii Definition) (cm/s)';['with secondary flow vectors (' secvecvar ')']},'Interpreter','none');
0241 case{'secondary_roz'}
0242 title_handle = title({'Secondary Velocity (Rozovskii Definition) (cm/s)';['with secondary flow vectors (' secvecvar ')']},'Interpreter','none');
0243 case{'primary_roz_x'}
0244 title_handle = title({'Primary Velocity (Rozovskii Definition; Downstream Component) (cm/s)';['with secondary flow vectors (' secvecvar ')']},'Interpreter','none');
0245 case{'primary_roz_y'}
0246 title_handle = title({'Primary Velocity (Rozovskii Definition; Cross-Stream Component) (cm/s)';['with secondary flow vectors (' secvecvar ')']},'Interpreter','none');
0247 case{'secondary_roz_x'}
0248 title_handle = title({'Secondary Velocity (Rozovskii Definition; Downstream Component) (cm/s)';['with secondary flow vectors (' secvecvar ')']},'Interpreter','none');
0249 case{'secondary_roz_y'}
0250 title_handle = title({'Secondary Velocity (Rozovskii Definition; Cross-Stream Component) (cm/s)';['with secondary flow vectors (' secvecvar ')']},'Interpreter','none');
0251 case{'backscatter'}
0252 title_handle = title({'Backscatter Intensity (dB)';['with secondary flow vectors (' secvecvar ')']},'Interpreter','none');
0253 case{'flowangle'}
0254 title_handle = title({'Flow Direction (deg)';['with secondary flow vectors (' secvecvar ')']},'Interpreter','none');
0255 case{'vorticity_vw'}
0256 title_handle = title({'Streamwise Vorticity';['with secondary flow vectors (' secvecvar ')']},'Interpreter','none');
0257 case{'vorticity_zsd'}
0258 title_handle = title({'Streamwise Vorticity (Zero Secondary Discharge Definition)';['with secondary flow vectors (' secvecvar ')']},'Interpreter','none');
0259 case{'vorticity_roz'}
0260 title_handle = title({'Streamwise Vorticity (Rozovskii Definition)';['with secondary flow vectors (' secvecvar ')']},'Interpreter','none');
0261 end
0262
0263 ylabel_handle = ylabel('Depth (m)');
0264 xlabel_handle = xlabel('Distance (m)');
0265 ref_vector_text_handle = text(x1, x2+.16,[num2str(refvel) ' cm/s'],'FontSize',12,'Color','w');
0266 end
0267
0268
0269 secondary_vector_handles = findobj(gcf,'Type','line','-not','tag','PlotBedElevation');
0270 set(secondary_vector_handles, 'Tag','SecondaryVectors')
0271 set(ref_vector_text_handle, 'Tag','ReferenceVectorText')
0272 set(title_handle, 'Tag','ContourPlotTitle')
0273 set(ylabel_handle, 'Tag','yLabelText')
0274 set(xlabel_handle, 'Tag','xLabelText')
0275
0276
0277 set(gca,...
0278 'DataAspectRatio', [exag 1 1],...
0279 'PlotBoxAspectRatio',[exag 1 1]...
0280 ...
0281 )
0282
0283
0284
0285
0286
0287
0288
0289
0290
0291
0292
0293 if 1
0294 VectorLineWidth = 1.0;
0295 set(secondary_vector_handles ,'LineWidth',VectorLineWidth)
0296 end
0297
0298
0299
0300
0301
0302
0303
0304 spratio_zsd = nanmedian(nanmedian(abs(V.vs)))./nanmedian(nanmedian(abs(V.vp)));
0305 spratio_roz = nanmedian(nanmedian(abs(V.Roz.usy)))./nanmedian(nanmedian(abs(V.Roz.up)));
0306
0307
0308 log_text = vertcat(log_text,...
0309 {[' Ratio of median Secondary to median Primary Velocity (zsd) = ' num2str(spratio_zsd)];...
0310 [' Ratio of median Secondary to median Primary Velocity (roz) = ' num2str(spratio_roz)]}...
0311 );
0312
0313 return
0314
0315
0316
0317
0318
0319