Changeset 1129 for trunk/src/uvmat.m


Ignore:
Timestamp:
Mar 1, 2024, 8:09:20 PM (5 months ago)
Author:
sommeria
Message:

LIF calibration update and extrct_multitif

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/uvmat.m

    r1127 r1129  
    16571657
    16581658%% rescale the image
    1659 [nby,nbx]=size(UvData.Field.A);
    1660 x=linspace(UvData.Field.Coord_x(1),UvData.Field.Coord_x(2),nbx)-nbx/2;
    1661 y=linspace(UvData.Field.Coord_y(1),UvData.Field.Coord_y(2),nby)-nby/2;
    1662 [X,Y]=meshgrid(x,y);
     1659% [nby,nbx]=size(UvData.Field.A);
     1660% x=linspace(UvData.Field.Coord_x(1),UvData.Field.Coord_x(2),nbx)-nbx/2;
     1661% y=linspace(UvData.Field.Coord_y(1),UvData.Field.Coord_y(2),nby)-nby/2;
     1662% [X,Y]=meshgrid(x,y);
    16631663%coeff_quad=0.15*4/(nbx*nbx);% image luminosity reduced by 10% at the edge
    16641664%UvData.Field.A=double(UvData.Field.A).*(1+coeff_quad*(X.*X+Y.*Y));
     
    16861686    ylabel('radius from light source')
    16871687    title('ref line in polar coordinates')
    1688     azimuth_ima=linspace(DataPol.Coord_y(1),DataPol.Coord_y(2),size(DataPol.A,1))-360;%array of angular indices on the transformed image
    1689     dist_source = interp1(theta_ref,r_ref,azimuth_ima);% get the polar position of the reference line
    1690     dist_source_pixel=round(size(DataPol.A,2)*(dist_source-DataPol.Coord_x(1))/(DataPol.Coord_x(2)-DataPol.Coord_x(1)));
     1688    %azimuth_ima=linspace(DataPol.Coord_y(1),DataPol.Coord_y(2),size(DataPol.A,1));%array of angular indices on the transformed image
     1689   % dist_source = interp1(theta_ref,r_ref,azimuth_ima);% get the polar position of the reference line
     1690    dist_source = interp1(theta_ref,r_ref,DataPol.theta);% get the polar position of the reference line
     1691    dist_source_pixel=floor(size(DataPol.A,2)*(dist_source-DataPol.radius(1))/(DataPol.radius(end)-DataPol.radius(1)))+1;
    16911692    line_nan= isnan(dist_source);
    16921693    dist_source_pixel(line_nan)=1;
     
    17101711%% get the image A*r
    17111712[npy,npx]=size(Anorm);
    1712 AX=DataPol.Coord_x;
    1713 AY=DataPol.Coord_y;
    1714 dX=(AX(2)-AX(1))/(npx-1);
    1715 dY=(AY(1)-AY(2))/(npy-1);%mesh of new pixels
    1716 [R,Theta]=meshgrid(linspace(AX(1),AX(2),npx),linspace(AY(1),AY(2),npy));
     1713AX=DataPol.radius;
     1714AY=DataPol.theta;
     1715% dX=(AX(2)-AX(1))/(npx-1);
     1716% dY=(AY(1)-AY(2))/(npy-1);%mesh of new pixels
     1717[R,Theta]=meshgrid(linspace(AX(1),AX(end),npx),linspace(AY(1),AY(end),npy));%matrix of radius and angles with the same size as DataPol
    17171718A=R.*Anorm;
    17181719A=(A<=0).*ones(npy,npx)+(A>0).*A; %replaces zeros by ones
     
    17341735gamma_coeff=NaN(1,npy);
    17351736fitlength=NaN(1,npy);
     1737%[ThetaMask,RMask] = cart2pol(MaskData.Coord(:,1)-x0,MaskData.Coord(:,2)-y0);
     1738%ThetaMask=ThetaMask*180/pi
    17361739for iY=1:npy% loop on the y index of the image in polar coordinate
    17371740    ALine=A(iY,:);%profile of image luminosity log (vs radial index)
     
    17521755    p = polyfit(RLine,ALine,1);
    17531756    gamma_coeff(iY)=-p(1);
    1754     fitlength(iY)=numel(find(check_good));
    1755 end
     1757   fitlength(iY)=numel(find(check_good));
     1758end
     1759
     1760%% plot the decay coef versus theta
     1761figure(13)
     1762plot(Theta(:,1),100*gamma_coeff)
     1763xlabel('angle(degree)')
     1764ylabel('decay coeff(m-1)')
     1765
    17561766
    17571767%% show and store the rescaled image
     
    17601770view_field(DataPol);
    17611771imwrite(DataPol.A,NewImageName,'BitDepth',16)
    1762 figure(13)
    1763 plot(Theta(:,1),100*gamma_coeff)
    1764 xlabel('angle(degree)')
    1765 ylabel('decay coeff(m-1)')
     1772
    17661773
    17671774%% keep the average of gamma_coeff
Note: See TracChangeset for help on using the changeset viewer.