Ignore:
Timestamp:
Apr 19, 2024, 8:21:23 PM (3 months ago)
Author:
sommeria
Message:

adapted to reading hdf5 data from fluidimage, extract_rdvision improved

File:
1 edited

Legend:

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

    r1127 r1134  
    6767    ParamOut.FieldName='one';% menu for selecting the field (s) in the input file(options 'off'/'one'/'two', 'off' by default)
    6868    ParamOut.FieldTransform = 'on';%can use a transform function
    69     ParamOut.TransformPath=fullfile(fileparts(which('uvmat')),'transform_field');% path to transform functions (needed for compilation only)
     69    %%%%% list of possible transform functions (needed only for compilation)
     70        ListTransform={'phys','phys_polar','sub_field'};%list of possible transform functions (needed only for compilation)
     71        if 0==1 %never satisfied but trigger compilation with the appropriate transform functions
     72            for ilist=1:numel(ListTransform)
     73                eval(ListTransform)
     74            end
     75        end
     76    ParamOut.TransformPath=fullfile(fileparts(which('uvmat')),'transform_field');% path to transform functions
     77    %%%%%%%%
    7078    ParamOut.ProjObject='on';%can use projection object(option 'off'/'on',
    7179    ParamOut.Mask='on';%can use mask option   (option 'off'/'on', 'off' by default)
     
    8694    return
    8795end
    88 if 0==1
    89     phys; % used to include phys when compiling is done
    90 end
     96
    9197%%%%%%%%%%%% STANDARD PART (DO NOT EDIT) %%%%%%%%%%%%
    9298ParamOut=[]; %default output
     
    115121RootFile=Param.InputTable(:,3);
    116122SubDir=Param.InputTable(:,2);
    117 % NomType=Param.InputTable(:,4);
    118123FileExt=Param.InputTable(:,5);
    119124
     
    126131% i1_series(iview,ref_j,ref_i)... are the corresponding arrays of indices i1,i2,j1,j2, depending on the input line iview and the two reference indices ref_i,ref_j
    127132% i1_series(iview,fileindex) expresses the same indices as a 1D array in file indices
    128 if ~isempty(hdisp),delete(hdisp),end;%end the waiting display
     133if ~isempty(hdisp),delete(hdisp),end %end the waiting display
    129134
    130135NbView=numel(i1_series);%number of input file series (lines in InputTable)
     
    134139
    135140%% determine the file type on each line from the first input file
    136 NcTypeOptions={'netcdf','civx','civdata'};
     141NcTypeOptions={'netcdf','civx','civdata','pivdata_fluidimage'};
    137142for iview=1:NbView
    138143    if ~exist(filecell{iview,1}','file')
     
    178183%% coordinate transform or other user defined transform
    179184transform_fct='';%default fct handle
     185 checksub=0;
    180186if isfield(Param,'FieldTransform')&&~isempty(Param.FieldTransform.TransformName)
    181187    currentdir=pwd;
     
    187193            XmlData{iview}.TransformInput=Param.TransformInput;
    188194        end
    189     end       
     195    end
     196    checksub=nargin(transform_fct);% number of input arguments for the selected transform fct
     197    if checksub>2 && NbView>2
     198        disp_uvmat('WARNING',['only the two first input file series will be combined by ' Param.FieldTransform.TransformName],checkrun)
     199    end
    190200end
    191201%%%%%%%%%%%% END STANDARD PART  %%%%%%%%%%%%
     
    305315        end
    306316       
    307         %% transform the input field (e.g; phys) if requested (no transform involving two input fields)
     317        %% transform the input field iview (e.g; phys) if requested (no transform involving two input fields at this stage)
     318        checksub=0;
    308319        if ~isempty(transform_fct)
    309             if nargin(transform_fct)>=2
     320            checksub=nargin(transform_fct);
     321            if checksub==2
    310322                Data{iview}=transform_fct(Data{iview},XmlData{iview});
    311             else
     323            elseif checksub==1
    312324                Data{iview}=transform_fct(Data{iview});
    313325            end
     
    338350    %%%%%%%%%%%%%%%% END LOOP ON VIEWS %%%%%%%%%%%%%%%%
    339351
    340     %% merge the NbView fields
    341     [MergeData,errormsg]=merge_field(Data);
     352    %% merge the NbView fields
     353    if checksub<=2
     354        [MergeData,errormsg]=merge_field(Data);%concatene all the input field series by fct merge_data
     355    elseif checksub==3
     356        MergeData=transform_fct(Data{1},XmlData{1},Data{2}); %combine the two input file series
     357    else
     358        MergeData=transform_fct(Data{1},XmlData{1},Data{2},XmlData{2});%combine the two input file series with calibration parameters
     359    end
    342360    if ~isempty(errormsg)
    343361        disp_uvmat('ERROR',errormsg,checkrun);
Note: See TracChangeset for help on using the changeset viewer.