Ignore:
Timestamp:
Feb 13, 2015, 11:22:01 AM (10 years ago)
Author:
sommeria
Message:

histo_diff upadated

File:
1 edited

Legend:

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

    r867 r868  
    166166    rmpath(Param.FieldTransform.TransformPath)
    167167end
    168 if ~(isfield(Param,'ProjObject')&& ismember(Param.ProjObject.ProjMode,{'polygon','rectangle','ellipse'}))
     168if ~(isfield(Param,'ProjObject')&& ismember(Param.ProjObject.Type,{'polygon','rectangle','ellipse'}))
    169169    disp_uvmat('ERROR','projection in a closed domain: polygon, rectangle or ellipse is needed for histograms',checkrun)
    170170end
     
    205205    InputFields{2}=[];%default (case of images)
    206206    if isfield(Param,'InputFields')
    207         InputFields{2}=Param.InputFields{1};%default
     207        InputFields{2}=InputFields{1};%default
    208208        if isfield(Param.InputFields,'FieldName_1')
    209209            InputFields{2}.FieldName=Param.InputFields.FieldName_1;
     
    249249        if ~isempty(transform_fct)
    250250            switch nargin(transform_fct)
    251                 case 4
    252                     if length(Data)==2
    253                         Field=transform_fct(Data{1},XmlData{1},Data{2},XmlData{2});
    254                     else
    255                         Field=transform_fct(Data{1},XmlData{1});
    256                     end
    257                 case 3
    258                     if length(Data)==2
    259                         Field=transform_fct(Data{1},XmlData{1},Data{2});
    260                     else
    261                         Field=transform_fct(Data{1},XmlData{1});
    262                     end
    263251                case 2
    264252                    Field=transform_fct(Data{1},XmlData{1});
     
    268256        end
    269257       
    270         %% calculate tps coefficients if needed
     258        %% projection of the second (ref) field on the first one
     259        % calculate tps coefficients if needed (spatial derivatives)
    271260%         if isfield(Param,'ProjObject')&&isfield(Param.ProjObject,'ProjMode')&& strcmp(Param.ProjObject.ProjMode,'interp_tps')
    272261%             Field=tps_coeff_field(Field,check_proj_tps);
    273 %         end
    274        
    275         %field projection on an object
    276             [Field,errormsg]=proj_field(Field,Param.ProjObject);
     262%         end       
     263          Field.ListVarName={'X','Y','U','V'};
     264          Field.VarDimName={'nb_vector','nb_vector','nb_vector','nb_vector'};
     265          F.U=scatteredInterpolant(Data{2}.X,Data{2}.Y,Data{2}.U,'linear');
     266          Field.U=Field.U-F.U(Field.X,Field.Y);%substract the interpolated ref to U
     267          F.V=scatteredInterpolant(Data{2}.X,Data{2}.Y,Data{2}.V,'linear');
     268          Field.V=Field.V-F.V(Field.X,Field.Y);%substract the interpolated ref to V
     269         
     270        %field projection on a close object yielding histogram
     271            [Histo,errormsg]=proj_field(Field,Param.ProjObject);% calculate histogram
    277272            if ~isempty(errormsg)
    278273                disp_uvmat('ERROR',['error in histo_diff/proj_field:' errormsg],checkrun)
Note: See TracChangeset for help on using the changeset viewer.