Changeset 1094 for trunk/src/uvmat.m


Ignore:
Timestamp:
Mar 25, 2021, 9:37:04 AM (4 years ago)
Author:
sommeria
Message:

phys_polar debugged

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/uvmat.m

    r1093 r1094  
    15381538XmlData.LIFCalib.Ray1Coord=LineData{1}.Coord;
    15391539XmlData.LIFCalib.Ray2Coord=LineData{2}.Coord;
     1540if numel(LineData)<3
     1541    msgbox_uvmat('ERROR','draw a reference line of direct laser illumination (without dye absorbsion)');
     1542    return
     1543end
    15401544XmlData.LIFCalib.RefLineCoord=LineData{3}.Coord;
    15411545
     
    15451549y=linspace(UvData.Field.Coord_y(1),UvData.Field.Coord_y(2),nby)-nby/2;
    15461550[X,Y]=meshgrid(x,y);
    1547 coeff_quad=0.15*4/(nbx*nbx);% image luminosity reduced by 10% at the edge
    1548 UvData.Field.A=double(UvData.Field.A).*(1+coeff_quad*(X.*X+Y.*Y));
     1551%coeff_quad=0.15*4/(nbx*nbx);% image luminosity reduced by 10% at the edge
     1552%UvData.Field.A=double(UvData.Field.A).*(1+coeff_quad*(X.*X+Y.*Y));
    15491553
    15501554%% display the current image in polar axes with origin at the  illumination source
     
    15641568    y_ref=y_ref-y0;
    15651569    [theta_ref,r_ref] = cart2pol(x_ref,y_ref);%theta_ref  and r_ref are the polar coordinates of the points on the line
    1566     theta_ref=theta_ref*180/pi;% theta_ref in radians
     1570    theta_ref=theta_ref*180/pi;% theta_ref in degrees
    15671571    figure(10)
    15681572    plot(theta_ref,r_ref)
     
    15701574    ylabel('radius from light source')
    15711575    title('ref line in polar coordinates')
    1572     azimuth_ima=linspace(DataPol.Coord_y(1),DataPol.Coord_y(2),size(DataPol.A,1));%array of angular index on the transformed image
     1576    azimuth_ima=linspace(DataPol.Coord_y(1),DataPol.Coord_y(2),size(DataPol.A,1))-360;%array of angular indices on the transformed image
    15731577    dist_source = interp1(theta_ref,r_ref,azimuth_ima);% get the polar position of the reference line
    15741578    dist_source_pixel=round(size(DataPol.A,2)*(dist_source-DataPol.Coord_x(1))/(DataPol.Coord_x(2)-DataPol.Coord_x(1)));
     
    37193723%% choose and read a second field FileName_1 if defined
    37203724ParamOut_1=[];
    3721 if numel(UvData.FileInfo)>1
     3725if ~isempty(FileName_1)
     3726    if numel(UvData.FileInfo)==1
     3727        UvData.FileInfo{2}=UvData.FileInfo{1};
     3728    end
    37223729    VelType_1=[];%default
    37233730    FieldName_1=[];
     
    37363743        NomType_1=get(handles.NomType,'String');
    37373744    end
    3738     if strcmp(UvData.FileInfo{2}.FieldType,'image')
     3745    if strcmp(UvData.FileInfo{2}.FileType,'image')
    37393746        FieldName_1='image';
    37403747        frame_index_1=1;%default
     
    37613768    end
    37623769    switch UvData.FileInfo{2}.FileType
    3763         case {'civx','civdata','netcdf','pivdata_fluidimage'};
     3770        case {'civx','civdata','netcdf','pivdata_fluidimage'}
    37643771            list_fields=get(handles.FieldName_1,'String');% list menu fields
    37653772            FieldName_1= list_fields{get(handles.FieldName_1,'Value')}; % selected field
     
    38493856%% update the display menu for the second velocity type (second menuline)
    38503857test_veltype_1=0;
    3851 if isempty(FileName_1)
    3852 elseif ~test_keepdata_1
    3853     if strcmp(UvData.FileInfo{2}.FieldType,'civdata')&& ~strcmp(FieldName_1,'get_field...')
     3858if ~isempty(FileName_1)
     3859
     3860    if strcmp(UvData.FileInfo{2}.FileType,'civdata')&& ~strcmp(FieldName_1,'get_field...')
    38543861        test_veltype_1=1;
    38553862        set(handles.VelType_1,'Visible','on')
Note: See TracChangeset for help on using the changeset viewer.