Changeset 1131 for trunk/src/series


Ignore:
Timestamp:
Apr 11, 2024, 7:30:52 PM (4 months ago)
Author:
sommeria
Message:

updated to read pivdata from fluidimage

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/series/civ_series.m

    r1127 r1131  
    2121%           if absent no file is produced, result in the output structure Data (test mode)
    2222%     Param.ActionInput: substructure with the parameters provided by the GUI civ_input
    23 %                      .Civ1: parameters for civ1
     23%                      .Civ1: parameters for civ1cc
    2424%                      .Fix1: parameters for fix1
    2525%                      .Patch1:
     
    286286end
    287287for ifield=1:NbField
    288     tic
     288    tstart=tic;
     289    time_civ1=0;
     290  time_patch1=0;
     291  time_civ2=0;
     292  time_patch2=0;
    289293    if ~isempty(RUNHandle)% update the waitbar in interactive mode with GUI series  (checkrun=1)
    290294        update_waitbar(WaitbarHandle,ifield/NbField)
     
    382386                        continue
    383387                    end
     388                    tsart_input=tic;
    384389                    [par_civ1.ImageA,VideoObject_A] = read_image(ImageName_A,FileType_A,VideoObject_A,FrameIndex_A_Civ1(ifield));
     390                    time_input=toc(tsart_input);
    385391                end
    386392                ImageName_B=fullfile_uvmat(RootPath_B,SubDir_B,RootFile_B,FileExt_B,NomType_B,i2_series_Civ1(ifield),[],j2_series_Civ1(ifield));
     
    501507        else %usual PIV
    502508            % caluclate velocity data (y and v in indices, reverse to y component)
     509            tstart_civ1=tic;
    503510            [xtable, ytable, utable, vtable, ctable, F, result_conv, errormsg] = civ (par_civ1);
    504511            if ~isempty(errormsg)
     
    512519            Data.Civ1_C=reshape(ctable,[],1);
    513520            Data.Civ1_F=reshape(F,[],1);
     521            time_civ1=toc(tstart_civ1);
    514522        end
    515523    else% we use existing Civ1 data
     
    561569    if isfield (Param.ActionInput,'Patch1')
    562570        disp('patch1 started')
     571         tstart_patch1=tic;
    563572        if check_civx
    564573            errormsg='Civ Matlab input needed for patch';
     
    600609
    601610        % perform Patch calculation using the UVMAT fct 'filter_tps'
     611       
    602612        [Data.Civ1_SubRange,Data.Civ1_NbCentres,Data.Civ1_Coord_tps,Data.Civ1_U_tps,Data.Civ1_V_tps,tild,Ures, Vres,tild,FFres]=...
    603613            filter_tps([Data.Civ1_X(ind_good) Data.Civ1_Y(ind_good)],Data.Civ1_U(ind_good),Data.Civ1_V(ind_good),[],Data.Patch1_SubDomainSize,Data.Patch1_FieldSmooth,Data.Patch1_MaxDiff);
     
    605615        Data.Civ1_V_smooth(ind_good)=Vres;
    606616        Data.Civ1_FF(ind_good)=int8(FFres);
     617        time_patch1=toc(tstart_patch1);
    607618        disp('patch1 performed')
    608619    end
     
    611622    if isfield (Param.ActionInput,'Civ2')
    612623        disp('civ2 started')
     624        tstart_civ2=tic;
    613625        par_civ2=Param.ActionInput.Civ2;
    614626        if CheckInputFile % read input images (except in mode Test where it is introduced directly in Param.ActionInput.Civ1.ImageNameA and B)
     
    765777       
    766778        % calculate velocity data (y and v in image indices, reverse to y component)
     779       
    767780        [xtable, ytable, utable, vtable, ctable, F,result_conv,errormsg] = civ (par_civ2);
    768781       
     
    806819        Data.Civ2_F=reshape(F,[],1);
    807820        disp('civ2 performed')
     821        time_civ2=toc(tstart_civ2);
    808822    elseif ~isfield(Data,'ListVarName') % we start there, using existing Civ2 data
    809823        if exist('ncfile','var')
     
    836850        end
    837851        Data.ListGlobalAttribute=[Data.ListGlobalAttribute Fix2_param];
    838         %
    839         %         ListFixParam=fieldnames(Param.ActionInput.Fix2);
    840         %         for ilist=1:length(ListFixParam)
    841         %             ParamName=ListFixParam{ilist};
    842         %             ListName=['Fix2_' ParamName];
    843         %             eval(['Data.ListGlobalAttribute=[Data.ListGlobalAttribute ''' ParamName '''];'])
    844         %             eval(['Data.' ListName '=Param.ActionInput.Fix2.' ParamName ';'])
    845         %         end
    846852        if check_civx
    847853            if ~isfield(Data,'fix2')
     
    865871    if isfield (Param.ActionInput,'Patch2')
    866872        disp('patch2 started')
     873        tstart_patch2=tic;
    867874        list_param=fieldnames(Param.ActionInput.Patch2)';
    868875        list_param(strcmp('TestPatch2',list_param))=[];% remove the parameter TestCiv1 from the list
     
    894901                        disp_uvmat('ERROR','all vectors of civ2 are bad, check input parameters' ,checkrun)
    895902                        return
    896         end
     903                end
     904             
    897905        [Data.Civ2_SubRange,Data.Civ2_NbCentres,Data.Civ2_Coord_tps,Data.Civ2_U_tps,Data.Civ2_V_tps,tild,Ures,Vres,tild,FFres]=...
    898906            filter_tps([Data.Civ2_X(ind_good) Data.Civ2_Y(ind_good)],Data.Civ2_U(ind_good),Data.Civ2_V(ind_good),[],Data.Patch2_SubDomainSize,Data.Patch2_FieldSmooth,Data.Patch2_MaxDiff);
     
    901909        Data.Civ2_FF(ind_good)=FFres;
    902910        Data.CivStage=Data.CivStage+1;
     911        time_patch2=toc(tstart_patch2);
    903912        disp('patch2 performed')
    904913    end
     
    913922            disp(errormsg)
    914923        end
    915         disp(['ellapsed time ' num2str(toc/60,2) ' minutes'])
     924        time_total=toc(tstart);
     925        disp(['ellapsed time ' num2str(time_total/60,2) ' minutes'])
     926        disp(['time image reading ' num2str(time_input/60,2) ' minutes'])
     927        disp(['time civ1 ' num2str(time_civ1/60,2) ' minutes'])
     928        disp(['time patch1 ' num2str(time_patch1/60,2) ' minutes'])
     929        disp(['time civ2 ' num2str(time_civ2/60,2) ' minutes'])
     930        disp(['time patch2 ' num2str(time_patch2/60,2) ' minutes'])
     931        disp(['time other ' num2str((time_total-time_input-time_civ1-time_patch1-time_civ2-time_patch2)/60,2) ' minutes'])
    916932    end
    917933end
Note: See TracChangeset for help on using the changeset viewer.