Changeset 955 for trunk/src/proj_field.m
- Timestamp:
- Jun 22, 2016, 7:54:40 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/proj_field.m
r954 r955 955 955 test90x=0;%=1 for 90 degree rotation alround x axis 956 956 test90y=0;%=1 for 90 degree rotation alround y axis 957 if strcmp(ObjectData.Type,'plane_z')958 Delta_x=ObjectData.Coord(2,1)-ObjectData.Coord(1,1);959 Delta_y=ObjectData.Coord(2,2)-ObjectData.Coord(1,2);960 Delta_mod=sqrt(Delta_x*Delta_x+Delta_y*Delta_y);961 ObjectData.Angle=[0 0 0];962 ObjectData.Angle(1)=90*Delta_x/Delta_mod;963 ObjectData.Angle(2)=90*Delta_y/Delta_mod;964 end957 % if strcmp(ObjectData.Type,'plane_z') 958 % Delta_x=ObjectData.Coord(2,1)-ObjectData.Coord(1,1); 959 % Delta_y=ObjectData.Coord(2,2)-ObjectData.Coord(1,2); 960 % Delta_mod=sqrt(Delta_x*Delta_x+Delta_y*Delta_y); 961 % ObjectData.Angle=[0 0 0]; 962 % ObjectData.Angle(1)=90*Delta_x/Delta_mod; 963 % ObjectData.Angle(2)=90*Delta_y/Delta_mod; 964 % end 965 965 if isfield(ObjectData,'Angle')&& isequal(size(ObjectData.Angle),[1 3])&& ~isequal(ObjectData.Angle,[0 0 0]) 966 966 test90y=isequal(ObjectData.Angle,[0 90 0]); … … 996 996 end 997 997 InterpMesh=min(DX,DY);%mesh used for interpolation in a slanted plane 998 if strcmp(ObjectData.Type,'plane_z')999 InterpMesh=10*InterpMesh;%TODO: temporary, to shorten computation1000 end998 % if strcmp(ObjectData.Type,'plane_z') 999 % InterpMesh=10*InterpMesh;%TODO: temporary, to shorten computation 1000 % end 1001 1001 1002 1002 %% extrema along each axis … … 1674 1674 YI=Origin(2)+ix(2)*Grid_x+iy(2)*Grid_y+iz(2)*Grid_z; 1675 1675 ZI=Origin(3)+ix(3)*Grid_x+iy(3)*Grid_y+iz(3)*Grid_z; 1676 1677 X=permute(X,[3 1 2]);1678 Y=permute(Y,[3 1 2]);1679 Z=permute(Z,[3 1 2]);1676 [X,Y,Z]=meshgrid(Coord{3},Coord{2},Coord{1}); 1677 % X=permute(X,[3 1 2]); 1678 % Y=permute(Y,[3 1 2]); 1679 % Z=permute(Z,[3 1 2]); 1680 1680 for ivar=VarIndex 1681 1681 VarName=FieldData.ListVarName{ivar}; 1682 1682 ListVarName=[ListVarName VarName]; 1683 1683 VarAttribute{length(ListVarName)}=FieldData.VarAttribute{ivar}; %reproduce the variable attributes 1684 FieldData.(VarName)=permute(FieldData.(VarName),[2 3 1]); 1684 1685 ProjData.(VarName)=interp3(X,Y,Z,double(FieldData.(VarName)),XI,YI,ZI); 1685 1686 end
Note: See TracChangeset
for help on using the changeset viewer.