Ignore:
Timestamp:
May 27, 2010, 7:25:58 PM (15 years ago)
Author:
sommeria
Message:

FFT: improved to deal with NaN data
merge_proj: corrected to reproduce dt if unique
uvmat.fig: tooltip corrected
plot_field: bug for isocontour corrected,
im_filter: cleaning
phys_polar: spatial derivative included (still to check)
set_obeject.fig: minor correction
struct2nc: comments improved
uvmat: button NB implemented
read_civxdata: error message improved

Location:
trunk/src/transform_field
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/transform_field/im_filter.m

    r40 r93  
    1111
    1212DataOut=DataIn; %default
    13 
    1413Atype=class(DataIn.A)% detect integer 8 or 16 bits
    15 DataOut.A=filter2(Mfiltre,DataIn.A);
    16 DataOut.A=feval(Atype,DataOut.A);
     14if numel(size(DataIn.A))==3
     15    DataOut.A=filter2(Mfiltre,sum(DataIn.A,3));%filter the input image, after summation on the color component (for color images)
     16    DataOut.A=uint16(DataOut.A); %transform to 16 bit images
     17else
     18    DataOut.A=filter2(Mfiltre,DataIn.A)
     19    DataOut.A=feval(Atype,DataOut.A);%transform to the initial image format
     20end
    1721 
  • trunk/src/transform_field/phys_polar.m

    r40 r93  
    2828end
    2929test_1=0;
    30 if nargin==4
     30if nargin==4% case of two input fields
    3131    test_1=1;
    3232    Data_1=varargin{3};
     
    6565
    6666iscalar=0;
     67%transform first field to cartesian phys coordiantes
    6768if  ~isempty(Calib{1})
    6869    DataOut=phys_1(Data,Calib{1},origin_xy,radius_offset,angle_offset,angle_scale);
     
    8081    end
    8182end
    82 
     83%transform second field (if exists) to cartesian phys coordiantes
    8384if test_1
    8485    DataOut_1=phys_1(Data_1,Calib{2},origin_xy,radius_offset,angle_offset,angle_scale);
     
    153154            DataOut.V=(-UX.*sin(theta)+VY.*cos(theta));%./(DataOut.X)%+radius_ref);%angular velocity calculated
    154155            %shift and renormalize the angular velocity
     156            end
     157        end
     158        %transform of spatial derivatives
     159        if isfield(Data,'X') && ~isempty(Data.X) && isfield(Data,'DjUi') && ~isempty(Data.DjUi)...
     160                && isfield(Data,'dt')
     161            if ~isempty(Data.dt)
     162                % estimate the Jacobian matrix DXpx/DXphys
     163                for ip=1:length(Data.X)
     164                    [Xp1,Yp1]=phys_XYZ(Calib,Data.X(ip)+0.5,Data.Y(ip),Z);
     165                    [Xm1,Ym1]=phys_XYZ(Calib,Data.X(ip)-0.5,Data.Y(ip),Z);
     166                    [Xp2,Yp2]=phys_XYZ(Calib,Data.X(ip),Data.Y(ip)+0.5,Z);
     167                    [Xm2,Ym2]=phys_XYZ(Calib,Data.X(ip),Data.Y(ip)-0.5,Z);
     168                    %Jacobian matrix DXpphys/DXpx
     169                    DjXi(1,1)=(Xp1-Xm1);
     170                    DjXi(2,1)=(Yp1-Ym1);
     171                    DjXi(1,2)=(Xp2-Xm2);
     172                    DjXi(2,2)=(Yp2-Ym2);
     173                    DjUi(:,:)=Data.DjUi(ip,:,:);
     174                    DjUi=(DjXi*DjUi')/DjXi;% =J-1*M*J , curvature effects (derivatives of J) neglected
     175                    DataOut.DjUi(ip,:,:)=DjUi';
     176                end
     177                DataOut.DjUi =  DataOut.DjUi/Data.dt;   %     min(Data.DjUi(:,1,1))=DUDX
    155178            end
    156179        end
Note: See TracChangeset for help on using the changeset viewer.