Changeset 1002 for trunk


Ignore:
Timestamp:
Feb 28, 2017, 10:41:54 AM (4 years ago)
Author:
sommeria
Message:

correlation_time and correlation_x corrected

Location:
trunk/src
Files:
1 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/calc_field_interp.m

    r988 r1002  
    8282                    Data.strain=Data.DjUi(:,1,2)+Data.DjUi(:,2,1);
    8383            end
    84             InputVarList=[InputVarList UName{ilist}]; %the variable is added to the list if it is not already in the list
     84            InputVarList=[InputVarList UName{ilist}]; %the variable is added to the list if iTriScatteredInterpt is not already in the list
    8585        else % case 'norm' for instance
    8686            UName{ilist}=r.UName;
  • trunk/src/proj_field.m

    r977 r1002  
    730730                        if  strcmp(ProjData.VarAttribute{nbvar+ivar}.Role,'vector_x');
    731731                            ivar_U=nbvar+ivar;
    732                         elseif strcmp(ProjData.VarAttribute{nbvar+ivar}.Role,'vector_y');
     732                        elseif strcmp(ProjData.VarAttribute{nbvar+ivar}.Role,'vector_y');TriScatteredInterp
    733733                            ivar_V=nbvar+ivar;
    734734                        end
    735735                    end
    736                     ProjData.VarAttribute{ivar+nbvar}.Role='discrete';% will promote plots of the profiles with continuous lines
     736                    ProjData.VarAttribute{ivar+nbvar}.Role='discrete';% will promote plots of the profiles with continuoval(['us lines
    737737                end
    738738            elseif isequal(ProjMode,'interp_lin')  %filtering %linear interpolation:
    739739                if ~check_abscissa
    740740                    XName=FieldData.ListVarName{CellInfo{icell}.CoordIndex(end)};
    741                     ProjData.ListVarName=[ProjData.ListVarName {XName}];
     741                    ProjData.ListVarName=[ProjData.ListVarName {XName}];TriScatteredInterp
    742742                    ProjData.VarDimName=[ProjData.VarDimName {XName}];
    743743                    nbvar=numel(ProjData.ListVarName);
     
    811811            end%
    812812            test_interp2=0;%default
    813             AYName=FieldData.ListVarName{CellInfo{icell}.CoordIndex(end-1)};
    814             AXName=FieldData.ListVarName{CellInfo{icell}.CoordIndex(end)};
    815             AX=FieldData.(AXName);% set of x positions
    816             AY=FieldData.(AYName);% set of y positions
    817             AName=FieldData.ListVarName{VarIndex(1)};
    818             npxy=size(FieldData.(AName));
     813           
    819814            if max(NbDim)==3 % 3D case
     815                AZName=FieldData.ListVarName{CellInfo{icell}.CoordIndex(end)};
     816                AYName=FieldData.ListVarName{CellInfo{icell}.CoordIndex(end-1)};
     817                AXName=FieldData.ListVarName{CellInfo{icell}.CoordIndex(end-2)};
     818                AX=FieldData.(AXName);% set of x positions
     819                AY=FieldData.(AYName);% set of y positions
     820                AZ=FieldData.(AZName);% set of z positions
     821                 AName=FieldData.ListVarName{VarIndex(1)};
     822                npxy=size(FieldData.(AName));
     823                npz=npxy(1);
     824                npy=npxy(2);
     825                npx=npxy(1);
     826                AXI=linspace(AX(1),AX(end), npx);%set of  x  positions for the interpolated input data
     827                AYI=linspace(AY(1),AY(end), npy);%set of  x  positions for the interpolated input data
     828                 AZI=linspace(AZ(1),AZ(end), npy);%set of  x  positions for the interpolated input data
     829                for ivar=VarIndex
     830                    VarName=FieldData.ListVarName{ivar};
     831                    FieldData.(VarName)=interp3(FieldData.(AXName),FieldData.(AYName),FieldData.(AZName),FieldData.(VarName),AXI,AYI,AZI);
     832
     833%                     vec_A=reshape(squeeze(FieldData.(FieldData.ListVarName{ivar})),npx*npy,nbcolor); %put the original image in colum
     834%                     if nbcolor==1
     835%                         vec_B(ind_in)=vec_A(ICOMB);
     836%                         vec_B(ind_out)=zeros(size(ind_out));
     837%                         A_out=reshape(vec_B,npY,npX);
     838%                         ProjData.(FieldData.ListVarName{ivar}) =sum(A_out,1)/npY;
     839%                     elseif nbcolor==3
     840%                         vec_B(ind_in,1:3)=vec_A(ICOMB,:);
     841%                         vec_B(ind_out,1)=zeros(size(ind_out));
     842%                         vec_B(ind_out,2)=zeros(size(ind_out));
     843%                         vec_B(ind_out,3)=zeros(size(ind_out));
     844%                         A_out=reshape(vec_B,npY,npX,nbcolor);
     845%                         ProjData.(FieldData.ListVarName{ivar})=squeeze(sum(A_out,1)/npY);
     846%                     end
     847                    ProjData.ListVarName=[ProjData.ListVarName FieldData.ListVarName{ivar}];
     848                    ProjData.VarDimName=[ProjData.VarDimName {AXName}];%to generalize with the initial name of the x coordinate
     849                    ProjData.VarAttribute{ivar}.Role='continuous';% for plot with continuous line
     850                end
     851               
     852               
     853               
     854               
    820855               
    821856            else
     857                AYName=FieldData.ListVarName{CellInfo{icell}.CoordIndex(end-1)};
     858                AXName=FieldData.ListVarName{CellInfo{icell}.CoordIndex(end)};
     859                AX=FieldData.(AXName);% set of x positions
     860                AY=FieldData.(AYName);% set of y positions
     861                AName=FieldData.ListVarName{VarIndex(1)};
     862                npxy=size(FieldData.(AName));
    822863                npx=npxy(2);
    823864                npy=npxy(1);
     
    860901                    XMin=0;
    861902                end
    862                 eval(['ProjData.' AXName '=linspace(XMin,XMin+linelength,linelength/DXY_line+1);'])%abscissa of the new pixels along the line
     903                ProjData.(AXName)=linspace(XMin,XMin+linelength,linelength/DXY_line+1);%abscissa of the new pixels along the line
    863904                y=linspace(-width,width,2*width/DXY_line+1);%ordintes of the new pixels (coordinate across the line)
    864                 eval(['npX=length(ProjData.' AXName ');'])
     905                npX=length(ProjData.(AXName));
    865906                npY=length(y); %TODO: utiliser proj_grid
    866                 eval(['[X,Y]=meshgrid(ProjData.' AXName ',y);'])%grid in the line coordinates
     907                [X,Y]=meshgrid(ProjData.(AXName),y);%grid in the line coordinates
    867908                XIMA=ObjectData.Coord(1,1)+(X-XMin)*cos(theta)-Y*sin(theta);
    868909                YIMA=ObjectData.Coord(1,2)+(X-XMin)*sin(theta)+Y*cos(theta);
     
    876917                ICOMB=(XIMA-1)*npy+YIMA;
    877918                ICOMB=ICOMB(flagin);%index corresponding to XIMA and YIMA in the aligned original image vec_A
    878                 nbcolor=1; %color images
    879919                if numel(npxy)==2
    880920                    nbcolor=1;
     
    886926                    return
    887927                end
    888                 nbvar=length(ProjData.ListVarName);% number of var from previous cells
    889928                ProjData.ListVarName=[ProjData.ListVarName {AXName}];
    890929                ProjData.VarDimName=[ProjData.VarDimName {AXName}];
     
    916955                end
    917956            end
    918 
    919 end
     957           
     958    end
    920959if ~isempty(ivar_U) && ~isempty(ivar_V)
    921960    vector_x =ProjData.(ProjData.ListVarName{ivar_U});
  • trunk/src/read_field.m

    r1001 r1002  
    175175        if CheckStructured
    176176            for ilist=NbCoord+1:numel(Field.VarDimName)
    177                 rank(1)=find(strcmp(ParamIn.Coord_x,Field.VarDimName{ilist}));
    178                 rank(2)=find(strcmp(ParamIn.Coord_y,Field.VarDimName{ilist}));
    179                 if NbCoord==3
    180                 rank(3)=find(strcmp(ParamIn.Coord_z,Field.VarDimName{ilist}));
    181                 end
    182                 rank=flip(rank);
    183                 VarName=Field.ListVarName{ilist};
    184                 Field.(VarName)=permute(Field.(VarName),rank);
    185                 Field.VarDimName{ilist}=Field.VarDimName{ilist}(rank);% permute the order of dimensions
    186             end
    187         end             
     177                if numel(Field.VarDimName{ilist})==NbCoord
     178                    rank(1)=find(strcmp(ParamIn.Coord_x,Field.VarDimName{ilist}));
     179                    rank(2)=find(strcmp(ParamIn.Coord_y,Field.VarDimName{ilist}));
     180                    if NbCoord==3
     181                        rank(3)=find(strcmp(ParamIn.Coord_z,Field.VarDimName{ilist}));
     182                    end
     183                    rank=rank(end:-1:1);
     184                    VarName=Field.ListVarName{ilist};
     185                    Field.(VarName)=permute(Field.(VarName),rank);
     186                    Field.VarDimName{ilist}=Field.VarDimName{ilist}(rank);% permute the order of dimensions
     187                end
     188            end
     189        end
    188190        NormName='';
    189191        UName='';
  • trunk/src/series/extract_multitif.m

    r977 r1002  
    5959%=======================================================================
    6060
    61 function ParamOut=extract_multitif(Param)
     61function ParamOut=extract_multitif_parallel(Param)
    6262
    6363%%%%%%%%%%%%%%%%%    INPUT PREPARATION MODE (no RUN)    %%%%%%%%%%%%%%%%%
     
    6565    ParamOut.AllowInputSort='off';% allow alphabetic sorting of the list of input file SubDir (options 'off'/'on', 'off' by default)
    6666    ParamOut.WholeIndexRange='on';% prescribes the file index ranges from min to max (options 'off'/'on', 'off' by default)
    67     ParamOut.NbSlice=1; % impose calculation in a single process (no parallel processing to avoid 'holes'))
     67    ParamOut.NbSlice='off'; % impose calculation in a single process (no parallel processing to avoid 'holes'))
    6868    ParamOut.VelType='off';% menu for selecting the velocity type (options 'off'/'one'/'two',  'off' by default)
    6969    ParamOut.FieldName='off';% menu for selecting the field (s) in the input file(options 'off'/'one'/'two', 'off' by default)
     
    7373    ParamOut.OutputDirExt='.png';%set the output dir extension
    7474    ParamOut.OutputFileMode='NbSlice';% '=NbInput': 1 output file per input file index, '=NbInput_i': 1 file per input file index i, '=NbSlice': 1 file per slice
    75      ParamOut.CheckOverwriteVisible='on'; % manage the overwrite of existing files (default=1)
     75      ParamOut.CheckOverwriteVisible='on'; % manage the overwrite of existing files (default=1)
    7676    %% root input file(s) and type
    7777    % check the existence of the first file in the series
     
    9595        return
    9696    end
    97     xmlinput=uigetfile_uvmat('pick xml file for timing',fileparts(fileparts(FirstFileName)),'.xml');
    98     [tild,ParamOut.ActionInput.XmlFile]=fileparts(xmlinput);
    99     ParamOut.ActionInput.XmlFile
    100    
     97    ParamOut.ActionInput.XmlFile=uigetfile_uvmat('pick xml file for timing',fileparts(fileparts(FirstFileName)),'.xml'); 
    10198    return
    10299end
     
    111108    checkrun=0;
    112109else
    113 hseries=findobj(allchild(0),'Tag','series');
    114 RUNHandle=findobj(hseries,'Tag','RUN');%handle of RUN button in GUI series
    115 WaitbarHandle=findobj(hseries,'Tag','Waitbar');%handle of waitbar in GUI series
     110    hseries=findobj(allchild(0),'Tag','series');
     111    RUNHandle=findobj(hseries,'Tag','RUN');%handle of RUN button in GUI series
     112    WaitbarHandle=findobj(hseries,'Tag','Waitbar');%handle of waitbar in GUI series
    116113end
    117114
    118115%% list of input images
    119 DirImages=fullfile(Param.InputTable{1,1},Param.InputTable{1,2});
    120 ListStruct=dir(DirImages);   
    121 ListCells=struct2cell(ListStruct);% transform dir struct to a cell arrray
    122 check_bad=strcmp('.',ListCells(1,:))|strcmp('..',ListCells(1,:));%detect the dir '.' to exclude it
    123 check_dir=cell2mat(ListCells(4,:));% =1 for directories, =0 for files
    124 ListFile=ListCells(1,find(~check_dir & ~check_bad));
     116% DirImages=fullfile(Param.InputTable{1,1},Param.InputTable{1,2});
     117% ListStruct=dir(DirImages);
     118% ListCells=struct2cell(ListStruct);% transform dir struct to a cell arrray
     119% check_bad=strcmp('.',ListCells(1,:))|strcmp('..',ListCells(1,:));%detect the dir '.' to exclude it
     120% check_dir=cell2mat(ListCells(4,:));% =1 for directories, =0 for files
     121% ListFile=ListCells(1,find(~check_dir & ~check_bad));
    125122
    126123%% check file names
    127 RootName=regexprep(ListFile{1},'.tif$','')
    128 for ilist=2:numel(ListFile)
    129     rank=regexprep(ListFile{ilist},'.tif$','');
    130     rank=regexprep(rank,['^' RootName '@'],'');
    131     if ~isequal(str2num(rank),ilist-1)
    132         disp(['error in the list of input file # ' num2str(ilist-1)])
    133         return
    134     end
    135 end
     124% RootName=regexprep(ListFile{1},'.tif$','')
     125% rank(1)=1;
     126% for ilist=2:numel(ListFile)
     127%     rank_str=regexprep(ListFile{ilist},'.tif$','');
     128%     rank(ilist)=regexprep(rank_str,['^' RootName '@'],'');
     129% %     if ~isequal(str2num(rank),ilist-1)
     130% %         disp(['error in the list of input file # ' num2str(ilist-1)])
     131% %         return
     132% %     end
     133% end
    136134
    137135%% output directory
    138  OutputDir=fullfile(Param.InputTable{1,1},[Param.OutputSubDir Param.OutputDirExt]);
    139  
    140 %% Timing
    141 XmlInputFile=fullfile(Param.InputTable{1,1},[Param.ActionInput.XmlFile '.xml'])
    142 XmlInput=imadoc2struct(XmlInputFile,'Camera');
     136OutputDir=fullfile(Param.InputTable{1,1},[Param.OutputSubDir Param.OutputDirExt]);
     137
     138%% Timing
     139XmlInputFile=Param.ActionInput.XmlFile;
     140[XmlInput,errormsg]=imadoc2struct(XmlInputFile,'Camera');
     141if ~isempty(errormsg)
     142    disp(['bad xml input file: ' errormsg])
     143    return
     144end
     145ImagesPerLevel=size(XmlInput.Time,2)-1;%100;%use the xmlinformation to get the nbre of j indices
     146
     147%% create the xml file of PCO camera if it does not exist
     148Newxml=fullfile(Param.InputTable{1,1},[Param.InputTable{1,2} '.xml']);
     149if ~exist(Newxml,'file')
     150XmlInput.Camera.CameraName='PCO';
     151XmlInput=rmfield(XmlInput,'Time');
     152XmlInput=rmfield(XmlInput,'TimeUnit');
     153t=struct2xml(XmlInput);
     154t=set(t,1,'name','ImaDoc');
     155save(t,Newxml);
     156end
    143157
    144158%% Main loop
    145159
    146 ImagesPerLevel=size(XmlInput.Time,2)-1;%100;
    147 count=0;
     160
     161% count=0;
    148162%count=316;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%CORRECTION EXP08: 4684 images -> start at 316 start 67->_11_1
    149163%count=1934%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%CORRECTION EXP07: 3066 images
    150 %% loop on the files 
    151 for ifile=1:numel(ListFile)
    152     update_waitbar(WaitbarHandle,ifile/numel(ListFile))
    153     if ~isempty(RUNHandle)&& ~strcmp(get(RUNHandle,'BusyAction'),'queue')
    154         disp('program stopped by user')
    155         break
    156     end
    157     ImageName=fullfile(DirImages,ListFile{ifile});
     164%% loop on the files
     165% include the first tiff file with no index in the first iteration
     166if Param.IndexRange.first_i==1% first slice of processing
     167    firstindex=0;
     168   count=0;
     169else
     170    firstindex=Param.IndexRange.first_i;
     171    ImageName=fullfile(Param.InputTable{1,1},Param.InputTable{1,2},'im.tif');
    158172    NbFrames=numel(imfinfo(ImageName));
    159     % loop on the frames within the tiff file
    160     for iframe=1:NbFrames       
     173   count=Param.IndexRange.first_i*NbFrames;
     174end
     175for ifile=firstindex:Param.IndexRange.last_i
     176    if firstindex==0 && ifile==0% first slice of processing
     177        ImageName=fullfile(Param.InputTable{1,1},Param.InputTable{1,2},'im.tif')
     178    else
     179        ImageName=fullfile(Param.InputTable{1,1},Param.InputTable{1,2},['im@' num2str(ifile,'%04d') '.tif'])
     180    end
     181    NbFrames=numel(imfinfo(ImageName));
     182    for iframe=1:NbFrames
     183        iframe
    161184        if isequal(ImagesPerLevel,1)% mode series
    162             i_index=count+1;
    163185            OutputFile=fullfile(OutputDir,['img_' num2str(count+1) '.png']);
    164186        else % indices i and j
     
    178200end
    179201
    180 % for ifile=1:numel(ListFile)
    181 %     update_waitbar(WaitbarHandle,ifile/numel(ListFile))
    182 %     if ~isempty(RUNHandle)&& ~strcmp(get(RUNHandle,'BusyAction'),'queue')
    183 %         disp('program stopped by user')
    184 %         break
    185 %     end
    186 %     ImageName=fullfile(DirImages,ListFile{ifile});
    187 %     NbFrames=numel(imfinfo(ImageName));
    188 %     % loop on the frames within the tiff file
    189 %     for iframe=1:NbFrames     
    190 %         A=imread(ImageName,iframe);
    191 %
    192 %         if isequal(ImagesPerLevel,1)% mode series
    193 %             i_index=count+1;
    194 %             OutputFile=fullfile(OutputDir,['img_' num2str(count+1) '.png']);
    195 %         else % indices i and j
    196 %             i_index=fix(count/ImagesPerLevel)+1;
    197 %             j_index=mod(count,ImagesPerLevel)+1;
    198 %             OutputFile=fullfile(OutputDir,['img_' num2str(i_index) '_' num2str(j_index) '.png']);
    199 %         end
    200 %         imwrite(A,OutputFile,'BitDepth',16)
    201 %         count=count+1;
    202 %     end
    203 % end
    204 
    205 %% create the xml file of PCO camera
    206 XmlInput.Camera.CameraName='PCO';
    207 t=struct2xml(XmlInput.Camera);
    208 t=set(t,1,'name','ImaDoc');
    209 save(t,fullfile(Param.InputTable{1,1},'PCO.xml'))
    210 
    211 %% remove initial files if transfer OK
    212 %     if i_index== (size(XmlInput.Time,1)-1)
    213 %
    214 %         [SUCCESS,MESSAGE]=rmdir(DirImages,'s')
    215 %       
    216 %     end
     202
     203
  • trunk/src/series/turb_correlation_time.m

    r1001 r1002  
    5757%=======================================================================
    5858
    59 function ParamOut=turb_stat(Param)
     59function ParamOut=turb_correlation_time(Param)
    6060
    6161%% set the input elements needed on the GUI series when the action is selected in the menu ActionName
     
    6363    ParamOut.AllowInputSort='off';% allow alphabetic sorting of the list of input file SubDir (options 'off'/'on', 'off' by default)
    6464    ParamOut.WholeIndexRange='off';% prescribes the file index ranges from min to max (options 'off'/'on', 'off' by default)
    65     ParamOut.NbSlice='off'; %nbre of slices ('off' by default)
     65    ParamOut.NbSlice=1; %nbre of slices ('off' by default)
    6666    ParamOut.VelType='off';% menu for selecting the velocity type (options 'off'/'one'/'two',  'off' by default)
    6767    ParamOut.FieldName='one';% menu for selecting the field (s) in the input file(options 'off'/'one'/'two', 'off' by default)
     
    277277        FFCorr=false(NpTime+1,npy,npx);
    278278    end
     279    Field.U=Field.U-UMean;
     280    Field.V=Field.V-VMean;
    279281    FF=isnan(Field.U);%|Field.U<-60|Field.U>30;% threshold on U
    280282    Field.U(FF)=0;% set to 0 the nan values,'delta_x'
    281283    Field.V(FF)=0;
    282     Field.U=Field.U-UMean;
    283     Field.V=Field.V-VMean;
    284284    if index<=NpTime+1
    285         U_shift(index,:,:)=Field.U;
    286         V_shift(index,:,:)=Field.V;
    287         FF_shift(index,:,:)=FF;
     285        U_shift(NpTime+2-index,:,:)=Field.U;
     286        V_shift(NpTime+2-index,:,:)=Field.V;
     287        FF_shift(NpTime+2-index,:,:)=FF;
    288288    else
    289         U_shift=circshift(U_shift,[-1 0 0]); %shift U by ishift along the first index
    290         V_shift=circshift(V_shift,[-1 0 0]); %shift U by ishift along the first index
    291         FF_shift=circshift(FF_shift,[-1 0 0]); %shift U by ishift along the first index
    292         U_shift(NpTime+1,:,:)=Field.U;
    293         V_shift(NpTime+1,:,:)=Field.V;
    294         FF_shift(NpTime+1,:,:)=FF;
    295     end
    296     for ishift=1:NpTime% calculate the field U shifted
    297         UUCorr(ishift,:,:)=Field.U.*U_shift(ishift,:,:);
    298         VVCorr(ishift,:,:)=Field.V.*V_shift(ishift,:,:);
    299         UVCorr(ishift,:,:)=Field.U.*V_shift(ishift,:,:);
    300         FFCorr(ishift,:,:)=FF | FF_shift;
     289        U_shift=circshift(U_shift,[1 0 0]); %shift U by ishift along the first index
     290        V_shift=circshift(V_shift,[1 0 0]); %shift U by ishift along the first index
     291        FF_shift=circshift(FF_shift,[1 0 0]); %shift U by ishift along the first index
     292        U_shift(1,:,:)=Field.U;
     293        V_shift(1,:,:)=Field.V;
     294        FF_shift(1,:,:)=FF;
     295    end
     296    for ishift=1:NpTime+1% calculate the field U shifted
     297        UUCorr(ishift,:,:)=Field.U.*squeeze(U_shift(ishift,:,:));
     298        VVCorr(ishift,:,:)=Field.V.*squeeze(V_shift(ishift,:,:));
     299        UVCorr(ishift,:,:)=Field.U.*squeeze(V_shift(ishift,:,:));
     300        FFCorr(ishift,:,:)=FF | squeeze(FF_shift(ishift,:,:));
    301301    end
    302302    DataOut.UUCorr=DataOut.UUCorr+UUCorr;
     
    306306end
    307307%%%%%%%%%%%%%%%% end loop on field indices %%%%%%%%%%%%%%%%
    308 % DataOut.UUCorr=DataOut.UUCorr./DataOut.Counter;
    309 % DataOut.VVCorr=DataOut.VVCorr./DataOut.Counter;
    310 % DataOut.VUVCorr=DataOut.UVCorr./DataOut.Counter;
    311 %DataOut.Counter(DataOut.Counter==0)=1;% put counter to 1 when it is zero
     308DataOut.Counter(DataOut.Counter==0)=1;% put counter to 1 when it is zero (to avoid NaN)
     309DataOut.UUCorr=DataOut.UUCorr./DataOut.Counter;
     310DataOut.VVCorr=DataOut.VVCorr./DataOut.Counter;
     311DataOut.UVCorr=DataOut.UVCorr./DataOut.Counter;
     312
    312313% DataOut.UMean=DataOut.UMean./DataOut.Counter; % normalize the mean
    313314% DataOut.VMean=DataOut.VMean./DataOut.Counter; % normalize the mean
  • trunk/src/series/turb_correlation_x.m

    r1001 r1002  
    5757%=======================================================================
    5858
    59 function ParamOut=turb_stat(Param)
     59function ParamOut=turb_correlation_x(Param)
    6060
    6161%% set the input elements needed on the GUI series when the action is selected in the menu ActionName
     
    290290DataOut.UUCorr=DataOut.UUCorr./DataOut.Counter;
    291291DataOut.VVCorr=DataOut.VVCorr./DataOut.Counter;
    292 DataOut.VUVCorr=DataOut.UVCorr./DataOut.Counter;
     292DataOut.UVCorr=DataOut.UVCorr./DataOut.Counter;
    293293%DataOut.Counter(DataOut.Counter==0)=1;% put counter to 1 when it is zero
    294294% DataOut.UMean=DataOut.UMean./DataOut.Counter; % normalize the mean
  • trunk/src/uvmat.m

    r1001 r1002  
    977977                data.RangeX=UvData.Field.XMin ;
    978978                data.RangeY=UvData.Field.CoordMesh;
    979                 data.Coord=[UvData.Field.XMin (UvData.Field.YMin +UvData.Field.YMax)/2;...
    980                            UvData.Field.XMax (UvData.Field.YMin +UvData.Field.YMax)/2];% put line at the middle of the y axis
     979                if isfield(UvData.Field,'ZMin') && isfield(UvData.Field,'ZMax')
     980                    Coord_z=(UvData.Field.ZMin +UvData.Field.ZMax)/2;
     981                else
     982                    Coord_z=0;
     983                end
     984                data.Coord=[UvData.Field.XMin (UvData.Field.YMin +UvData.Field.YMax)/2 Coord_z;...
     985                           UvData.Field.XMax (UvData.Field.YMin +UvData.Field.YMax)/2 Coord_z];% put line at the middle of the y axis
    981986            case 'line_y'
    982987                check_plot=1; %plot the line directly when set_object is opened
     
    984989                data.RangeX=UvData.Field.YMin ;
    985990                data.RangeY=UvData.Field.CoordMesh;
    986                 data.Coord=[(UvData.Field.XMin+UvData.Field.XMax)/2 UvData.Field.YMin;...
    987                             (UvData.Field.XMin +UvData.Field.XMax)/2 UvData.Field.YMax];% put line at the middle of the y axis
     991                if isfield(UvData.Field,'ZMin') && isfield(UvData.Field,'ZMax')
     992                    Coord_z=(UvData.Field.ZMin +UvData.Field.ZMax)/2;
     993                else
     994                    Coord_z=0;
     995                end
     996                data.Coord=[(UvData.Field.XMin+UvData.Field.XMax)/2 UvData.Field.YMin Coord_z;...
     997                            (UvData.Field.XMin +UvData.Field.XMax)/2 UvData.Field.YMax Coord_z];% put line at the middle of the y axis
    988998            case {'rectangle','ellipse'}
    989999                data.RangeY=[UvData.Field.YMin UvData.Field.YMax];
Note: See TracChangeset for help on using the changeset viewer.