Changeset 1202 for trunk/src/series


Ignore:
Timestamp:
Mar 24, 2026, 3:46:06 PM (2 days ago)
Author:
sommeria
Message:

parciv added and erasing bad file in complement series

Location:
trunk/src/series
Files:
2 edited

Legend:

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

    r1201 r1202  
    1 %'civ2vel_3C': combine velocity fields from two cameras to get three velocity components
     1%'civ2vel_3C': combine the civ velocity fields from two cameras to get three velocity components
    22%------------------------------------------------------------------------
    3 % function ParamOut=civ2vel_3C(Param)
     3% function GUIParam=civ2vel_3C(Param)
    44%
    55%OUTPUT
    6 % ParamOut: sets options in the GUI series.fig needed for the function
     6% GUIParam: sets options in the GUI series.fig needed for the function
    77%
    88%INPUT:
     
    5151%=======================================================================
    5252
    53 function ParamOut=civ2vel_3C(Param)
     53function GUIParam=civ2vel_3C(Param)
    5454
    5555%% set the input elements needed on the GUI series when the function is selected in the menu ActionName or InputTable refreshed
    5656if isstruct(Param) && isequal(Param.Action.RUN,0)
    57     ParamOut.AllowInputSort='off';% allow alphabetic sorting of the list of input file SubDir (options 'off'/'on', 'off' by default)
    58     ParamOut.WholeIndexRange='off';% prescribes the file index ranges from min to max (options 'off'/'on', 'off' by default)
    59     ParamOut.NbSlice='off'; %nbre of slices ('off' by default)
    60     ParamOut.VelType='off';% menu for selecting the velocity type (options 'off'/'one'/'two',  'off' by default)
    61     ParamOut.FieldName='off';% menu for selecting the field (s) in the input file(options 'off'/'one'/'two', 'off' by default)
    62     ParamOut.FieldTransform = 'off';%use the phys  transform function without choice
    63     %ParamOut.TransformPath=fullfile(fileparts(which('uvmat')),'transform_field');% path to transform functions (needed for compilation only)
    64     ParamOut.ProjObject='on';%can use projection object(option 'off'/'on',
    65     ParamOut.Mask='off';%can use mask option   (option 'off'/'on', 'off' by default)
    66     ParamOut.OutputDirExt='.vel3C';%set the output dir extension
    67     ParamOut.OutputSubDirMode='two'; % the two first input lines are used to define the output subfolder
    68     ParamOut.OutputFileMode='NbInput';% '=NbInput': 1 output file per input file index, '=NbInput_i': 1 file per input file index i, '=NbSlice': 1 file per slice
     57    GUIParam.NbSlice='off'; %nbre of slices ('off' by default) !!VERIFIER
     58    GUIParam.VelType='off';% menu for selecting the velocity type (options 'off'/'one'/'two',  'off' by default)!!VERIFIER
     59    GUIParam.FieldName='off';% menu for selecting the field (s) in the input file(options 'off'/'one'/'two', 'off' by default)
     60    GUIParam.ProjObject='on';%can use projection object(option 'off'/'on',
     61    GUIParam.Mask='off';%can use mask option   (option 'off'/'on', 'off' by default)!!VERIFIER
     62    GUIParam.OutputDirExt='.vel3C';%set the output dir extension
     63    GUIParam.OutputSubDirMode='two'; % the two first input lines are used to define the output subfolder
     64    GUIParam.OutputFileMode='NbInput';% '=NbInput': 1 output file per input file index, '=NbInput_i': 1 file per input file index i, '=NbSlice': 1 file per slice
    6965    %check the input files
    70     ParamOut.CheckOverwriteVisible='on'; % manage the overwrite of existing files (default=1)
     66    GUIParam.CheckOverwriteVisible='on'; % manage the overwrite of existing files (default=1)
    7167    first_j=[];
    7268    if size(Param.InputTable,1)<2
    73         msgbox_uvmat('WARNING',['two or three input file series are needed'])
     69        msgbox_uvmat('ERROR','two or three input file series are needed')
     70        return
     71    end
     72    if  ~isfield(Param,'ProjObject')
     73        msgbox_uvmat('ERROR','You  need a projection object of type plane')
     74        return
    7475    end
    7576    if isfield(Param.IndexRange,'first_j'); first_j=Param.IndexRange.first_j; end
     
    7980    FirstFileName=fullfile_uvmat(Param.InputTable{1,1},Param.InputTable{1,2},Param.InputTable{1,3},...
    8081        Param.InputTable{1,5},Param.InputTable{1,4},i1,i2,j1,j2);
    81     if ~exist(FirstFileName,'file')
    82         msgbox_uvmat('WARNING',['the first input file ' FirstFileName ' does not exist'])
    83     elseif isequal(size(Param.InputTable,1),1) && ~isfield(Param,'ProjObject')
    84         msgbox_uvmat('WARNING','You may need a projection object of type plane for merge_proj')
    85     end
    86     return
     82    if exist(FirstFileName,'file')
     83        FileInfo=get_file_info(FirstFileName);
     84        if ~strcmp(FileInfo.FileType,'civdata')
     85            msgbox_uvmat('ERROR','civ data are needed as input')
     86            return
     87        end
     88    else
     89        msgbox_uvmat('ERROR',['the first input file ' FirstFileName ' does not exist'])
     90        return
     91    end
    8792end
    8893
    8994%%%%%%%%%%%% STANDARD PART (DO NOT EDIT) %%%%%%%%%%%%
    90 ParamOut=[]; %default output
     95GUIParam=[]; %default output
    9196%% read input parameters from an xml file if input is a file name (batch mode)
    9297checkrun=1;
  • trunk/src/series/civ_series.m

    r1201 r1202  
    11%'civ_series': PIV function activated by the general GUI series
    22% --- call the sub-functions:
    3 %   civ: PIV function itself
    4 %   detect_false: put a flag to false vectors after detection by various criteria
    5 %   filter_tps: make interpolation-smoothing
     3%  'parciv.m' PIV function itself, adpated to parallel processing (loop
     4%  parfor instead of for)
     5%  'civ.m': same as parciv, but with usual loop 'for', suitable for cluster
     6%  dispatch (no parallel processing inside functions)
     7%   filter_tps: make interpolation-smoothing by thin plate spline method
    68%------------------------------------------------------------------------
    7 % function [Data,errormsg,result_conv]= civ_series(Param)
     9% function [GUIParam,errormsg]= civ_series(Param)
    810%
    911%OUTPUT
    10 % Data=structure containing the PIV results and information on the processing parameters
    11 % errormsg=error message char string, decd ..fault=''
    12 % resul_conv: image inter-correlation function for the last grid point (used for tests)
    13 %
     12% GUIParam=structure containing the input parameters sent to the GUI series in the interactive selection phase
    1413%INPUT:
    1514% Param: Matlab structure of input  parameters
     
    4645%=======================================================================
    4746
    48 function [Data,errormsg]= civ_series(Param)
     47function [GUIParam,errormsg]= civ_series(Param)
    4948errormsg='';
    50 
     49GUIParam=[];
    5150%% set the input elements needed on the GUI series when the action is selected in the menu ActionName or InputTable refreshed
    5251if isstruct(Param) && isequal(Param.Action.RUN,0)% function activated from the GUI series but not RUN
    53     if 0==1 %never satisfied but trigger compilation with the appropriate transform functions ('eval' inactive for compilation)
    54         ima_rescale
    55     end
    5652    path_series=fileparts(which('series'));
    5753    addpath(fullfile(path_series,'series'))
    58     Data=civ_input(Param);% introduce the civ parameters using the GUI civ_input
     54   GUIParam=civ_input(Param);% introduce the civ parameters using the GUI civ_input
    5955    % TODO: change from guide to App: modify the input procedure, adapt read_GUI function
    6056    %App=civ_input_App
    6157    %Data=civ_input_App(Param);% introduce the civ parameters using the GUI civ_input
    6258    % if isempty(App)
    63     %     Data=Param;% if  civ_input has been cancelled, keep previous parameters
     59    %    GUIParam=Param;% if  civ_input has been cancelled, keep previous parameters
    6460    % end
    65     Data.Program=mfilename;%gives the name of the current function
    66     Data.AllowInputSort='off';% allow alphabetic sorting of the list of input file SubDir (options 'off'/'on', 'off' by default)
    67     Data.WholeIndexRange='off';% prescribes the file index ranges from min to max (options 'off'/'on', 'off' by default)
    68     Data.NbSlice='off'; %nbre of slices ('off' by default)
    69     Data.VelType='off';% menu for selecting the velocity type (options 'off'/'one'/'two',  'off' by default)
    70     Data.FieldName='on';% menu for selecting the field (s) in the input file(options 'off'/'one'/'two', 'off' by default)
    71     Data.FieldTransform = 'off';%can use a transform function
    72     Data.ProjObject='off';%can use projection object(option 'off'/'on',
    73     Data.Mask='off';%can use mask option   (option 'off'/'on', 'off' by default)
    74     Data.OutputDirExt='.civ';%set the output dir extension
    75     Data.OutputSubDirMode='last'; %select the last subDir in the input table as root of the output subdir name (option 'all'/'first'/'last', 'all' by default)
    76     Data.OutputFileMode='NbInput_i';% one output file expected per value of i index (used for waitbar)
    77     Data.CheckOverwriteVisible='on'; % manage the overwrite of existing files (default=1)
    78     if isfield(Data,'ActionInput') && isfield(Data.ActionInput,'PairIndices') && isequal(Data.ActionInput.PairIndices.ListPairMode,'pair j1-j2')
    79         Data.IndexRange_j='off';%no j index display in series
     61   GUIParam.Program=mfilename;%gives the name of the current function
     62   GUIParam.AllowInputSort='off';% allow alphabetic sorting of the list of input file SubDir (options 'off'/'on', 'off' by default)
     63   GUIParam.WholeIndexRange='off';% prescribes the file index ranges from min to max (options 'off'/'on', 'off' by default)
     64   GUIParam.NbSlice='off'; %nbre of slices ('off' by default)
     65   GUIParam.VelType='off';% menu for selecting the velocity type (options 'off'/'one'/'two',  'off' by default)
     66   GUIParam.FieldName='on';% menu for selecting the field (s) in the input file(options 'off'/'one'/'two', 'off' by default)
     67   GUIParam.FieldTransform = 'off';%can use a transform function
     68   GUIParam.ProjObject='off';%can use projection object(option 'off'/'on',
     69   GUIParam.Mask='off';%can use mask option   (option 'off'/'on', 'off' by default)
     70   GUIParam.OutputDirExt='.civ';%set the output dir extension
     71   GUIParam.OutputSubDirMode='last'; %select the last subDir in the input table as root of the output subdir name (option 'all'/'first'/'last', 'all' by default)
     72   GUIParam.OutputFileMode='NbInput_i';% one output file expected per value of i index (used for waitbar)
     73   GUIParam.CheckOverwriteVisible='on'; % manage the overwrite of existing files (default=1)
     74    if isfield(GUIParam,'ActionInput') && isfield(GUIParam.ActionInput,'PairIndices') && isequal(GUIParam.ActionInput.PairIndices.ListPairMode,'pair j1-j2')
     75       GUIParam.IndexRange_j='off';%no j index display in series
    8076    else
    81         Data.IndexRange_j='on';% j index display in series if relevant
     77       GUIParam.IndexRange_j='on';% j index display in series if relevant
    8278    end
    8379    return
     
    316312        end
    317313    end
    318     if ~CheckOverwrite && exist(ncfile_out,'file')
     314    if ~CheckOverwrite
     315        [Data,~,~,errormsg]=nc2struct(ncfile_out,'ListGlobalAttribute','CivStage');
     316        if isempty(errormsg)
    319317        disp(['existing output file ' ncfile_out ' already exists, skip to next field'])
    320318        continue% skip iteration if the mode overwrite is desactivated and the result file already exists
    321     end
    322     %     end
     319        end
     320    end
    323321    ImageName_A='';ImageName_B='';%default
    324322    VideoObject_A=[];VideoObject_B=[];
     
    533531            [Civ_X,Civ_Y,Civ_U,Civ_V,Civ_C,Civ_FF,~, errormsg] = civ (par_civ1);% single processor used in cluster
    534532        else
    535             [Civ_X,Civ_Y,Civ_U,Civ_V,Civ_C,Civ_FF,errormsg] = parciv (par_civ1);%use parfor loop
     533            [Civ_X,Civ_Y,Civ_U,Civ_V,Civ_C,Civ_FF,~,errormsg] = parciv (par_civ1);%use parfor loop
    536534        end
    537535        Civ_X_shifted=Civ_X-0.5+Civ_U/2;% get the exact positions
     
    862860            [Civ_X,Civ_Y,Civ_U,Civ_V,Civ_C,Civ_FF,~, errormsg] = civ (par_civ2);% single processor used in cluster
    863861        else
    864             [Civ_X,Civ_Y,Civ_U,Civ_V,Civ_C,Civ_FF,errormsg] = parciv (par_civ2);%use parfor loop
     862            [Civ_X,Civ_Y,Civ_U,Civ_V,Civ_C,Civ_FF,~, errormsg] = parciv (par_civ2);%use parfor loop
    865863        end
    866864        Civ_X_shifted=Civ_X-0.5+Civ_U/2;% get the exact positions
Note: See TracChangeset for help on using the changeset viewer.