- Timestamp:
- Jun 3, 2014, 8:10:03 PM (11 years ago)
- Location:
- trunk/src
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/concentration.m
r566 r782 49 49 Ref.Aref(ind_bad)=D(ind_bad); 50 50 DataOut_1=[]; 51 AX=DataOut.AX;52 AY=DataOut.AY;51 Coord_x=DataOut.Coord_x; 52 Coord_y=DataOut.Coord_y; 53 53 54 dX=( AX(2)-AX(1))/(npx-1);55 dY=( AY(1)-AY(2))/(npy-1);%mesh of new pixels56 [R,Y]=meshgrid(linspace( AX(1),AX(2),npx),linspace(AY(1),AY(2),npy));57 r= AX(1)+[0:npx-1]*dX;%distance from laser54 dX=(Coord_x(2)-Coord_x(1))/(npx-1); 55 dY=(Coord_y(1)-Coord_y(2))/(npy-1);%mesh of new pixels 56 [R,Y]=meshgrid(linspace(Coord_x(1),Coord_x(2),npx),linspace(Coord_y(1),Coord_y(2),npy)); 57 r=Coord_x(1)+[0:npx-1]*dX;%distance from laser 58 58 %A(ind_good)=(A(ind_good)>=0).*A(ind_good); %replaces negative values by zeros 59 59 A=A./Ref.Aref;% luminosity normalised by the reference (value at the edge of the box) … … 71 71 Edge_ind=find((abs(R-r_edge)/dX)<=1 & DataMask.A~=0);%indies of positions close to r_edge, values greater than 1 are not expected 72 72 yedge=min(min(Y(Edge_ind))); 73 jmax=round(-(yedge- AY(1))/dY+1);73 jmax=round(-(yedge-Coord_y(1))/dY+1); 74 74 DataMask.A(jmax:end,:)=0; 75 75 … … 77 77 78 78 % radius along the reference line 79 Theta=(linspace( AY(1),AY(2),npy)*pi/180)'*ones(1,npx);%theta in radians79 Theta=(linspace(Coord_y(1),Coord_y(2),npy)*pi/180)'*ones(1,npx);%theta in radians 80 80 81 81 gamma_coeff=Ref.GammaCoeff*ones(1,npx); … … 91 91 92 92 DataOut=polar2phys(DataOut,RangeX,RangeY); 93 DataOut. AX=DataOut.AX+XmlData.GeometryCalib.PolarCentre(1);94 DataOut. AY=DataOut.AY+XmlData.GeometryCalib.PolarCentre(2);93 DataOut.Coord_x=DataOut.Coord_x+XmlData.GeometryCalib.PolarCentre(1); 94 DataOut.Coord_y=DataOut.Coord_y+XmlData.GeometryCalib.PolarCentre(2); 95 95 DataMask=polar2phys(DataMask,RangeX,RangeY); 96 DataMask. AX=DataMask.AX+XmlData.GeometryCalib.PolarCentre(1);97 DataMask. AY=DataMask.AY+XmlData.GeometryCalib.PolarCentre(2);96 DataMask.Coord_x=DataMask.Coord_x+XmlData.GeometryCalib.PolarCentre(1); 97 DataMask.Coord_y=DataMask.Coord_y+XmlData.GeometryCalib.PolarCentre(2); 98 98 99 99 … … 102 102 DataOut=DataIn; %fdefault 103 103 [npy,npx]=size(DataIn.A); 104 dx=(DataIn. AX(2)-DataIn.AX(1))/(npx-1);105 dy=(DataIn. AY(2)-DataIn.AY(1))/(npy-1);%mesh106 rcorner=[DataIn. AX(1) DataIn.AX(2) DataIn.AX(1) DataIn.AX(2)];% radius of the corners107 ycorner=[DataIn. AY(2) DataIn.AY(2) DataIn.AY(1) DataIn.AY(1)];% azimuth of the corners104 dx=(DataIn.Coord_x(2)-DataIn.Coord_x(1))/(npx-1); 105 dy=(DataIn.Coord_y(2)-DataIn.Coord_y(1))/(npy-1);%mesh 106 rcorner=[DataIn.Coord_x(1) DataIn.Coord_x(2) DataIn.Coord_x(1) DataIn.Coord_x(2)];% radius of the corners 107 ycorner=[DataIn.Coord_y(2) DataIn.Coord_y(2) DataIn.Coord_y(1) DataIn.Coord_y(1)];% azimuth of the corners 108 108 thetacorner=pi*ycorner/180;% azimuth in radians 109 109 [Xcorner,Ycorner] = pol2cart(thetacorner,rcorner);% cartesian coordinates of the corners (with respect to lser source) … … 126 126 [Theta,R] = cart2pol(X,Y);%corresponding polar coordiantes 127 127 Theta=Theta*180/pi; 128 %Theta=1+round((Theta-DataIn. AY(1))/dy); %index along y (dy negative)129 Theta=1-round((Theta-DataIn. AY(2))/dy); %index along y (dy negative)130 R=1+round((R-DataIn. AX(1))/dx); %index along x128 %Theta=1+round((Theta-DataIn.Coord_y(1))/dy); %index along y (dy negative) 129 Theta=1-round((Theta-DataIn.Coord_y(2))/dy); %index along y (dy negative) 130 R=1+round((R-DataIn.Coord_x(1))/dx); %index along x 131 131 R=reshape(R,1,npx*npy);%indices reorganized in 'line' 132 132 Theta=reshape(Theta,1,npx*npy); … … 142 142 143 143 %Rangx=Rangx-radius_ref; 144 DataOut. AX=RangeX;145 DataOut. AY=RangeY;144 DataOut.Coord_x=RangeX; 145 DataOut.Coord_y=RangeY; 146 146 -
trunk/src/geometry_calib.m
r773 r782 916 916 path_UVMAT=fileparts(path_uvmat); %path to UVMAT 917 917 addpath(fullfile(path_UVMAT,'transform_field')) 918 Data.ListVarName={' AY','AX','A'};919 Data.VarDimName={' AY','AX',{'AY','AX'}};918 Data.ListVarName={'Coord_y','Coord_x','A'}; 919 Data.VarDimName={'Coord_y','Coord_x',{'Coord_y','Coord_x'}}; 920 920 if ndims(A)==3 921 921 A=mean(A,3); 922 922 end 923 923 Data.A=A-min(min(A)); 924 Data. AY=[npxy(1)-0.5 0.5];925 Data. AX=[0.5 npxy(2)];924 Data.Coord_y=[npxy(1)-0.5 0.5]; 925 Data.Coord_x=[0.5 npxy(2)]; 926 926 Data.CoordUnit='pixel'; 927 927 Calib.GeometryCalib=GeometryCalib; … … 929 929 rmpath(fullfile(path_UVMAT,'transform_field')) 930 930 Amod=DataOut.A;% current image expressed in 'phys' coord 931 Rangx=DataOut. AX;% x coordinates of first and last pixel centres in phys932 Rangy=DataOut. AY;% y coordinates of first and last pixel centres in phys931 Rangx=DataOut.Coord_x;% x coordinates of first and last pixel centres in phys 932 Rangy=DataOut.Coord_y;% y coordinates of first and last pixel centres in phys 933 933 if CalibData.grid.CheckWhite 934 934 Amod=double(Amod);%case of white grid markers: will look for image maxima -
trunk/src/mask_proj.m
r675 r782 54 54 XName=FieldData.ListVarName{CellInfo{icell}.Coord_x}; 55 55 YName=FieldData.ListVarName{CellInfo{icell}.Coord_y}; 56 DX=(MaskData. AX(2)-MaskData.AX(1))/(Npx-1);57 DY=(MaskData. AY(2)-MaskData.AY(1))/(Npy-1);58 mask_ind_i=round(0.5+(FieldData.(XName)-MaskData. AX(1))/DX);%nbpoint terms59 mask_ind_j=round(0.5+(FieldData.(YName)-MaskData. AY(1))/DY);%nbpoint terms56 DX=(MaskData.Coord_x(2)-MaskData.Coord_x(1))/(Npx-1); 57 DY=(MaskData.Coord_y(2)-MaskData.Coord_y(1))/(Npy-1); 58 mask_ind_i=round(0.5+(FieldData.(XName)-MaskData.Coord_x(1))/DX);%nbpoint terms 59 mask_ind_j=round(0.5+(FieldData.(YName)-MaskData.Coord_y(1))/DY);%nbpoint terms 60 60 checkin=mask_ind_j+Npy*(mask_ind_i-1);%array of mask indices for the nbpoints 61 61 checkin=checkin(mask_ind_i>=1 & mask_ind_i<=Npx & mask_ind_j>=1 & mask_ind_j<=Npy);%reduced array of mask indices (inside the image) … … 79 79 XArray=linspace(FieldData.(XName)(1),FieldData.(XName)(end),Npx_field); 80 80 YArray=linspace(FieldData.(YName)(1),FieldData.(YName)(end),Npy_field); 81 XMask=linspace(MaskData. AX(1),MaskData.AX(end),Npx);82 YMask=linspace(MaskData. AY(1),MaskData.AY(end),Npy);81 XMask=linspace(MaskData.Coord_x(1),MaskData.Coord_x(end),Npx); 82 YMask=linspace(MaskData.Coord_y(1),MaskData.Coord_y(end),Npy); 83 83 [XMask,YMask]=meshgrid(XMask,YMask); 84 84 Mask = interp2(XMask,YMask,MaskData.A,XArray,YArray','nearest'); -
trunk/src/plot_field.m
r781 r782 694 694 XName=Data.ListVarName{ivar_X}; 695 695 YName=Data.ListVarName{ivar_Y}; 696 eval([' AX=reshape(Data.' XName ',1,[]);'])697 eval([' AY=reshape(Data.' YName ',1,[]);'])698 [A, AX,AY]=proj_grid(AX',AY',A',[],[],'np>256'); % interpolate on a grid696 eval(['Coord_x=reshape(Data.' XName ',1,[]);']) 697 eval(['Coord_y=reshape(Data.' YName ',1,[]);']) 698 [A,Coord_x,Coord_y]=proj_grid(Coord_x',Coord_y',A',[],[],'np>256'); % interpolate on a grid 699 699 if isfield(Data,'VarAttribute') 700 700 if numel(Data.VarAttribute)>=ivar_X && isfield(Data.VarAttribute{ivar_X},'units') … … 707 707 elseif strcmp(CellInfo{icell}.CoordType,'grid')%2D field with structured coordinates 708 708 YName=Data.ListVarName{CellInfo{icell}.CoordIndex(end-1)}; 709 AY=Data.(YName);710 AX=Data.(Data.ListVarName{CellInfo{icell}.CoordIndex(end)});709 Coord_y=Data.(YName); 710 Coord_x=Data.(Data.ListVarName{CellInfo{icell}.CoordIndex(end)}); 711 711 test_interp_X=0; %default, regularly meshed X coordinate 712 712 test_interp_Y=0; %default, regularly meshed Y coordinate … … 719 719 end 720 720 end 721 if numel( AY)>2722 D AY=diff(AY);723 D AY_min=min(DAY);724 D AY_max=max(DAY);725 if sign(D AY_min)~=sign(DAY_max);% =1 for increasing values, 0 otherwise721 if numel(Coord_y)>2 722 DCoord_y=diff(Coord_y); 723 DCoord_y_min=min(DCoord_y); 724 DCoord_y_max=max(DCoord_y); 725 if sign(DCoord_y_min)~=sign(DCoord_y_max);% =1 for increasing values, 0 otherwise 726 726 errormsg=['errror in plot_field.m: non monotonic dimension variable ' Data.ListVarName{VarRole.coord(1)} ]; 727 727 return 728 728 end 729 test_interp_Y=(D AY_max-DAY_min)> 0.0001*abs(DAY_max);730 end 731 if numel( AX)>2732 D AX=diff(AX);733 D AX_min=min(DAX);734 D AX_max=max(DAX);735 if sign(D AX_min)~=sign(DAX_max);% =1 for increasing values, 0 otherwise729 test_interp_Y=(DCoord_y_max-DCoord_y_min)> 0.0001*abs(DCoord_y_max); 730 end 731 if numel(Coord_x)>2 732 DCoord_x=diff(Coord_x); 733 DCoord_x_min=min(DCoord_x); 734 DCoord_x_max=max(DCoord_x); 735 if sign(DCoord_x_min)~=sign(DCoord_x_max);% =1 for increasing values, 0 otherwise 736 736 errormsg=['errror in plot_field.m: non monotonic dimension variable ' Data.ListVarName{VarRole.coord(2)} ]; 737 737 return 738 738 end 739 test_interp_X=(D AX_max-DAX_min)> 0.0001*abs(DAX_max);739 test_interp_X=(DCoord_x_max-DCoord_x_min)> 0.0001*abs(DCoord_x_max); 740 740 end 741 741 if test_interp_Y 742 npxy(1)=max([256 floor(( AY(end)-AY(1))/DAY_min) floor((AY(end)-AY(1))/DAY_max)]);743 yI=linspace( AY(1),AY(end),npxy(1));742 npxy(1)=max([256 floor((Coord_y(end)-Coord_y(1))/DCoord_y_min) floor((Coord_y(end)-Coord_y(1))/DCoord_y_max)]); 743 yI=linspace(Coord_y(1),Coord_y(end),npxy(1)); 744 744 if ~test_interp_X 745 xI=linspace( AX(1),AX(end),size(A,2));%default746 AX=xI;745 xI=linspace(Coord_x(1),Coord_x(end),size(A,2));%default 746 Coord_x=xI; 747 747 end 748 748 end 749 749 if test_interp_X 750 npxy(2)=max([256 floor(( AX(end)-AX(1))/DAX_min) floor((AX(end)-AX(1))/DAX_max)]);751 xI=linspace( AX(1),AX(end),npxy(2));750 npxy(2)=max([256 floor((Coord_x(end)-Coord_x(1))/DCoord_x_min) floor((Coord_x(end)-Coord_x(1))/DCoord_x_max)]); 751 xI=linspace(Coord_x(1),Coord_x(end),npxy(2)); 752 752 if ~test_interp_Y 753 yI=linspace( AY(1),AY(end),size(A,1));754 AY=yI;753 yI=linspace(Coord_y(1),Coord_y(end),size(A,1)); 754 Coord_y=yI; 755 755 end 756 756 end 757 757 if test_interp_X || test_interp_Y 758 [ AX2D,AY2D]=meshgrid(AX,AY);759 A=interp2( AX2D,AY2D,double(A),xI,yI');760 end 761 AX=[AX(1) AX(end)];% keep only the lower and upper bounds for image represnetation762 AY=[AY(1) AY(end)];758 [Coord_x2D,Coord_y2D]=meshgrid(Coord_x,Coord_y); 759 A=interp2(Coord_x2D,Coord_y2D,double(A),xI,yI'); 760 end 761 Coord_x=[Coord_x(1) Coord_x(end)];% keep only the lower and upper bounds for image represnetation 762 Coord_y=[Coord_y(1) Coord_y(end)]; 763 763 end 764 764 end … … 874 874 cont_pos=[cont_pos_min cont_pos_plus];% set of all contour values 875 875 876 sizpx=( AX(end)-AX(1))/(np(2)-1);877 sizpy=( AY(1)-AY(end))/(np(1)-1);878 x_cont= AX(1):sizpx:AX(end); % pixel x coordinates for image display879 y_cont= AY(1):-sizpy:AY(end); % pixel x coordinates for image display876 sizpx=(Coord_x(end)-Coord_x(1))/(np(2)-1); 877 sizpy=(Coord_y(1)-Coord_y(end))/(np(1)-1); 878 x_cont=Coord_x(1):sizpx:Coord_x(end); % pixel x coordinates for image display 879 y_cont=Coord_y(1):-sizpy:Coord_y(end); % pixel x coordinates for image display 880 880 881 881 %axes(haxes)% set the input axes handle as current axis … … 963 963 end 964 964 if test_interp%if we interpolate 965 x=linspace( AX(1),AX(2),np(2));966 y=linspace( AY(1),AY(2),np(1));965 x=linspace(Coord_x(1),Coord_x(2),np(2)); 966 y=linspace(Coord_y(1),Coord_y(2),np(1)); 967 967 [X,Y]=meshgrid(x,y); 968 xi=linspace( AX(1),AX(2),npxy(2));969 yi=linspace( AY(1),AY(2),npxy(1));968 xi=linspace(Coord_x(1),Coord_x(2),npxy(2)); 969 yi=linspace(Coord_y(1),Coord_y(2),npxy(1)); 970 970 A = interp2(X,Y,double(A),xi,yi'); 971 971 end … … 974 974 tag=get(haxes,'Tag'); 975 975 if MinA<MaxA 976 hima=imagesc( AX,AY,A,[MinA MaxA]);976 hima=imagesc(Coord_x,Coord_y,A,[MinA MaxA]); 977 977 else % to deal with uniform field 978 hima=imagesc( AX,AY,A,[MaxA-1 MaxA]);978 hima=imagesc(Coord_x,Coord_y,A,[MaxA-1 MaxA]); 979 979 end 980 980 % the function imagesc reset the axes 'DataAspectRatioMode'='auto', change if .CheckFixAspectRatio is … … 992 992 set(haxes,'CLim',[MinA MaxA+1]) 993 993 end 994 set(hima,'XData', AX);995 set(hima,'YData', AY);994 set(hima,'XData',Coord_x); 995 set(hima,'YData',Coord_y); 996 996 end 997 997 … … 1193 1193 else 1194 1194 if test_ima %both background image and vectors coexist, take the wider bound 1195 MinX=min( AX);1196 MaxX=max( AX);1197 MinY=min( AY);1198 MaxY=max( AY);1195 MinX=min(Coord_x); 1196 MaxX=max(Coord_x); 1197 MinY=min(Coord_y); 1198 MaxY=max(Coord_y); 1199 1199 if test_vec 1200 1200 MinX=min(MinX,min(vec_X)); -
trunk/src/read_field.m
r769 r782 234 234 Field.NbDim=2;%default 235 235 Field.AName='image'; 236 Field.ListVarName={' AY','AX','A'}; %236 Field.ListVarName={'Coord_y','Coord_x','A'}; % 237 237 if ndims(A)==3 238 238 if Npz==1;%color 239 Field.VarDimName={' AY','AX',{'AY','AX','rgb'}}; %240 Field. AY=[npxy(1)-0.5 0.5];241 Field. AX=[0.5 npxy(2)-0.5]; % coordinates of the first and last pixel centers239 Field.VarDimName={'Coord_y','Coord_x',{'Coord_y','Coord_x','rgb'}}; % 240 Field.Coord_y=[npxy(1)-0.5 0.5]; 241 Field.Coord_x=[0.5 npxy(2)-0.5]; % coordinates of the first and last pixel centers 242 242 if isstruct(ParamOut) 243 243 ParamOut.Npx=npxy(2);% display image size on the interface … … 248 248 Field.NbDim=3; 249 249 Field.ListVarName=['AZ' Field.ListVarName]; 250 Field.VarDimName={'AZ',' AY','AX',{'AZ','AY','AX'}};250 Field.VarDimName={'AZ','Coord_y','Coord_x',{'AZ','Coord_y','Coord_x'}}; 251 251 Field.AZ=[npxy(1)-0.5 0.5]; 252 Field. AY=[npxy(2)-0.5 0.5];253 Field. AX=[0.5 npxy(3)-0.5]; % coordinates of the first and last pixel centers252 Field.Coord_y=[npxy(2)-0.5 0.5]; 253 Field.Coord_x=[0.5 npxy(3)-0.5]; % coordinates of the first and last pixel centers 254 254 if isstruct(ParamOut) 255 255 ParamOut.Npx=npxy(3);% display image size on the interface … … 259 259 end 260 260 else 261 Field.VarDimName={' AY','AX',{'AY','AX'}}; %262 Field. AY=[npxy(1)-0.5 0.5];263 Field. AX=[0.5 npxy(2)-0.5]; % coordinates of the first and last pixel centers261 Field.VarDimName={'Coord_y','Coord_x',{'Coord_y','Coord_x'}}; % 262 Field.Coord_y=[npxy(1)-0.5 0.5]; 263 Field.Coord_x=[0.5 npxy(2)-0.5]; % coordinates of the first and last pixel centers 264 264 ParamOut.Npx=npxy(2);% display image size on the interface 265 265 ParamOut.Npy=npxy(1); -
trunk/src/series/LIF_series.m
r647 r782 120 120 Resu.ZIndex=Data.ZIndex; 121 121 Resu.z=XmlData.GeometryCalib.SliceCoord(Data.ZIndex,3); 122 Resu.ListVarName={' AY' ,'AX' ,'c','mask'};123 Resu.VarDimName={' AY','AX',{'AY','AX'},{'AY','AX'}};124 Resu. AY=[DataOut.AY(1), DataOut.AY(end)];125 Resu. AX=[DataOut.AX(1), DataOut.AX(end)];122 Resu.ListVarName={'Coord_y' ,'Coord_x' ,'c','mask'}; 123 Resu.VarDimName={'Coord_y','Coord_x',{'Coord_y','Coord_x'},{'Coord_y','Coord_x'}}; 124 Resu.Coord_y=[DataOut.Coord_y(1), DataOut.Coord_y(end)]; 125 Resu.Coord_x=[DataOut.Coord_x(1), DataOut.Coord_x(end)]; 126 126 Resu.c=DataOut.A; 127 127 Resu.mask=DataMask.A;%to chnge to cartesian coordinates (polar2phys) -
trunk/src/series/beam_forming.m
r781 r782 102 102 Data.ListGlobalAttribute={'CoordUnit'}; %%TODO: add also time, how to get it ????? 103 103 Data.CoordUnit='pixel'; 104 Data.ListVarName={' AX','AY','A'};105 Data.VarDimName={' AX','AY',{'AY','AX'}};104 Data.ListVarName={'Coord_x','Coord_y','A'}; 105 Data.VarDimName={'Coord_x','Coord_y',{'Coord_y','Coord_x'}}; 106 106 %Data.Coord_x=5*(nbvoie_reception-0.5)/numel(nbvoie_reception); % totql length of e 107 Data. AX=1:65;107 Data.Coord_x=1:65; 108 108 %Data.Coord_z=(1:A)/133 ;% to check from input parameter .... 109 Data. AY=1:332;109 Data.Coord_y=1:332; 110 110 %%%%%% 111 111 % -
trunk/src/series/civ_series.m
r781 r782 239 239 par_civ1.ImageB=DataIn.(FieldName_B); 240 240 else 241 [par_civ1.ImageB,VideoObject_B] = read_image(ImageName_B,FileType_B, Param.InputFields,FrameIndex_B_Civ1(1));241 [par_civ1.ImageB,VideoObject_B] = read_image(ImageName_B,FileType_B,VideoObject_B,FrameIndex_B_Civ1(1)); 242 242 end 243 243 NbField=numel(i1_series_Civ1); -
trunk/src/transform_field/phys.m
r753 r782 71 71 DataOut=phys_1(DataIn,Calib{1},ZIndex);% transform coordiantes and velocity components 72 72 %case of images or scalar: in case of two input fields, we need to project the transform on the same regular grid 73 if isfield(DataIn,'A') && isfield(DataIn,' AX') && ~isempty(DataIn.AX) && isfield(DataIn,'AY')&&...74 ~isempty(DataIn. AY) && length(DataIn.A)>173 if isfield(DataIn,'A') && isfield(DataIn,'Coord_x') && ~isempty(DataIn.Coord_x) && isfield(DataIn,'Coord_y')&&... 74 ~isempty(DataIn.Coord_y) && length(DataIn.A)>1 75 75 iscalar=1; 76 76 A{1}=DataIn.A; … … 117 117 end 118 118 end 119 if isfield(DataIn_1,'A')&&isfield(DataIn_1,' AX')&&~isempty(DataIn_1.AX) && isfield(DataIn_1,'AY')&&...120 ~isempty(DataIn_1. AY)&&length(DataIn_1.A)>1119 if isfield(DataIn_1,'A')&&isfield(DataIn_1,'Coord_x')&&~isempty(DataIn_1.Coord_x) && isfield(DataIn_1,'Coord_y')&&... 120 ~isempty(DataIn_1.Coord_y)&&length(DataIn_1.A)>1 121 121 iscalar=iscalar+1; 122 122 Calib{iscalar}=Calib{2}; … … 127 127 %% transform the scalar(s) or image(s) 128 128 if iscalar~=0 129 [A, AX,AY]=phys_Ima(A,Calib,ZIndex);%TODO : introduire interp2_uvmat ds phys_ima129 [A,Coord_x,Coord_y]=phys_Ima(A,Calib,ZIndex);%TODO : introduire interp2_uvmat ds phys_ima 130 130 if iscalar==1 && ~isempty(DataOut_1) % case for which only the second field is a scalar 131 131 DataOut_1.A=A{1}; 132 DataOut_1. AX=AX;133 DataOut_1. AY=AY;132 DataOut_1.Coord_x=Coord_x; 133 DataOut_1.Coord_y=Coord_y; 134 134 else 135 135 DataOut.A=A{1}; 136 DataOut. AX=AX;137 DataOut. AY=AY;136 DataOut.Coord_x=Coord_x; 137 DataOut.Coord_y=Coord_y; 138 138 end 139 139 if iscalar==2 140 140 DataOut_1.A=A{2}; 141 DataOut_1. AX=AX;142 DataOut_1. AY=AY;141 DataOut_1.Coord_x=Coord_x; 142 DataOut_1.Coord_y=Coord_y; 143 143 end 144 144 end … … 146 146 % subtract fields 147 147 if ~isempty(DataOut_1) 148 DataOut=sub_field(DataOut,[],DataOut_1);148 DataOut=sub_field(DataOut,[],DataOut_1); 149 149 end 150 150 %------------------------------------------------ -
trunk/src/transform_field/phys_polar.m
r658 r782 80 80 DataOut=phys_1(Data,Calib{1},origin_xy,radius_offset,angle_offset,angle_scale); 81 81 %case of images or scalar 82 if isfield(Data,'A')&isfield(Data,' AX')&~isempty(Data.AX) & isfield(Data,'AY')&...83 ~isempty(Data. AY)&length(Data.A)>182 if isfield(Data,'A')&isfield(Data,'Coord_x')&~isempty(Data.Coord_x) & isfield(Data,'Coord_y')&... 83 ~isempty(Data.Coord_y)&length(Data.A)>1 84 84 iscalar=1; 85 85 A{1}=Data.A; … … 96 96 if test_1 97 97 DataOut_1=phys_1(Data_1,Calib{2},origin_xy,radius_offset,angle_offset,angle_scale); 98 if isfield(Data_1,'A')&isfield(Data_1,' AX')&~isempty(Data_1.AX) & isfield(Data_1,'AY')&...99 ~isempty(Data_1. AY)&length(Data_1.A)>198 if isfield(Data_1,'A')&isfield(Data_1,'Coord_x')&~isempty(Data_1.Coord_x) & isfield(Data_1,'Coord_y')&... 99 ~isempty(Data_1.Coord_y)&length(Data_1.A)>1 100 100 iscalar=iscalar+1; 101 101 Calib{iscalar}=Calib{2}; … … 105 105 end 106 106 if iscalar==1% case for which only the second field is a scalar 107 [A, AX,AY]=phys_Ima_polar(A,Calib,ZIndex,origin_xy,radius_offset,angle_offset,angle_scale);107 [A,Coord_x,Coord_y]=phys_Ima_polar(A,Calib,ZIndex,origin_xy,radius_offset,angle_offset,angle_scale); 108 108 DataOut_1.A=A{1}; 109 DataOut_1. AX=AX;110 DataOut_1. AY=AY;109 DataOut_1.Coord_x=Coord_x; 110 DataOut_1.Coord_y=Coord_y; 111 111 return 112 112 end … … 114 114 end 115 115 if iscalar~=0 116 [A, AX,AY]=phys_Ima_polar(A,Calib,ZIndex,origin_xy,radius_offset,angle_offset,angle_scale);%116 [A,Coord_x,Coord_y]=phys_Ima_polar(A,Calib,ZIndex,origin_xy,radius_offset,angle_offset,angle_scale);% 117 117 DataOut.A=A{1}; 118 DataOut. AX=AX;119 DataOut. AY=AY;118 DataOut.Coord_x=Coord_x; 119 DataOut.Coord_y=Coord_y; 120 120 if iscalar==2 121 121 DataOut_1.A=A{2}; 122 DataOut_1. AX=AX;123 DataOut_1. AY=AY;122 DataOut_1.Coord_x=Coord_x; 123 DataOut_1.Coord_y=Coord_y; 124 124 end 125 125 end -
trunk/src/uvmat.m
r781 r782 83 83 % velocity vectors. The scalar values in the first case is represented by 84 84 % UvData.Field.A, and by UvData.Field.C in the second case. The corresponding set of X 85 % and Y axes are represented by UvData.Field. AX and UvData.Field.AY, and .X and85 % and Y axes are represented by UvData.Field.Coord_x and UvData.Field.Coord_y, and .X and 86 86 % .Y for C (the same as velocity vectors). If A is a nxxny matrix (scalar 87 % on a regtular grid), then . AX andf.AYcontains only two elements, represneting the87 % on a regtular grid), then .Coord_x andf.Coord_y contains only two elements, represneting the 88 88 % axes of the four image corners. The scalar name is represented by 89 89 % the strings .AName and/or .CName. … … 1145 1145 set(handles_Fields,'String',{'image'}) 1146 1146 %set(handles.Coord_x,'Value',1); 1147 set(handles.Coord_x,'String',' AX');1148 set(handles.Coord_y,'String',' AY');1147 set(handles.Coord_x,'String','Coord_x'); 1148 set(handles.Coord_y,'String','Coord_y'); 1149 1149 end 1150 1150 set(handles.uvmat,'UserData',UvData) … … 1497 1497 set(hmask,'CData',imflag) 1498 1498 set(hmask,'AlphaData',flagmask*0.6) 1499 set(hmask,'XData',MaskField. AX);1500 set(hmask,'YData',MaskField. AY);1499 set(hmask,'XData',MaskField.Coord_x); 1500 set(hmask,'YData',MaskField.Coord_y); 1501 1501 % uistack(hmask,'top') 1502 1502 else 1503 1503 axes(handles.PlotAxes) 1504 1504 hold on 1505 Mask.maskhandle=image(MaskField. AX,MaskField.AY,imflag,'Tag','mask','HitTest','off','AlphaData',0.6*ones(size(flagmask)));1505 Mask.maskhandle=image(MaskField.Coord_x,MaskField.Coord_y,imflag,'Tag','mask','HitTest','off','AlphaData',0.6*ones(size(flagmask))); 1506 1506 set(handles.CheckMask,'UserData',Mask) 1507 1507 end … … 2691 2691 if isfield(ObjectData,'NbDim') && isequal(ObjectData.NbDim,2) && isfield(ObjectData,'Mask') && isfield(ObjectData,'A') 2692 2692 flag_mask=double(ObjectData.Mask>200);%=0 for masked regions 2693 AX=ObjectData.AX;%x coordiantes for the scalar field2694 AY=ObjectData.AY;%y coordinates for the scalar field2693 Coord_x=ObjectData.Coord_x;%x coordiantes for the scalar field 2694 Coord_y=ObjectData.Coord_y;%y coordinates for the scalar field 2695 2695 MaskX=ObjectData.MaskX;%x coordiantes for the mask 2696 2696 MaskY=ObjectData.MaskY;%y coordiantes for the mask 2697 if ~isequal(MaskX, AX)||~isequal(MaskY,AY)2697 if ~isequal(MaskX,Coord_x)||~isequal(MaskY,Coord_y) 2698 2698 nxy=size(flag_mask); 2699 2699 sizpx=(ObjectData.MaskX(end)-ObjectData.MaskX(1))/(nxy(2)-1);%size of a mask pixel … … 2703 2703 %project on the positions of the scalar 2704 2704 npxy=size(ObjectData.A); 2705 dxy(1)=(ObjectData. AY(end)-ObjectData.AY(1))/(npxy(1)-1);%grid mesh in y2706 dxy(2)=(ObjectData. AX(end)-ObjectData.AX(1))/(npxy(2)-1);%grid mesh in x2707 xi=ObjectData. AX(1):dxy(2):ObjectData.AX(end);2708 yi=ObjectData. AY(1):dxy(1):ObjectData.AY(end);2705 dxy(1)=(ObjectData.Coord_y(end)-ObjectData.Coord_y(1))/(npxy(1)-1);%grid mesh in y 2706 dxy(2)=(ObjectData.Coord_x(end)-ObjectData.Coord_x(1))/(npxy(2)-1);%grid mesh in x 2707 xi=ObjectData.Coord_x(1):dxy(2):ObjectData.Coord_x(end); 2708 yi=ObjectData.Coord_y(1):dxy(1):ObjectData.Coord_y(end); 2709 2709 [XI,YI]=meshgrid(xi,yi);% creates the matrix of regular coordinates 2710 2710 flag_mask = interp2(x_mask,y_mask,flag_mask,XI,YI); … … 3641 3641 data.DX=UvData.Field.CoordMesh; 3642 3642 data.DY=UvData.Field.CoordMesh; 3643 elseif isfield(UvData.Field,' AX')&isfield(UvData.Field,'AY')& isfield(UvData.Field,'A')%only image3643 elseif isfield(UvData.Field,'Coord_x')&isfield(UvData.Field,'Coord_y')& isfield(UvData.Field,'A')%only image 3644 3644 np=size(UvData.Field.A); 3645 meshx=(UvData.Field. AX(end)-UvData.Field.AX(1))/np(2);3646 meshy=abs(UvData.Field. AY(end)-UvData.Field.AY(1))/np(1);3645 meshx=(UvData.Field.Coord_x(end)-UvData.Field.Coord_x(1))/np(2); 3646 meshy=abs(UvData.Field.Coord_y(end)-UvData.Field.Coord_y(1))/np(1); 3647 3647 data.RangeY=max(meshx,meshy); 3648 3648 data.RangeX=max(meshx,meshy); … … 5381 5381 figure 5382 5382 plot(theta_ref,r_ref) 5383 azimuth_ima=linspace(DataOut. AY(1),DataOut.AY(2),size(DataOut.A,1));%profile of x index on the transformed image5383 azimuth_ima=linspace(DataOut.Coord_y(1),DataOut.Coord_y(2),size(DataOut.A,1));%profile of x index on the transformed image 5384 5384 dist_source = interp1(theta_ref,r_ref,azimuth_ima); 5385 dist_source_pixel=round(size(DataOut.A,2)*(dist_source-DataOut. AX(1))/(DataOut.AX(2)-DataOut.AX(1)));5385 dist_source_pixel=round(size(DataOut.A,2)*(dist_source-DataOut.Coord_x(1))/(DataOut.Coord_x(2)-DataOut.Coord_x(1))); 5386 5386 line_nan= isnan(dist_source_pixel); 5387 5387 dist_source_pixel(line_nan)=1;
Note: See TracChangeset
for help on using the changeset viewer.