Changeset 366


Ignore:
Timestamp:
Jan 10, 2012, 11:32:30 PM (12 years ago)
Author:
sommeria
Message:

civ_uvmat improved

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/civ_matlab.m

    r365 r366  
    205205    ibx2=ceil(par_civ2.Bx/2);
    206206    iby2=ceil(par_civ2.By/2);
    207     isx2=ibx2+3;
    208     isy2=iby2+3;
     207    isx2=ibx2+5;% search ara +-5 pixels around the guess
     208    isy2=iby2+5;
    209209    % shift from par_civ2.filename_nc1
    210210    % shiftx=velocity interpolated at position
     
    252252    par_civ2.Shiftx=Shiftx(nbval>=1)./nbval(nbval>=1);
    253253    par_civ2.Shifty=Shifty(nbval>=1)./nbval(nbval>=1);
    254     par_civ2.Grid=[GridX(nbval>=1) GridY(nbval>=1)];   
     254    par_civ2.Grid=[GridX(nbval>=1)-par_civ2.Shiftx/2 GridY(nbval>=1)-par_civ2.Shifty/2];% grid taken at the extrapolated origin of the displacement vectors   
    255255    if par_civ2.CheckDeformation
    256256        DUDX=DUDX./nbval;
     
    261261    % caluclate velocity data (y and v in indices, reverse to y component)
    262262    [xtable ytable utable vtable ctable F] = civ (par_civ2);
     263%     diff_squared=(utable-par_civ2.Shiftx).*(utable-par_civ2.Shiftx)+(vtable+par_civ2.Shifty).*(vtable+par_civ2.Shifty);
     264%     F(diff_squared>=4)=4; %flag vectors whose distance to the guess exceeds 2 pixels
    263265    list_param=(fieldnames(Param.Civ2))';
    264266    list_remove={'pxcmx','pxcmy','npx','npy','gridflag','maskflag','term_a','term_b','T0'};
     
    492494    iref=par_civ.Grid(ivec,1);% xindex on the image A for the middle of the correlation box
    493495    jref=par_civ.Grid(ivec,2);% yindex on the image B for the middle of the correlation box
    494     %     xtable(ivec)=iref;
    495     %     ytable(ivec)=jref;%default
    496496    if ~(checkmask && par_civ.Mask(jref,iref)<=20) %velocity not set to zero by the black mask
    497497        if jref-iby2<1 || jref+iby2>par_civ.ImageHeight|| iref-ibx2<1 || iref+ibx2>par_civ.ImageWidth||...
     
    511511                F(ivec)=3;
    512512            end
    513         end
    514        
     513        end     
    515514        if F(ivec)~=3
    516515            image1_crop=image1_crop-image1_mean;%substract the mean
     
    531530                    end
    532531                    utable(ivec)=vector(1)+shiftx(ivec);
    533                     vtable(ivec)=vector(2)+shifty(ivec);
     532                    vtable(ivec)=vector(2)+shifty(ivec);                 
    534533                    xtable(ivec)=iref+utable(ivec)/2;% convec flow (velocity taken at the point middle from imgae1 and 2)
    535534                    ytable(ivec)=jref+vtable(ivec)/2;
Note: See TracChangeset for help on using the changeset viewer.