# VMT_PlotXSContMultiPlot

## PURPOSE

Currently not implemented

## SYNOPSIS

function [z,A,V,zmin,zmax] = VMT_PlotXSContMultiPlot(z,A,V,var,exag)

## DESCRIPTION

     Currently not implemented
     Plots contours for the variable 'var' within the
     mean cross section given by the structure V. IF data is not supplied, user
     will be prompted to load data (browse to data).

     Multiplot allows the user to plot multiple cross sections on the same
     plot. P.R. Jackson, 6-28-10  (NOT WORKING YET)

     (adapted from code by J. Czuba)

     P.R. Jackson, USGS, 12-10-08

## CROSS-REFERENCE INFORMATION

This function calls:

- VMT_SelectFiles Prompts the user to select preprocessed transect files output by

This function is called by:

## SOURCE CODE

    0001 function [z,A,V,zmin,zmax] = VMT_PlotXSContMultiPlot(z,A,V,var,exag)
    0002 % Currently not implemented
    0003 % Plots contours for the variable 'var' within the
    0004 % mean cross section given by the structure V. IF data is not supplied, user
    0005 % will be prompted to load data (browse to data).
    0006 %
    0007 % Multiplot allows the user to plot multiple cross sections on the same
    0008 % plot. P.R. Jackson, 6-28-10  (NOT WORKING YET)
    0009 %
    0010 % (adapted from code by J. Czuba)
    0011 %
    0012 % P.R. Jackson, USGS, 12-10-08
    0013
    0014
    0015
    0016 disp(['Plotting Mean Cross Section Contour Plot: ' var])
    0017
    0018 %% User Input
    0019
    0020 %exag=50;    %Vertical exaggeration
    0021
    0022
    0023 %% Load the data if not supplied
    0024 if isempty(z) & isempty(A) & isempty(V)
    0025     [zPathName,zFileName,zf] = VMT_SelectFiles;  %Have the user select the preprocessed input files
    0026     eval(['load ' zPathName '\' zFileName{1}]);
    0027 end
    0028
    0029
    0030 %% Plot contours
    0031
    0032 clvls = 60;
    0033
    0034 %Find the direction of primary discharge (flip if necessary)
    0035 binwidth  = diff(V.mcsDist,1,2);
    0036 binwidth  = horzcat(binwidth(:,1), binwidth);
    0037 binheight = diff(V.mcsDepth,1,1);
    0038 binheight = vertcat(binheight, binheight(1,:));
    0039 flux = nansum(nansum(V.u./100.*binwidth.*binheight)); %Not a true measured discharge because of averaging, smoothing, etc. but close
    0040
    0041 % if zerosecq
    0042 %     pdmin = nanmin(nanmin(V.vp));
    0043 %     pdmax = nanmax(nanmax(V.vp));
    0044 % else
    0045 %     pdmin = nanmin(nanmin(V.u));
    0046 %     pdmax = nanmax(nanmax(V.u));
    0047 % end
    0048 if flux < 0; %abs(pdmin) > abs(pdmax)
    0049     flipxs = 1;
    0050 else
    0051     flipxs = 0;
    0052 end
    0053
    0054 if flipxs
    0055     disp(['Streamwise Flow Direction (Perp. to mean XS; deg) = ' num2str(V.phi - 180)])
    0056     disp(['Primary Flow Direction (deg) = ' num2str(V.phisp - 180)])
    0057 else
    0058     disp(['Streamwise Flow Direction (Perp. to mean XS; deg) = ' num2str(V.phi)])
    0059     disp(['Primary Flow Direction (deg) = ' num2str(V.phisp)])
    0060 end
    0061 disp(['Deviation from Streamwise Direction (deg) = ' num2str(V.alphasp)])
    0062
    0063 switch var
    0064     case{'streamwise'}  %Plots the streamwise velocity
    0065         if flipxs
    0066             wtp=['-V.uSmooth'];
    0067             zmin=floor(nanmin(nanmin(-V.uSmooth)));
    0068             zmax=ceil(nanmax(nanmax(-V.uSmooth)));
    0069         else
    0070             wtp=['V.uSmooth'];
    0071             zmin=floor(nanmin(nanmin(V.uSmooth)));
    0072             zmax=ceil(nanmax(nanmax(V.uSmooth)));
    0073         end
    0074         zinc = (zmax - zmin) / clvls;
    0075         zlevs = zmin:zinc:zmax;
    0076     case{'transverse'} %Plots the transverse velocity
    0077         wtp=['V.vSmooth'];
    0078         zmax=ceil(max(abs(nanmin(nanmin(V.vSmooth))),abs(nanmax(nanmax(V.vSmooth)))));
    0079         zmin=-zmax;
    0080         zinc = (zmax - zmin) / clvls;
    0081         zlevs = zmin:zinc:zmax;
    0082     case{'vertical'} %Plots the vertical velocity
    0083         wtp=['V.wSmooth'];
    0084         zmax=ceil(max(abs(nanmin(nanmin(V.wSmooth))),abs(nanmax(nanmax(V.wSmooth)))));
    0085         zmin=-zmax;
    0086         zinc = (zmax - zmin) / clvls;
    0087         zlevs = zmin:zinc:zmax;
    0088     case{'mag'} %Plots the velocity magnitude
    0089         wtp=['V.mcsMagSmooth'];
    0090         zmin=floor(nanmin(nanmin(V.mcsMagSmooth)));
    0091         zmax=ceil(nanmax(nanmax(V.mcsMagSmooth)));
    0092         zinc = (zmax - zmin) / clvls;
    0093         zlevs = zmin:zinc:zmax;
    0094     case{'primary_zsd'}  %Plots the primary velocity with zero secondary discharge definition
    0095         if flipxs
    0096             wtp=['-V.vpSmooth'];
    0097             zmin=floor(nanmin(nanmin(-V.vpSmooth)));
    0098             zmax=ceil(nanmax(nanmax(-V.vpSmooth)));
    0099         else
    0100             wtp=['V.vpSmooth'];
    0101             zmin=floor(nanmin(nanmin(V.vpSmooth)));
    0102             zmax=ceil(nanmax(nanmax(V.vpSmooth)));
    0103         end
    0104         zinc = (zmax - zmin) / clvls;
    0105         zlevs = zmin:zinc:zmax;
    0106     case{'secondary_zsd'} %Plots the secondary velocity with zero secondary discharge definition
    0107         wtp=['V.vsSmooth'];
    0108         zmax=ceil(max(abs(nanmin(nanmin(V.vsSmooth))),abs(nanmax(nanmax(V.vsSmooth)))));
    0109         zmin=-zmax;
    0110         zinc = (zmax - zmin) / clvls;
    0111         zlevs = zmin:zinc:zmax;
    0112     case{'primary_roz'}  %Plots the primary velocity with Rozovskii definition
    0113 %         wtp=['V.Roz.upSmooth'];
    0114 %         zmin=floor(nanmin(nanmin(V.Roz.upSmooth)));
    0115 %         zmax=ceil(nanmax(nanmax(V.Roz.upSmooth)));
    0116
    0117         if flipxs
    0118             wtp=['-V.Roz.upSmooth'];
    0119             zmin=floor(nanmin(nanmin(-V.Roz.upSmooth)));
    0120             zmax=ceil(nanmax(nanmax(-V.Roz.upSmooth)));
    0121         else
    0122             wtp=['V.Roz.upSmooth'];
    0123             zmin=floor(nanmin(nanmin(V.Roz.upSmooth)));
    0124             zmax=ceil(nanmax(nanmax(V.Roz.upSmooth)));
    0125         end
    0126         zinc = (zmax - zmin) / clvls;
    0127         zlevs = zmin:zinc:zmax;
    0128     case{'secondary_roz'} %Plots the secondary velocity with Rozovskii definition
    0129         wtp=['V.Roz.usSmooth'];
    0130         zmax=ceil(max(abs(nanmin(nanmin(V.Roz.usSmooth))),abs(nanmax(nanmax(V.Roz.usSmooth)))));
    0131         zmin=-zmax;
    0132         zinc = (zmax - zmin) / clvls;
    0133         zlevs = zmin:zinc:zmax;
    0134     case{'primary_roz_x'}  %Plots the primary velocity with Rozovskii definition (downstream component)
    0135 %         wtp=['V.Roz.upxSmooth'];
    0136 %         zmin=floor(nanmin(nanmin(V.Roz.upxSmooth)));
    0137 %         zmax=ceil(nanmax(nanmax(V.Roz.upxSmooth)));
    0138
    0139         if flipxs
    0140             wtp=['-V.Roz.upxSmooth'];
    0141             zmin=floor(nanmin(nanmin(-V.Roz.upxSmooth)));
    0142             zmax=ceil(nanmax(nanmax(-V.Roz.upxSmooth)));
    0143         else
    0144             wtp=['V.Roz.upxSmooth'];
    0145             zmin=floor(nanmin(nanmin(V.Roz.upxSmooth)));
    0146             zmax=ceil(nanmax(nanmax(V.Roz.upxSmooth)));
    0147         end
    0148         zinc = (zmax - zmin) / clvls;
    0149         zlevs = zmin:zinc:zmax;
    0150     case{'primary_roz_y'}  %Plots the primary velocity with Rozovskii definition (cross-stream component)
    0151         wtp=['V.Roz.upySmooth'];
    0152         zmin=floor(nanmin(nanmin(V.Roz.upySmooth)));
    0153         zmax=ceil(nanmax(nanmax(V.Roz.upySmooth)));
    0154
    0155 %         if flipxs
    0156 %             wtp=['-V.Roz.upySmooth'];
    0157 %             zmin=floor(nanmin(nanmin(-V.Roz.upySmooth)));
    0158 %             zmax=ceil(nanmax(nanmax(-V.Roz.upySmooth)));
    0159 %         else
    0160 %             wtp=['V.Roz.upySmooth'];
    0161 %             zmin=floor(nanmin(nanmin(V.Roz.upySmooth)));
    0162 %             zmax=ceil(nanmax(nanmax(V.Roz.upySmooth)));
    0163 %         end
    0164         zinc = (zmax - zmin) / clvls;
    0165         zlevs = zmin:zinc:zmax;
    0166     case{'secondary_roz_x'} %Plots the secondary velocity with Rozovskii definition (downstream component)
    0167         wtp=['V.Roz.usxSmooth'];
    0168         zmax=ceil(max(abs(nanmin(nanmin(V.Roz.usxSmooth))),abs(nanmax(nanmax(V.Roz.usxSmooth)))));
    0169         zmin=-zmax;
    0170         zinc = (zmax - zmin) / clvls;
    0171         zlevs = zmin:zinc:zmax;
    0172     case{'secondary_roz_y'} %Plots the secondary velocity with Rozovskii definition (cross-stream component)
    0173         wtp=['V.Roz.usySmooth'];
    0174         zmax=ceil(max(abs(nanmin(nanmin(V.Roz.usySmooth))),abs(nanmax(nanmax(V.Roz.usySmooth)))));
    0175         zmin=-zmax;
    0176         zinc = (zmax - zmin) / clvls;
    0177         zlevs = zmin:zinc:zmax;
    0178     case{'backscatter'} %Plots the backscatter
    0179         wtp=['V.mcsBackSmooth'];
    0180         zmin=floor(nanmin(nanmin(V.mcsBackSmooth)));
    0181         zmax=ceil(nanmax(nanmax(V.mcsBackSmooth)));
    0182         zinc = (zmax - zmin) / clvls;
    0183         zlevs = zmin:zinc:zmax;
    0184     case{'flowangle'} %Plots the flow angle (ROZ)
    0185         wtp=['V.Roz.theta_degSmooth'];
    0186         zmin=floor(nanmin(nanmin(V.Roz.theta_degSmooth)));
    0187         zmax=ceil(nanmax(nanmax(V.Roz.theta_degSmooth)));
    0188         zinc = (zmax - zmin) / clvls;
    0189         zlevs = zmin:zinc:zmax;
    0190
    0191 %     case{'dirdevp'} %Plots the directional deviation from the primary velocity
    0192 %         wtp=['V.mcsDirDevp'];
    0193 %         %zmax=ceil(max(abs(nanmin(nanmin(V.mcsDirDevp))),abs(nanmax(nanmax(V.mcsDirDevp)))));
    0194 %         %zmin=-zmax;
    0195 %         zmin=floor(nanmin(nanmin(V.mcsDirDevp)));
    0196 %         zmax=ceil(nanmax(nanmax(V.mcsDirDevp)));
    0197 %         zinc = (zmax - zmin) / clvls;
    0198 %         zlevs = zmin:zinc:zmax;
    0199 end
    0200
    0201
    0202 figure(3); clf
    0203 contour(V.mcsDist,V.mcsDepth,eval(wtp(1,:)),zlevs,'Fill','on','Linestyle','none'); hold on
    0204 plot(V.mcsDist(1,:),V.mcsBed,'w', 'LineWidth',2); hold on
    0205
    0206 switch var
    0207     case{'streamwise'}
    0208         title('Streamwise Velocity (cm/s)')
    0209     case{'transverse'}
    0210         title('Transverse Velocity (cm/s)')
    0211     case{'vertical'}
    0212         title('Vertical Velocity (cm/s)')
    0213     case{'mag'}
    0214         title('Velocity Magnitude (Streamwise and Transverse) (cm/s)')
    0215     case{'primary_zsd'}
    0216         title('Primary Velocity (Zero Secondary Discharge Definition) (cm/s)')
    0217     case{'secondary_zsd'}
    0218         title('Secondary Velocity (Zero Secondary Discharge Definition) (cm/s)')
    0219     case{'primary_roz'}
    0220         title('Primary Velocity (Rozovskii Definition) (cm/s)')
    0221     case{'secondary_roz'}
    0222         title('Secondary Velocity (Rozovskii Definition) (cm/s)')
    0223     case{'primary_roz_x'}
    0224         title('Primary Velocity (Rozovskii Definition; Downstream Component) (cm/s)')
    0225     case{'primary_roz_y'}
    0226         title('Primary Velocity (Rozovskii Definition; Cross-Stream Component) (cm/s)')
    0227     case{'secondary_roz_x'}
    0228         title('Secondary Velocity (Rozovskii Definition; Downstream Component) (cm/s)')
    0229     case{'secondary_roz_y'}
    0230         title('Secondary Velocity (Rozovskii Definition; Cross-Stream Component) (cm/s)')
    0231     case{'backscatter'}
    0232         title('Backscatter Intensity (dB)')
    0233     case{'flowangle'}
    0234         title('Flow Angle (deg)')
    0235 %     case{'dirdevp'}
    0236 %         title('Deviation from Primary Flow Direction (deg)')
    0237 end
    0238 hdl = colorbar; hold all
    0239 caxis([zmin zmax])
    0240 xlim([nanmin(nanmin(V.mcsDist)) nanmax(nanmax(V.mcsDist))])
    0241 ylim([0 max(V.mcsBed)])
    0242 set(gca,'YDir','reverse')
    0243 if flipxs
    0244     set(gca,'XDir','reverse')
    0245 end
    0246 ylabel('Depth (m)','Color','w')
    0247 xlabel('Distance (m)','Color','w')
    0248 set(gca,'DataAspectRatio',[exag 1 1],'PlotBoxAspectRatio',[exag 1 1])
    0249 %set(gcf,'Color','k');
    0250 set(gca,'FontSize',14)
    0251 set(get(gca,'Title'),'FontSize',14,'Color','w')
    0252 %set(gca,'Color','k')
    0253 set(gca,'XColor','w')
    0254 set(gca,'YColor','w')
    0255 set(gca,'ZColor','w')
    0256 set(gcf,'InvertHardCopy','off')
    0257 set(gcf,'Color',[0.2 0.2 0.2])
    0258 set(gca,'Color',[0.3 0.3 0.3])
    0259
    0260
    0261