Changeset 1054 for trunk/src


Ignore:
Timestamp:
Jul 18, 2018, 10:31:09 AM (6 years ago)
Author:
sommeria
Message:

bed_scan updated

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/proj_field.m

    r1048 r1054  
    919919                    %VarName{ivar}=FieldData.ListVarName{ivar};
    920920                    if test_interp2% interpolate on new grid
    921                         FieldData.(FieldData.ListVarName{ivar})=interp2(FieldData.(AXName),FieldData.(AYName),FieldData.(FieldData.ListVarName{ivar}),AXI,AYI);%TO TEST
     921                        FieldData.(FieldData.ListVarName{ivar})=interp2(FieldData.(AXName),FieldData.(AYName),FieldData.(FieldData.ListVarName{ivar}),AXI,AYI');
    922922                    end
    923923                    vec_A=reshape(squeeze(FieldData.(FieldData.ListVarName{ivar})),npx*npy,nbcolor); %put the original image in colum
  • trunk/src/series/bed_scan.m

    r1053 r1054  
    151151%% Load the init bed scan
    152152
    153 y0=90.05;
    154 Mfiltre=ones(2,10);%filter matrix for imnages
     153y=90.05-0.05*i1_series{1};
     154Mfiltre=ones(2,10)/20;%filter matrix for imnages
    155155tic
    156156% y=zeros(1,nimages);
    157157% X_new=zeros(4096,nimages);
    158158x=1:4096;
    159 step=Param.IndexRange.incr_i;
    160159% img=1;
    161160%filecell{1,img}= list of the images _init
     
    167166    % filtering
    168167    a=filter2(Mfiltre,a);
    169     [~,iy]=max(a);
     168    [imax,iy]=max(a);
    170169    Z=squeeze(iy);
    171     Z_s(:,img)=smooth(Z,50,'rloess');
    172     y(img)=y0-(0.05.*step);
    173     y0=y(img);
     170    iy(imax<50)=NaN;
     171    Z_s(:,img)=smooth(Z,40,'rloess');
     172%     y(img)=y0-(0.05.*step);
     173%     y0=y(img);
    174174    X_new(:,img)=phys_scan(x,y(img));
    175175end
     
    211211    [imaxb,iyb]=max(b);
    212212    Zb=squeeze(iyb);
    213     Z_sb(:,img)=smooth(Zb,40,'rloess');
     213    iyb(imaxb<50)=NaN;
     214    Z_sb(:,img)=smooth(Zb,20,'rloess');
    214215end
    215216
    216217
    217218%% bed change
    218 
    219219dZ=Z_s-Z_sb;
    220220dZ_new=zeros(4096,nimages2);
    221 
    222 for img=1:nimages2
    223 dZ_new(:,img)=phys_scanz(dZ(:,img),y(img));
     221for img=1:nimages2 
     222    dZ_new(:,img)=phys_scanz(dZ(:,img),y(img));
    224223end
    225224
    226225
    227226%% PLOTS
    228 [Y_m,X_m]=meshgrid(y(1,:),X_new(:,1));
     227coord_x=X_new(1,end):0.1:X_new(end,end);
     228[Y_m,X_m]=meshgrid(y(1,:),coord_x);
    229229Y_new=Y';
    230230dZ_mesh=griddata(X_new,Y_new,dZ_new,X_m,Y_m);
     
    271271Data.VarAttribute{3}.Role='scalar';
    272272Data.VarAttribute{3}.unit='cm';
    273 Data.coord_x=X_new(:,1);
    274 Data.coord_y=y(1,:);
     273Data.coord_x=[coord_x(1) coord_x(end)];
     274Data.coord_y=[y(1) y(end)];
    275275Data.dZ=dZ_mesh';
    276276struct2nc(fullfile(DirOut,'dZ.nc'),Data)
  • trunk/src/uvmat.m

    r1051 r1054  
    39193919            UvData.ProjObject{1}.Angle=[0 0];
    39203920            if isfield(UvData.Field,'CoordUnit')
    3921                 UvData.ProjObject{1}.CoordUnit=CoordUnit;
     3921                UvData.ProjObject{1}.CoordUnit=UvData.Field.CoordUnit;
    39223922            end
    39233923        elseif isfield(UvData,'Z')
Note: See TracChangeset for help on using the changeset viewer.