Changeset 955 for trunk/src/proj_field.m


Ignore:
Timestamp:
Jun 22, 2016, 7:54:40 PM (5 years ago)
Author:
sommeria
Message:

various

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/proj_field.m

    r954 r955  
    955955test90x=0;%=1 for 90 degree rotation alround x axis
    956956test90y=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 end   
     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% end   
    965965if isfield(ObjectData,'Angle')&& isequal(size(ObjectData.Angle),[1 3])&& ~isequal(ObjectData.Angle,[0 0 0])
    966966    test90y=isequal(ObjectData.Angle,[0 90 0]);
     
    996996end
    997997InterpMesh=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 computation
    1000 end
     998% if strcmp(ObjectData.Type,'plane_z')
     999%     InterpMesh=10*InterpMesh;%TODO: temporary, to shorten computation
     1000% end
    10011001
    10021002%% extrema along each axis
     
    16741674                    YI=Origin(2)+ix(2)*Grid_x+iy(2)*Grid_y+iz(2)*Grid_z;
    16751675                    ZI=Origin(3)+ix(3)*Grid_x+iy(3)*Grid_y+iz(3)*Grid_z;
    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]);
     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]);
    16801680                    for ivar=VarIndex
    16811681                            VarName=FieldData.ListVarName{ivar};
    16821682                            ListVarName=[ListVarName VarName];
    16831683                            VarAttribute{length(ListVarName)}=FieldData.VarAttribute{ivar}; %reproduce the variable attributes
     1684                            FieldData.(VarName)=permute(FieldData.(VarName),[2 3 1]);
    16841685                            ProjData.(VarName)=interp3(X,Y,Z,double(FieldData.(VarName)),XI,YI,ZI);
    16851686                    end
Note: See TracChangeset for help on using the changeset viewer.