from High Speed PIV and Hotwire post processing by Anurag
High Speed PIV and hotwire post processing routines

[]=plotcores(frame, n, flag )
 function []=plotcores(frame, n, flag )
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                                                                                                  %%
%%   Copyright (C) 2005-2007  Anurag Singh                                                          %%
%%                                                                                                  %%
%%       This program/code snippet/file (hence forth refered as "library")                          %%
%%       is free software; you can redistribute it and/or                                           %%
%%       modify it under the terms of the GNU Lesser General Public                                 %%
%%       License as published by the Free Software Foundation; either                               %%
%%       version 2.1 of the License, or (at your option) any later version.                         %%
%%                                                                                                  %%
%%       This library is distributed in the hope that it will be useful,                            %%
%%       but WITHOUT ANY WARRANTY; without even the implied warranty of                             %%
%%       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                          %%
%%       Lesser General Public License for more details.                                            %%
%%                                                                                                  %%
%%       You should have received a copy of the GNU Lesser General Public                           %%
%%       License along with this library; if not, write to the Free Software                        %%
%%       Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                  %%
%%                                                                                                  %%
%%   FILENAME:                                                                                      %%
%%      plot_cores.m                                                                                %%
%%                                                                                                  %%
%%   AUTHOR:                                                                                        %%
%%                                                                                                  %%
%%      Anurag Singh,                                                                               %%
%%      MS, 2007                                                                                    %%
%%      Aerospace Engineering & Mechanics                                                           %%
%%      University of Minnesota - Twin Cities.                                                      %%
%%      Minneapolis, MN 55455 (USA)                                                                 %%
%%                                                                                                  %%
%%      (currently working at: Exa Corporation, Burlington, MA 01803)                               %%
%%                                                                                                  %%
%%   CONTACT/EMAIL:                                                                                 %%
%%                                                                                                  %%
%%      anurag@aem.umn.edu                                                                          %%
%%      anurag9@gmail.com                                                                           %%
%%                                                                                                  %%
%%   SOURCE CONTROL INFORMATION:                                                                    %%
%%      None (since I was planning on putting it under source control since it has                  %%
%%      reached the critical file system size. Would be a good thing to put it under                %%
%%      source control while making changes.                                                        %%
%%                                                                                                  %%
%%   DESCRIPTION:                                                                                   %%
%%                                                                                                  %%
%%      Need to add.                                                                                %%
%%                                                                                                  %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


 % The routine assumes the requested frame core identification has been done and it is currently stored
 % in the variables idfrm etc.
 
 global x y swfrm1 vecimfreq u_tau nu idfrm pidfrm nidfrm u_norm v piv_ustd circ cores swcores vortcores
 
 switch flag
 
 case 1
    figure;
    pcolor(x*u_tau/nu, y*u_tau/nu, squeeze(u_norm(frame,:,:))); % the squeeze is to squeeze down a 3d matrix (where one of the dimensions is one) to a 2d matrix
    caxis([-3*piv_ustd 3*piv_ustd]) % i am setting the colorbar based on the rms of the signal
    cb = colorbar('vert'); % display the colorbar
    shading interp; % interpolated shading
    lighting phong; % nice spline fit to the shading

    hold on;

    zdispim = swfrm1.*((pidfrm > 0) + (nidfrm > 0));
    %climit = mean(std(abs(zdispim)));
    %contour(x*u_tau/nu,y*u_tau/nu,zdispim, 21);
    quiver(x*u_tau/nu, y*u_tau/nu, squeeze(u_norm(frame,:,:)), squeeze(v(frame,:,:)),1.5,'k');

    zdispim = squeeze(u_norm(frame,:,:));
    zdispim = zdispim .* swcores ;
    [hc h] = contour(x*u_tau/nu,y*u_tau/nu,500*zdispim, 2);
    set(h,'Linewidth',2);
    
    %caxis([-n*climit n*climit]) % i am setting the colorbar based on the rms of the signal
    %cb = colorbar('vert'); % display the colorbar
    %shading interp; % interpolated shading
    %lighting phong; % nice spline fit to the shading

    title(['Image frame # ',num2str(frame),'at time ', num2str(frame/vecimfreq, '%.5f'), ' s'])
    xlabel('x^{+}');
    ylabel('y^{+}');
    daspect([1 1 1]); % set aspect ratio to one (equal x and y scale)
    
    hold off;

 case 2
    % plot the identified regions into a new window
    figure;
    contour(x*u_tau/nu,y*u_tau/nu, 10*(pidfrm > 0), 1);
    caxis([-10 10]) % i am setting the colorbar based on the rms of the signal
    hold on;
    contour(x*u_tau/nu,y*u_tau/nu,-10*(nidfrm > 0), 1);


 case 3

    %% plot the identified regions into a new window
    figure;
    temp = mean(std(abs(vortcores)));
    [hc h] = contour(x*u_tau/nu,y*u_tau/nu, 10*vortcores, 2);
    %caxis([-3*temp 3*temp]) % i am setting the colorbar based on the rms of the signal
    set(h,'Linewidth',2);
    caxis([-10 10]) % i am setting the colorbar based on the rms of the signal
    title(['Identified cores based on vorticity alone, frame # ',num2str(frame)]);
 case 4
    % plot the identified regions into a new window
    figure;
    [hc h] = contour(x*u_tau/nu,y*u_tau/nu, 10*swcores,1);
    set(h,'Linewidth',2);
    caxis([-10 10]) % i am setting the colorbar based on the rms of the signal
    title(['Identified cores based on swirl alone, frame # ',num2str(frame)]);

 case 5
    % plot the identified regions into a new window
    figure;
    [hc h] = contour(x*u_tau/nu,y*u_tau/nu, 10*cores, 2);
    %caxis([-10 10]) % i am setting the colorbar based on the rms of the signal
    set(h,'Linewidth',2);
    caxis([-10 10]) % i am setting the colorbar based on the rms of the signal
    title(['Identified cores based on swirl and vorticity together, frame # ',num2str(frame)]);

 end


   %title(['Identified Cores, Image frame # ',num2str(frame)])
   xlabel('x^{+} ->');
   ylabel('y^{+} ->');

Contact us at files@mathworks.com