From: Lukáš Jiřiště Date: Mon, 29 Jul 2024 09:15:20 +0000 (+0200) Subject: Unite if branches with the same content X-Git-Url: https://git.ljiriste.work/?a=commitdiff_plain;h=2ca57734c2afd89b5498816d39c712207da54bcf;p=Bubble_column.git Unite if branches with the same content --- diff --git a/Bubliny.m b/Bubliny.m index 48a5a81..eb8b526 100755 --- a/Bubliny.m +++ b/Bubliny.m @@ -130,13 +130,13 @@ for iii=1:1:nSelectedDirectory % Cycles for directories with files % % plot(lk,abs(pk),'oc','linewidth',2) if D_num==1 LevelPixels=MeterScale(1+(1000-LevelNum(1,jjj))/100); % x level in pixels in the original image - [pk,lk] = findpeaks(-IntensitiesAverFin{jjj}(1:(LevelPixels+30))); %10 - [Height(1,jjj),pkH]=max(pk); - qH=lk(pkH); - Metr_fit_H(1,jjj)=polyval(polypar_Metr,qH); - plot(qH,-Height(jjj),'or','linewidth',2) - if jjj>=startFile+step - LevelPixels=MeterScale(1+(1000-LevelNum(1,jjj))/100); % x level in pixels in the original image + if jjj=startFile+step if waytrend<=0; [pk,lk] = findpeaks(-IntensitiesAverFin_2{jjj}(1:(LevelPixels+30))); %10 else @@ -151,74 +151,71 @@ for iii=1:1:nSelectedDirectory % Cycles for directories with files end elseif D_num==2 + LevelPixels=MeterScale(1); % x level in pixels in the original image if jjj=startFile+step - LevelPixels=MeterScale(1); % x level in pixels in the original image if waytrend<=0; [pk,lk] = findpeaks(-IntensitiesAverFin_2{jjj}(LevelPixels:end)); %10 else [pk,lk] = findpeaks(IntensitiesAverFin_2{jjj}(LevelPixels:end)); %10 end - [Height(1,jjj),pkH]=max(pk); - qH=LevelPixels+lk(pkH); - Metr_fit_H(1,jjj)=polyval(polypar_Metr,qH); - if max(pk)<30; % error cleaning %30 - qH=NaN; - Metr_fit_H(1,jjj)=NaN; - end - plot(qH,Height(jjj),'om','linewidth',2) + [Height(1,jjj),pkH]=max(pk); + qH=LevelPixels+lk(pkH); + Metr_fit_H(1,jjj)=polyval(polypar_Metr,qH); + if max(pk)<30; % error cleaning %30 + qH=NaN; + Metr_fit_H(1,jjj)=NaN; + end + plot(qH,Height(jjj),'om','linewidth',2) end end - if D_num==1 - if jjj=(Metr_fit_H(1,jjj)-2) % Throw out the bubble/liquid interface if it is above the surface, 2cm 2D interface - Metr_fit_B(1,jjj)=NaN; - qB=NaN; - elseif Bottom(1,jjj)<=(max(abs(pk))+min(abs(pk)))*0.62 % 0.65 is an estimate of how much intensity the bubbles need - Metr_fit_B(1,jjj)=NaN; % For 1-4 files - qB=NaN; - end - plot(qB,Bottom(jjj),'ob','linewidth',2) + Metr_fit_B(1,jjj)=polyval(polypar_Metr,qB); + if Metr_fit_B(1,jjj)>=(Metr_fit_H(1,jjj)-2) % Throw out the bubble/liquid interface if it is above the surface, 2cm 2D interface + Metr_fit_B(1,jjj)=NaN; + qB=NaN; + elseif Bottom(1,jjj)<=(max(abs(pk))+min(abs(pk)))*0.62 % 0.65 is an estimate of how much intensity the bubbles need + Metr_fit_B(1,jjj)=NaN; % For 1-4 files + qB=NaN; end - - if jjj>=startFile+step + plot(qB,Bottom(jjj),'ob','linewidth',2) + else + if D_num==1 LevelPixels=MeterScale(1+(1000-LevelNum(1,jjj))/100); % x level in pixels in the original image if waytrend<=0; [pk2,lk2] = findpeaks(-IntensitiesAverFin_2{jjj}(LevelPixels:end)); %10 @@ -233,54 +230,7 @@ for iii=1:1:nSelectedDirectory % Cycles for directories with files Metr_fit_B(1,jjj)=NaN; end plot(qB,Bottom(jjj),'oc','linewidth',2) - end - - elseif D_num==2 - if jjj=(Metr_fit_H(1,jjj)-2) % Throw out the bubble/liquid interface if it is above the surface, 2cm 2D interface - Metr_fit_B(1,jjj)=NaN; - qB=NaN; - elseif Bottom(1,jjj)<=(max(abs(pk))+min(abs(pk)))*0.62 % 0.65 is an estimate of how much intensity the bubbles need - Metr_fit_B(1,jjj)=NaN; % For 1-4 files - qB=NaN; - end - plot(qB,Bottom(jjj),'ob','linewidth',2) - end - - if jjj>=startFile+step + elseif D_num==2 LevelPixels=MeterScale(1); % x level in pixels in the original image if waytrend<=0; [pk2,lk2] = findpeaks(-IntensitiesAverFin_2{jjj}(LevelPixels:end)); %10