Changeset 518 for trunk/src/transform_field
- Timestamp:
- Aug 17, 2012, 11:52:49 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/transform_field/phys.m
r507 r518 16 16 % Data_1, CalibData_1: same as Data, CalibData for the second field. 17 17 18 function [DataOut,DataOut_1]=phys(DataIn,XmlData,DataIn_1,XmlData_1)18 function DataOut=phys(DataIn,XmlData,DataIn_1,XmlData_1) 19 19 % A FAIRE: 1- verifier si DataIn est une 'field structure'(.ListVarName'): 20 20 % chercher ListVarAttribute, for each field (cell of variables): … … 144 144 end 145 145 146 % subtract fields 147 if ~isempty(DataOut_1) 148 DataOut=sub_field(DataOut,[],DataOut_1); 149 end 146 150 %------------------------------------------------ 147 151 %--- transform a single field … … 183 187 end 184 188 end 185 DataOut.ListVarName(ind_remove)=[]; 186 DataOut.VarDimName(ind_remove)=[]; 187 DataOut.VarAttribute(ind_remove)=[]; 189 if isfield(DataOut.VarAttribute{3},'VarIndex_tps') 190 DataOut.VarAttribute{3}=rmfield(DataOut.VarAttribute{3},'VarIndex_tps'); 191 end 192 193 if ~isempty(ind_remove) 194 DataOut.ListVarName(ind_remove)=[]; 195 DataOut.VarDimName(ind_remove)=[]; 196 DataOut.VarAttribute(ind_remove)=[]; 197 end 188 198 189 190 191 199 %% transform of spatial derivatives: TODO check the case with plane angles 192 if isfield(Data,'X') && ~isempty(Data.X) && isfield(Data,'DjUi') && ~isempty(Data.DjUi)... 193 && isfield(Data,'dt') 194 if ~isempty(Data.dt) 195 % estimate the Jacobian matrix DXpx/DXphys 196 for ip=1:length(Data.X) 197 [Xp1,Yp1]=phys_XYZ(Calib,Data.X(ip)+0.5,Data.Y(ip),ZIndex); 198 [Xm1,Ym1]=phys_XYZ(Calib,Data.X(ip)-0.5,Data.Y(ip),ZIndex); 199 [Xp2,Yp2]=phys_XYZ(Calib,Data.X(ip),Data.Y(ip)+0.5,ZIndex); 200 [Xm2,Ym2]=phys_XYZ(Calib,Data.X(ip),Data.Y(ip)-0.5,ZIndex); 200 if isfield(Data,'X') && ~isempty(Data.X) && isfield(Data,'DjUi') && ~isempty(Data.DjUi) 201 % estimate the Jacobian matrix DXpx/DXphys 202 for ip=1:length(Data.X) 203 [Xp1,Yp1]=phys_XYZ(Calib,Data.X(ip)+0.5,Data.Y(ip),ZIndex); 204 [Xm1,Ym1]=phys_XYZ(Calib,Data.X(ip)-0.5,Data.Y(ip),ZIndex); 205 [Xp2,Yp2]=phys_XYZ(Calib,Data.X(ip),Data.Y(ip)+0.5,ZIndex); 206 [Xm2,Ym2]=phys_XYZ(Calib,Data.X(ip),Data.Y(ip)-0.5,ZIndex); 201 207 %Jacobian matrix DXpphys/DXpx 202 DjXi(1,1)=(Xp1-Xm1); 203 DjXi(2,1)=(Yp1-Ym1); 204 DjXi(1,2)=(Xp2-Xm2); 205 DjXi(2,2)=(Yp2-Ym2); 206 DjUi(:,:)=Data.DjUi(ip,:,:); 207 DjUi=(DjXi*DjUi')/DjXi;% =J-1*M*J , curvature effects (derivatives of J) neglected 208 DataOut.DjUi(ip,:,:)=DjUi'; 209 end 210 DataOut.DjUi = DataOut.DjUi/Dt; % min(Data.DjUi(:,1,1))=DUDX 211 end 208 DjXi(1,1)=(Xp1-Xm1); 209 DjXi(2,1)=(Yp1-Ym1); 210 DjXi(1,2)=(Xp2-Xm2); 211 DjXi(2,2)=(Yp2-Ym2); 212 DjUi(:,:)=Data.DjUi(ip,:,:); 213 DjUi=(DjXi*DjUi')/DjXi;% =J-1*M*J , curvature effects (derivatives of J) neglected 214 DataOut.DjUi(ip,:,:)=DjUi'; 215 end 216 DataOut.DjUi = DataOut.DjUi/Dt; % min(Data.DjUi(:,1,1))=DUDX 212 217 end 213 218
Note: See TracChangeset
for help on using the changeset viewer.