Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Moment_of_Correlation_2DPIV_uncertainty/postprocess_codes/run_MC_uncertainty_analysis.m
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
189 lines (162 sloc)
6.65 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% function run_MC_uncertainty_analysis | |
clear; | |
%flags | |
printfig=0; | |
runCS=1; | |
runIM=1; | |
runMC=1; | |
savemat=0; | |
loadmat=1; | |
savematplot=0; | |
runplotMC=1; | |
if ispc | |
addpath Z:\Planar_Uncertainty_work\codes\export_fig_new\altmany-export_fig-5be2ca4\; | |
addpath Z:\Planar_Uncertainty_work\codes\color_code\; | |
else | |
addpath /home/shannon/a/bhattac3/Planar_Uncertainty_work/codes/export_fig_new/; | |
addpath /home/shannon/a/bhattac3/Planar_Uncertainty_work/codes/color_code/; | |
end | |
if ispc | |
basedirname='Z:\Planar_Uncertainty_work\'; | |
else | |
basedirname='/home/shannon/a/bhattac3/Planar_Uncertainty_work/'; | |
end | |
%cases | |
casename_org={'PivChal03B','PivChal05B','stagnation_flow','Vortex_Ring','Jetdata'}; | |
% casename={'PivChal03B','','','',''}; | |
% casename={'','PivChal05B','','',''}; | |
% casename={'','','stagnation_flow','',''}; | |
% casename={'','','','Vortex_Ring',''}; | |
% casename={'','','','','Jetdata'}; | |
% runname='10_14_2015_deform_whittaker_blackman'; | |
% runname='10_22_2015_different_processing_windows'; | |
% runname='03_09_2017/WS32'; | |
% runname='03_09_2017\WS32'; | |
% runname=['03_21_2017',filesep,'WS32']; | |
% % runname=['03_21_2017',filesep,'WS64']; | |
% runname=['07_31_2018',filesep,'WS64']; | |
runname=['07_31_2018',filesep,'WS32']; | |
%% | |
%Get directories | |
% [inputdir,outputdir]=in_out_directory_set(basedirname,runname); | |
% [inputdir,outputdir]=in_out_directory_set_10_22_2015(basedirname,runname); | |
% [inputdir,outputdir]=in_out_directory_set_03_09_2017(basedirname,runname); | |
% [inputdir,outputdir]=in_out_directory_set_03_09_2017_ws64(basedirname,runname); | |
% [inputdir,outputdir]=in_out_directory_set_07_30_2018_ws1(basedirname,runname); | |
[inputdir,outputdir]=in_out_directory_set_07_30_2018_ws2(basedirname,runname); | |
%% | |
casename1={'PivChal03B','PivChal05B','stagnation_flow','Vortex_Ring','Jetdata'}; | |
% casename1={'','','','','Jetdata'}; | |
% Compute error and uncertainty estimates for each case | |
% compute_error_uncertainty(casename1,inputdir,outputdir,savemat); | |
% keyboard; | |
%% | |
if runplotMC==1 | |
casename={'PivChal03B','','','',''}; | |
if loadmat==1 | |
A1=load(fullfile(outputdir{1},'PivChal03B.mat')); | |
end | |
[covxMC,covyMC,covxIM,covyIM,covxCS,covyCS,covP,covD]=plot_MC_uncertainty(A1,casename,outputdir,savematplot,printfig,runCS,runIM,runMC); | |
covg1=[covxMC,covyMC,covxIM,covyIM,covxCS,covyCS,covP,covD]; | |
casename={'','PivChal05B','','',''}; | |
if loadmat==1 | |
A2=load(fullfile(outputdir{1},'PivChal05B.mat')); | |
end | |
[covxMC,covyMC,covxIM,covyIM,covxCS,covyCS,covP,covD]=plot_MC_uncertainty(A2,casename,outputdir,savematplot,printfig,runCS,runIM,runMC); | |
covg2=[covxMC,covyMC,covxIM,covyIM,covxCS,covyCS,covP,covD]; | |
casename={'','','stagnation_flow','',''}; | |
if loadmat==1 | |
A3=load(fullfile(outputdir{1},'stagnation_flow.mat')); | |
end | |
[covxMC,covyMC,covxIM,covyIM,covxCS,covyCS,covP,covD]=plot_MC_uncertainty(A3,casename,outputdir,savematplot,printfig,runCS,runIM,runMC); | |
covg3=[covxMC,covyMC,covxIM,covyIM,covxCS,covyCS,covP,covD]; | |
casename={'','','','Vortex_Ring',''}; | |
if loadmat==1 | |
A4=load(fullfile(outputdir{1},'Vortex_Ring.mat')); | |
end | |
[covxMC,covyMC,covxIM,covyIM,covxCS,covyCS,covP,covD]=plot_MC_uncertainty(A4,casename,outputdir,savematplot,printfig,runCS,runIM,runMC); | |
covg4=[covxMC,covyMC,covxIM,covyIM,covxCS,covyCS,covP,covD]; | |
% | |
casename={'','','','','Jetdata'}; | |
if loadmat==1 | |
A5=load(fullfile(outputdir{1},'Jetdata.mat')); | |
end | |
[covxMC,covyMC,covxIM,covyIM,covxCS,covyCS,covP,covD]=plot_MC_uncertainty(A5,casename,outputdir,savematplot,printfig,runCS,runIM,runMC); | |
covg5=[covxMC,covyMC,covxIM,covyIM,covxCS,covyCS,covP,covD]; | |
close all; | |
end | |
% keyboard; | |
%% | |
% save([outputdir{1},filesep,'Coverage_03_18_2018_lowcutoff.mat'],'covg1','covg2','covg3','covg4','covg5'); | |
% save([outputdir{1},filesep,'Coverage_07_30_2018_lowcutoff.mat'],'covg1','covg2','covg3','covg4','covg5'); | |
%% Gradient analysis | |
% % clc; | |
% % outputdir1=fullfile(basedirname,'Results','final_plots',runname,'SOC_gradient','matfiles'); | |
% % outputdir2=fullfile(basedirname,'Results','final_plots',runname,'New_gradient','matfiles'); | |
% % % casename={'PivChal03B','','','',''}; | |
% % for i=1:5 | |
% % casename=casename_org{i}; | |
% % if loadmat==1 | |
% % A1=load(fullfile(outputdir1,[casename,'.mat'])); | |
% % B1=load(fullfile(outputdir2,[casename,'.mat'])); | |
% % end | |
% % | |
% % diffx=A1.UMCx(:)-B1.UMCx(:); | |
% % diffy=A1.UMCy(:)-B1.UMCy(:); | |
% % lnx=find(abs(diffx)>=0.01); | |
% % lny=find(abs(diffy)>=0.01); | |
% % | |
% % fprintf([casename,' \n ']); | |
% % fprintf('Difference in UMCx UMCy between SOCdiff and Richdiff: \n %d %d \n',[length(lnx),length(lny)]); | |
% % fprintf('Percent Difference in UMCx UMCy between SOCdiff and Richdiff: \n %f %f \n',[100*length(lnx)/length(diffx) 100*length(lny)/length(diffx)]); | |
% % [mean(diffx(lnx)) mean(diffy(lny))] | |
% % length(diffx) | |
% % | |
% % Udiff1=A1.Udiff; | |
% % Vdiff1=A1.Vdiff; | |
% % L11=[length(find(abs(Udiff1)>0.05)) length(find(abs(Vdiff1)>0.05))]; | |
% % Udiff2=B1.Udiff; | |
% % Vdiff2=B1.Vdiff; | |
% % L22=[length(find(abs(Udiff2)>0.05)) length(find(abs(Vdiff2)>0.05))]; | |
% % | |
% % fprintf('Udiff and Vdiff >0.05 SOCdiff: \n %d %d \n',L11); | |
% % fprintf('Udiff and Vdiff >0.05 Richdiff: \n %d %d \n',L22); | |
% % | |
% % end | |
%% | |
%{ | |
% printfig=1; | |
addpath Z:\Planar_Uncertainty_work\Results\final_plots\applyhatch_pluscolor_bundle\; | |
set(0,'DefaultAxesFontName', 'Times New Roman'); | |
crimson=rgb('crimson'); | |
dblue=rgb('deepskyblue'); | |
blueviolet=rgb('blueviolet'); | |
lw=1.5;fs=20;lw2=2.5; | |
% Plot uncertainty histograms | |
figure;hold on; | |
set(gcf,'DefaultLineLineWidth',lw);set(gca,'FontSize',fs); | |
bh=bar([covg1; covg2; covg3; covg4; covg5]); | |
set(bh(1),'Facecolor',crimson,'Edgecolor','k','LineWidth',lw2);set(bh(2),'Facecolor',crimson,'Edgecolor','k','LineStyle','--','LineWidth',lw2); | |
set(bh(3),'Facecolor',dblue,'Edgecolor','k','LineWidth',lw2);set(bh(4),'Facecolor',dblue,'Edgecolor','k','LineStyle','--','LineWidth',lw2); | |
set(bh(5),'Facecolor',blueviolet,'Edgecolor','k','LineWidth',lw2);set(bh(6),'Facecolor',blueviolet,'Edgecolor','k','LineStyle','--','LineWidth',lw2); | |
xl=xlim(gca); | |
plot(linspace(xl(1),xl(2),5),68.5.*ones(5,1),'k--'); | |
hold off; | |
set(gca,'XTick',[1 2 3 4 5]) | |
set(gca,'XTickLabel',casename_org); | |
box on; | |
set(gcf,'color','white'); | |
set(gcf,'units','normalized','outerposition',[0 0 0.8 0.8]); | |
ylabel('Coverage (%)'); | |
title('Standard Uncertainty Coverage'); | |
legend('MC_x','MC_y','PD_x','PD_y','CS_x','CS_y','orientation','horizontal'); | |
% applyhatch_pluscolor(gcf,'./././././././././././././././',1,360); | |
if printfig==1 | |
export_fig(gcf,fullfile(outputdir{2},'coverage_plot.png'),'-painters','-r360'); | |
end | |
% Plot the uncertainty histograms | |
% plot_MC_uncertainty(A,casename,outputdir,printfig,runCS,runIM,runMC); | |
%} | |
%Spatial uncertainties | |
%Uncertainty Timeseries | |
% end |