Changeset 880


Ignore:
Timestamp:
Mar 4, 2015, 12:01:38 AM (9 years ago)
Author:
sommeria
Message:

various bug fixes

Location:
trunk/src
Files:
1 added
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/keyboard_callback.m

    r809 r880  
    6565            end
    6666        case 112%  key 'p'
    67             uvmat('runplus_Callback',hObject,eventdata,handleshaxes)
     67            huvmat=findobj(allchild(0),'Tag','uvmat');
     68            if ~isempty(huvmat)
     69            hhuvmat=guidata(huvmat);
     70            uvmat('runplus_Callback',hObject,eventdata,hhuvmat)
     71            end
    6872        case 109%  key 'm'
     73                      huvmat=findobj(allchild(0),'Tag','uvmat');
     74                      if ~isempty(huvmat)
     75            hhuvmat=guidata(huvmat);
    6976            uvmat('runmin_Callback',hObject,eventdata,handleshaxes)
     77                      end
    7078        otherwise
    7179            if ischar(get(gco,'Tag'))
  • trunk/src/plot_field.m

    r874 r880  
    224224if ~(isfield(PlotParamOut,'Axes')&&isfield(PlotParamOut.Axes,'TextDisplay')&&(PlotParamOut.Axes.TextDisplay)) % if text is not already given as statistics
    225225    htext=findobj(hfig,'Tag','TableDisplay');
    226 %     hchecktable=findobj(hfig,'Tag','CheckTable');
    227226    if ~isempty(htext)%&&~isempty(hchecktable)
    228227        if isempty(index_0D)
     
    577576
    578577%% give statistics for pdf
    579 ind_var=find(testplot);
     578%ind_var=find(testplot);
    580579TableData={'Variable';'SampleNbr';'bin size';'Mean';'RMS';'Skewness';'Kurtosis';'    centered ';...
    581580    'Min';'FirstCentile';'FirstDecile';'Median';'LastDecile';'LastCentile';'Max'};
    582 %PlotParamOut.TableDisplay={};
     581
    583582TextDisplay=0;
    584583for icell=1:numel(CellInfo)
    585584    if isfield(CellInfo{icell},'VarIndex_histo')
    586         check_stat=1;
    587585        TextDisplay=1;
    588586        VarName=data.ListVarName{CellInfo{icell}.CoordIndex};
    589587        pdf_val=data.(data.ListVarName{CellInfo{icell}.VarIndex_histo});
    590588        x=coord_x{icell};
    591         Val=zeros(12,1);
    592         Val(1)=sum(pdf_val);% total sample number
    593         Val(7)=min(x);
    594         Val(13)=max(x);
    595         Val(2)=(Val(13)-Val(7))/(numel(x)-1);%bin size
    596         pdf_val=pdf_val/Val(1);% normalised pdf
    597         Val(3)=sum(x.*pdf_val);%Mean
    598         x=x-Val(3); %centered variable
    599         Variance=sum(x.*x.*pdf_val);
    600         Val(4)=sqrt(Variance);
    601         Val(5)=(sum(x.*x.*x.*pdf_val))/(Variance*Val(4));%skewness
    602         Val(6)=(sum(x.*x.*x.*x.*pdf_val))/(Variance*Variance);%kurtosis
    603         cumpdf=cumsum(pdf_val);% sum of pdf
    604         ind_centile=find(cumpdf>=0.01,1);% first index with cumsum >=0.01
    605         Val(8)=x(ind_centile)+Val(2)/2;%
    606         if ind_centile>1
    607             Val(8)=(cumpdf(ind_centile)-0.01)*x(ind_centile-1)+(0.01-cumpdf(ind_centile-1))*x(ind_centile);
    608             Val(8)=Val(8)/(cumpdf(ind_centile)-cumpdf(ind_centile-1))+Val(2)/2;%linear interpolation near ind_centile
    609         end
    610         ind_decile=find(cumpdf>=0.1,1);
    611         if ind_decile>1
    612             Val(9)=x(ind_decile)+Val(2)/2;%
    613             Val(9)=(cumpdf(ind_decile)-0.1)*x(ind_decile-1)+(0.1-cumpdf(ind_decile-1))*x(ind_decile);
    614             Val(9)=Val(9)/(cumpdf(ind_decile)-cumpdf(ind_decile-1))+Val(2)/2;%linear interpolation near ind_decile;
    615         end
    616         ind_median=find(cumpdf>= 0.5,1);
    617         Val(10)=(cumpdf(ind_median)-0.5)*x(ind_median-1)+(0.5-cumpdf(ind_median-1))*x(ind_median);
    618         Val(10)=Val(10)/(cumpdf(ind_median)-cumpdf(ind_median-1))+Val(2)/2;%linear interpolation near ind_median;
    619         %     Val(9)=x(ind_median);
    620         ind_decile=find(cumpdf>=0.9,1);
    621         Val(11)=(cumpdf(ind_decile)-0.9)*x(ind_decile-1)+(0.9-cumpdf(ind_decile-1))*x(ind_decile);
    622         Val(11)=Val(11)/(cumpdf(ind_decile)-cumpdf(ind_decile-1))+Val(2)/2;%linear interpolation near ind_median;
    623         ind_centile=find(cumpdf>=0.99,1);
    624         Val(12)=(cumpdf(ind_centile)-0.99)*x(ind_centile-1)+(0.99-cumpdf(ind_centile-1))*x(ind_centile);
    625         Val(12)=Val(12)/(cumpdf(ind_centile)-cumpdf(ind_centile-1))+Val(2)/2;%linear interpolation near ind_centile;
     589       
     590        Val=pdf2stat(x',pdf_val');
     591
    626592        Column=mat2cell(Val,ones(13,1),1);
    627593        Column=[{VarName};Column(1:6);{'stat: --'};Column(7:13)];
     
    632598    disp(TableData);
    633599    PlotParamOut.TableDisplay=TableData;
    634    % PlotParamOut.CheckTable=1;
    635 %     htable=findobj(hfig,'Tag','TableDisplay');
    636 %     set(htable,'Data',TableData)
    637 %     set(htable,'Visible','on')
    638 %     drawnow
    639600else
    640601    if isfield(PlotParamOut,'TableDisplay')
  • trunk/src/proj_field.m

    r873 r880  
    509509        VarSize(nbvar)=mean((ProjData.([VarName 'Max'])-ProjData.([VarName 'Min']))/100);
    510510    end
    511     if  isempty(VarMesh) || isnan(VarMesh) % mesh not specified as input, estimate from the bounds
     511    if  isempty(VarMesh)% || isnan(VarMesh) % mesh not specified as input, estimate from the bounds
    512512        VarMesh=mean(VarSize);
    513513        ord=10^(floor(log10(VarMesh)));%order of magnitude
     
    524524        LowBound=VarMesh*ceil(ProjData.([VarName 'Min'])/VarMesh);
    525525        UpperBound=VarMesh*floor(ProjData.([VarName 'Max'])/VarMesh);
     526        if numel(indsel)<=1
     527            errormsg='only one data point or less for histogram';
     528            return
     529        elseif isequal(LowBound,UpperBound)
     530            errormsg='attempt histogram of uniform field: low bound = high bound';
     531            return
     532        end       
    526533        ProjData.(VarName)=LowBound:VarMesh:UpperBound; % list of bin values
    527534        ProjData.([VarName 'Histo'])=hist(double(FieldData.(VarName)(indsel,:)),ProjData.(VarName)); % histogram at predefined bin positions
  • trunk/src/read_field.m

    r871 r880  
    283283        Field.Coord_y=[npxy(1)-0.5 0.5];
    284284        Field.Coord_x=[0.5 npxy(2)-0.5]; % coordinates of the first and last pixel centers
    285         ParamOut.Npx=npxy(2);% display image size on the interface
    286         ParamOut.Npy=npxy(1);
     285%        ParamOut.Npx=npxy(2);% display image size on the interface
     286 %       ParamOut.Npy=npxy(1);
    287287%         Field.VarAttribute{3}.Mesh=1;
    288288    end
  • trunk/src/series.m

    r876 r880  
    140140    ActionExtList={'.m';'.sh';'.py (in dev.)'};% default choice of extensions (Matlab fct .m or compiled version .sh
    141141else
    142     ActionExtList={'.m';'.sh'};
    143     disp('python library not installed')
     142    ActionExtList={'.m';'.sh'};  % python options not installed
    144143end
    145144ActionPathList=cell(NbBuiltinAction,1);%initiate the cell matrix of Action fct paths
     
    149148if isequal(s,0)
    150149    RunModeList=[RunModeList;{'cluster_oar'}];
     150    set(handles.MonitorCluster,'Visible','on'); % make visible button for access to Monika
    151151end
    152152[s,w]=system('qstat');% look for cluster system 'sge'
     
    596596function InputTable_KeyPressFcn(hObject, eventdata, handles)
    597597set(handles.REFRESH,'BackgroundColor',[1 0 1])% set REFRESH button to magenta color to indicate that input refresh is needed
     598set(handles.OutputSubDir,'BackgroundColor',[1 0 1])% set edit box OutputSubDir to magenta color to indicate that refresh may be needed
    598599xx=double(get(handles.series,'CurrentCharacter')); %get the keyboard character
    599600if ~isempty(xx)
     
    15001501            compile(ActionName,TransformPath)
    15011502            cd(currentdir)
     1503        else
     1504            errormsg='Action launch interrupted';
     1505            return
    15021506        end       
    15031507    else
     
    15301534        if strcmp(ActionExt,'.m')% case of Matlab function (uncompiled)
    15311535            NbCore=1;% one core used only (limitation of Matlab licences)
    1532             msgbox_uvmat('WARNING','Number of cores =1: select the compiled version .sh for multi-core processing');
     1536            answer=msgbox_uvmat('INPUT_Y-N','Number of cores =1: select the compiled version .sh for multi-core processing. Proceed with the .m version?');
     1537            if ~strcmp(answer,'Yes')
     1538                errormsg='Action launch interrupted';
     1539                return
     1540            end
    15331541            extra_oar='';
    15341542        else
     
    15581566        answer=msgbox_uvmat('INPUT_Y-N-Cancel',['use existing ouput directory: ' fullfile(Param.InputTable{1,1},SubDirOutNew) ', possibly delete previous data']);
    15591567        if strcmp(answer,'Cancel')
    1560             set(handles.RUN,'backgroundcolor',[1 0 0])
    15611568            return
    15621569        elseif strcmp(answer,'Yes')
     
    32983305    'Callback',@(hObject,eventdata)num_ref_j_Callback(hObject,eventdata),'String',num2str(ref_j),'FontUnits','points','FontSize',12,'FontWeight','bold',...
    32993306    'Tag','num_ref_j','TooltipString','''num_ref_j'': reference field index i used to display dt in ''list_pair_civ''');
     3307uicontrol('Style','pushbutton','Units','normalized', 'Position', [0.01 0.01 0.3 0.12],'BackgroundColor',[0 1 0],...
     3308    'Callback',@(hObject,eventdata)OK_Callback(hObject,eventdata),'String','OK','FontUnits','points','FontSize',12,'FontWeight','bold',...
     3309    'Tag','OK','TooltipString','''OK'': validate the choice');
    33003310%  last raw  of the GUI: pushbuttons
    33013311% uicontrol('Style','pushbutton','Units','normalized', 'Position', [0.35 0.01 0.3 0.15],'BackgroundColor',[0 1 0],'String','OK','Callback',@(hObject,eventdata)OK_Callback(hObject,eventdata),...
     
    33873397
    33883398%------------------------------------------------------------------------
     3399function OK_Callback(hObject, eventdata)
     3400%------------------------------------------------------------------------
     3401delete(get(hObject,'parent'))
     3402
     3403
     3404%------------------------------------------------------------------------
    33893405% --- Executes on button press in ClearLine.
    33903406%------------------------------------------------------------------------
     
    33963412    set(handles.InputTable,'Data',InputTable);
    33973413end
     3414
     3415
     3416% --- Executes on button press in MonitorCluster.
     3417function MonitorCluster_Callback(hObject, eventdata, handles)
     3418web('https://www.legi.grenoble-inp.fr/servload/monika')
     3419
     3420
     3421
     3422function OutputSubDir_Callback(hObject, eventdata, handles)
     3423set(handles.OutputSubDir,'BackgroundColor',[1 1 1])
     3424% hObject    handle to OutputSubDir (see GCBO)
     3425% eventdata  reserved - to be defined in a future version of MATLAB
     3426% handles    structure with handles and user data (see GUIDATA)
     3427
     3428% Hints: get(hObject,'String') returns contents of OutputSubDir as text
     3429%        str2double(get(hObject,'String')) returns contents of OutputSubDir as a double
  • trunk/src/series/civ2vel_3C.m

    r878 r880  
    169169%% MAIN LOOP ON FIELDS
    170170warning off
    171 if NbField<2
    172     disp_uvmat('ERROR','you need at least 2 images to compute the mean position for the stereo.',checkrun)
    173 return
    174 end
    175 for index=1:NbField-1
     171
     172for index=1:NbField
    176173    update_waitbar(WaitbarHandle,index/NbField)
    177174    if ~isempty(RUNHandle) && ~strcmp(get(RUNHandle,'BusyAction'),'queue')
     
    191188    if NbView==3 % if there is only 1 stereo folder, extract directly Xphys,Yphys and Zphys
    192189       
    193         [Data{3},tild,errormsg] = nc2struct(filecell{3,indextemp});
     190        [Data{3},tild,errormsg] = nc2struct([Param.InputTable{3,1},'/',Param.InputTable{3,2},'/',Param.InputTable{3,3},'_',int2str(indextemp),'.nc']);
     191       
    194192       
    195193        if  exist('Data{3}.Civ3_FF','var') % FF is present, remove wrong vector
     
    221219        end
    222220       
    223         [Data{3},tild,errormsg] = nc2struct(filecell{3,indextemp});
     221        [Data{3},tild,errormsg] = nc2struct([Param.InputTable{3,1},'/',Param.InputTable{3,2},'/',Param.InputTable{3,3},'_',int2str(indextemp),'.nc']);
    224222        if exist('Data{3}.Civ3_FF','var') % if FF is present, remove wrong vector
    225223            temp=find(Data{3}.Civ3_FF==0);
     
    243241       
    244242       
    245         [Data{4},tild,errormsg] = nc2struct(filecell{4,indextemp});
     243        [Data{4},tild,errormsg] = nc2struct([Param.InputTable{4,1},'/',Param.InputTable{4,2},'/',Param.InputTable{4,3},'_',int2str(indextemp),'.nc']);
    246244        if exist('Data{4}.Civ3_FF','var') % if FF is present, remove wrong vector
    247245            temp=find(Data{4}.Civ3_FF==0);
  • trunk/src/series/civ_input.m

    r876 r880  
    8383    set(handles.CheckThreshold,'Visible','on')
    8484    set(handles.CheckDeformation,'Value',0)% desactivate (work in progress)
    85     %set(handles.CheckDecimal,'Value',0)% desactivate (work in progress)
    8685end
    8786switch Param.Action.ActionName
     
    288287    if isequal(get(hhseries.REFRESH,'BackgroundColor'),[1 1 0]) &&...
    289288            ~(isfield(Param,'ActionInput') && isfield(Param.ActionInput,'ConfigSource'))
    290 %         answer=msgbox_uvmat('INPUT_Y-N',['import the civ parameters from the netcdf file']);
    291 %         if strcmp(answer,'Yes')
    292289            for index = 1:min(ind_opening,5)
    293290                set(handles.(ListOptions{index}),'value',0)
     
    300297            end
    301298            checkrefresh=1;
    302 %         end
    303299    end
    304300    if ind_opening>=3
     
    696692% in mode 'pair j1-j2', j1 and j2 are the file indices, else the indices
    697693% are relative to the reference indices ref_i and ref_j respectively.
    698 if isequal(mode,'pair j1-j2')%| isequal(mode,'st_pair j1-j2')
     694if isequal(mode,'pair j1-j2')
    699695    dt=1;
    700696    displ='';
     
    869865val=get(handles.ListCompareMode,'Value');
    870866compare=compare_list{val};
    871 if strcmp(compare,'displacement')||strcmp(compare,'shift')
    872     mode='displacement';
    873 else
     867if ~strcmp(compare,'displacement')%||strcmp(compare,'shift')
     868 
    874869    mode_list=get(handles.ListPairMode,'String');
    875870    mode_value=get(handles.ListPairMode,'Value');
     
    880875end
    881876nom_type_ima=CivInputData.NomTypeIma;
     877initial=get(handles.ListPairCiv1,'Value');%previous choice of pair
     878menu_pair=get(handles.ListPairCiv1,'String');%previous choice of pair.ListPairCiv1
     879init_choice=menu_pair{initial};
    882880
    883881%% determine nom_type_nc, nomenclature type of the .nc files:
     
    977975ichoice=find(select,1);% index of first selected pair
    978976if (isempty(ichoice) || ichoice < 1); ichoice=1; end;
    979 initial=get(handles.ListPairCiv1,'Value');%initial choice of pair
    980 if initial>nbpair || (numel(select)>=initial && ~isequal(select(initial),1))
     977ichoice=find(strcmp(init_choice,displ_pair'),1);
     978if ~isempty(ichoice)
    981979    set(handles.ListPairCiv1,'Value',ichoice);% first valid pair proposed by default in the menu
    982 end
     980else
     981   set(handles.ListPairCiv1,'Value',1)
     982end
     983% if initial>nbpair || (numel(select)>=initial && ~isequal(select(initial),1))
     984%     set(handles.ListPairCiv1,'Value',ichoice);% first valid pair proposed by default in the menu
     985% end
    983986
    984987%% determine the default selection in the pair menu for Civ2
  • trunk/src/series/civ_series.m

    r879 r880  
    10151015        end
    10161016        %threshold on image minimum
    1017         if check_MinIma && (image1_mean < par_civ.MinIma || image2_mean < par_civ.MinIma)
    1018             F(ivec)=3;
    1019         end
    1020         %threshold on image maximum
    1021         if check_MaxIma && (image1_mean > par_civ.MaxIma || image2_mean > par_civ.MaxIma)
    1022             F(ivec)=3;
    1023         end
    1024        
    10251017        if F(ivec)~=3
    1026             if checkmask
    1027                 image1_crop=(image1_crop-image1_mean).*~mask1_crop;%substract the mean, put to zero the masked parts
    1028                 image2_crop=(image2_crop-image2_mean).*~mask2_crop;
    1029             else
    1030                 image1_crop=(image1_crop-image1_mean);
    1031                 image2_crop=(image2_crop-image2_mean);
    1032             end
    1033             if CheckDeformation
    1034                 xi=(1:mesh:size(image1_crop,2));
    1035                 yi=(1:mesh:size(image1_crop,1))';
    1036                 [XI,YI]=meshgrid(xi-ceil(size(image1_crop,2)/2),yi-ceil(size(image1_crop,1)/2));
    1037                 XIant=XI-par_civ.DUDX(ivec)*XI-par_civ.DUDY(ivec)*YI+ceil(size(image1_crop,2)/2);
    1038                 YIant=YI-par_civ.DVDX(ivec)*XI-par_civ.DVDY(ivec)*YI+ceil(size(image1_crop,1)/2);
    1039                 image1_crop=interp2(image1_crop,XIant,YIant);
    1040                 image1_crop(isnan(image1_crop))=0;
    1041                 xi=(1:mesh:size(image2_crop,2));
    1042                 yi=(1:mesh:size(image2_crop,1))';
    1043                 image2_crop=interp2(image2_crop,xi,yi,'*spline');
    1044                 image2_crop(isnan(image2_crop))=0;
    1045                 %par_civ.CorrSmooth=3;%%%%%%%%%%%%%%%%%%%
    1046                 %%
    1047             end
    1048             sum_square=sum(sum(image1_crop.*image1_crop));
    1049             %reference: Oliver Pust, PIV: Direct Cross-Correlation
    1050             result_conv= conv2(image2_crop,flipdim(flipdim(image1_crop,2),1),'valid');
    1051             corrmax= max(max(result_conv));
    1052             result_conv=(result_conv/corrmax)*255; %normalize, peak=always 255
    1053             %Find the correlation max, at 255
    1054             [y,x] = find(result_conv==255,1);
    1055             subimage2_crop=image2_crop(y:y+2*iby2/mesh,x:x+2*ibx2/mesh);%subimage of image 2 corresponding to the optimum displacement of first image
    1056             sum_square=sum_square*sum(sum(subimage2_crop.*subimage2_crop));% product of variances of image 1 and 2
    1057             sum_square=sqrt(sum_square);% srt of the variance product to normalise correlation
    1058             if ~isempty(y) && ~isempty(x)
    1059                 try
    1060                     if par_civ.CorrSmooth==1
    1061                         [vector,F(ivec)] = SUBPIXGAUSS (result_conv,x,y);
    1062                     elseif par_civ.CorrSmooth==2
    1063                         [vector,F(ivec)] = SUBPIX2DGAUSS (result_conv,x,y);
    1064                     else
    1065                         [vector,F(ivec)] = quadr_fit(result_conv,x,y);
    1066                     end
    1067                     utable(ivec)=vector(1)*mesh+shiftx(ivec);
    1068                     vtable(ivec)=vector(2)*mesh+shifty(ivec);
    1069                     xtable(ivec)=iref+utable(ivec)/2-0.5;% convec flow (velocity taken at the point middle from imgae 1 and 2)
    1070                     ytable(ivec)=jref+vtable(ivec)/2-0.5;% and position of pixel 1=0.5 (convention for image coordinates=0 at the edge)
    1071                     iref=round(xtable(ivec));% nearest image index for the middle of the vector
    1072                     jref=round(ytable(ivec));
    1073                     % eliminate vectors located in the mask
    1074                     if checkmask && par_civ.Mask(jref,iref)<200 && par_civ.Mask(jref,iref)>=100
    1075                         utable(ivec)=0;
    1076                         vtable(ivec)=0;
     1018            if check_MinIma && (image1_mean < par_civ.MinIma || image2_mean < par_civ.MinIma)
     1019                F(ivec)=3;
     1020                %threshold on image maximum
     1021            elseif check_MaxIma && (image1_mean > par_civ.MaxIma || image2_mean > par_civ.MaxIma)
     1022                F(ivec)=3;
     1023            end
     1024            if F(ivec)~=3
     1025                %mask
     1026                if checkmask
     1027                    image1_crop=(image1_crop-image1_mean).*~mask1_crop;%substract the mean, put to zero the masked parts
     1028                    image2_crop=(image2_crop-image2_mean).*~mask2_crop;
     1029                else
     1030                    image1_crop=(image1_crop-image1_mean);
     1031                    image2_crop=(image2_crop-image2_mean);
     1032                end
     1033                %deformation
     1034                if CheckDeformation
     1035                    xi=(1:mesh:size(image1_crop,2));
     1036                    yi=(1:mesh:size(image1_crop,1))';
     1037                    [XI,YI]=meshgrid(xi-ceil(size(image1_crop,2)/2),yi-ceil(size(image1_crop,1)/2));
     1038                    XIant=XI-par_civ.DUDX(ivec)*XI-par_civ.DUDY(ivec)*YI+ceil(size(image1_crop,2)/2);
     1039                    YIant=YI-par_civ.DVDX(ivec)*XI-par_civ.DVDY(ivec)*YI+ceil(size(image1_crop,1)/2);
     1040                    image1_crop=interp2(image1_crop,XIant,YIant);
     1041                    image1_crop(isnan(image1_crop))=0;
     1042                    xi=(1:mesh:size(image2_crop,2));
     1043                    yi=(1:mesh:size(image2_crop,1))';
     1044                    image2_crop=interp2(image2_crop,xi,yi,'*spline');
     1045                    image2_crop(isnan(image2_crop))=0;
     1046                    %par_civ.CorrSmooth=3;%%%%%%%%%%%%%%%%%%%
     1047                    %%
     1048                end
     1049                sum_square=sum(sum(image1_crop.*image1_crop));
     1050                %reference: Oliver Pust, PIV: Direct Cross-Correlation
     1051                result_conv= conv2(image2_crop,flipdim(flipdim(image1_crop,2),1),'valid');
     1052                corrmax= max(max(result_conv));
     1053                result_conv=(result_conv/corrmax)*255; %normalize, peak=always 255
     1054                %Find the correlation max, at 255
     1055                [y,x] = find(result_conv==255,1);
     1056                subimage2_crop=image2_crop(y:y+2*iby2/mesh,x:x+2*ibx2/mesh);%subimage of image 2 corresponding to the optimum displacement of first image
     1057                sum_square=sum_square*sum(sum(subimage2_crop.*subimage2_crop));% product of variances of image 1 and 2
     1058                sum_square=sqrt(sum_square);% srt of the variance product to normalise correlation
     1059                if ~isempty(y) && ~isempty(x)
     1060                    try
     1061                        if par_civ.CorrSmooth==1
     1062                            [vector,F(ivec)] = SUBPIXGAUSS (result_conv,x,y);
     1063                        elseif par_civ.CorrSmooth==2
     1064                            [vector,F(ivec)] = SUBPIX2DGAUSS (result_conv,x,y);
     1065                        else
     1066                            [vector,F(ivec)] = quadr_fit(result_conv,x,y);
     1067                        end
     1068                        utable(ivec)=vector(1)*mesh+shiftx(ivec);
     1069                        vtable(ivec)=vector(2)*mesh+shifty(ivec);
     1070                        xtable(ivec)=iref+utable(ivec)/2-0.5;% convec flow (velocity taken at the point middle from imgae 1 and 2)
     1071                        ytable(ivec)=jref+vtable(ivec)/2-0.5;% and position of pixel 1=0.5 (convention for image coordinates=0 at the edge)
     1072                        iref=round(xtable(ivec));% nearest image index for the middle of the vector
     1073                        jref=round(ytable(ivec));
     1074                        % eliminate vectors located in the mask
     1075                        if checkmask && par_civ.Mask(jref,iref)<200 && par_civ.Mask(jref,iref)>=100
     1076                            utable(ivec)=0;
     1077                            vtable(ivec)=0;
     1078                            F(ivec)=3;
     1079                        end
     1080                        ctable(ivec)=corrmax/sum_square;% correlation value
     1081                    catch ME
    10771082                        F(ivec)=3;
    10781083                    end
    1079                     ctable(ivec)=corrmax/sum_square;% correlation value
    1080                 catch ME
     1084                else
    10811085                    F(ivec)=3;
    10821086                end
    1083             else
    1084                 F(ivec)=3;
    10851087            end
    10861088        end
  • trunk/src/series/merge_proj.m

    r874 r880  
    142142    FileType{iview}=FileInfo{iview}.FileType;
    143143    CheckImage{iview}=~isempty(find(strcmp(FileType{iview},ImageTypeOptions)));% =1 for images
     144    if CheckImage{iview}
     145        ParamIn{iview}=MovieObject{iview};
     146    else
     147        ParamIn{iview}=Param.InputFields;
     148    end
    144149    CheckNc{iview}=~isempty(find(strcmp(FileType{iview},NcTypeOptions)));% =1 for netcdf files
    145150    if ~isempty(j1_series{iview})
     
    196201    FileExtOut='.nc'; %netcdf output
    197202end
     203if isempty(j1_series{1})
     204    NomTypeOut='_1';
     205else
     206    NomTypeOut='_1_1';
     207end
    198208%NomTypeOut=NomType;% output file index will indicate the first and last ref index in the series
    199209RootFileOut=RootFile{1};
     
    232242
    233243    %%%%%%%%%%%%%%%% loop on field indices %%%%%%%%%%%%%%%%
     244tstart=tic; %used to record the computing time
    234245for index=1:NbField
    235246        update_waitbar(WaitbarHandle,index/NbField)
     
    238249        return
    239250    end
    240    
    241251    %%%%%%%%%%%%%%%% loop on views (input lines) %%%%%%%%%%%%%%%%
    242252    Data=cell(1,NbView);%initiate the set Data
    243253    timeread=zeros(1,NbView);
    244254    for iview=1:NbView
    245         %% reading input file(s)
    246         [Data{iview},tild,errormsg] = read_field(filecell{iview,index},FileType{iview},Param.InputFields,frame_index{iview}(index));
     255        %% reading input file(s)     
     256        [Data{iview},tild,errormsg] = read_field(filecell{iview,index},FileType{iview},ParamIn{iview},frame_index{iview}(index));
    247257        if ~isempty(errormsg)
    248258            disp_uvmat('ERROR',['ERROR in merge_proj/read_field/' errormsg],checkrun)
     
    323333        end
    324334    end
    325     OutputFile=fullfile_uvmat(RootPath{1},OutputDir,RootFileOut,FileExtOut,NomType{1},i1,i2,j1,j2);
     335    OutputFile=fullfile_uvmat(RootPath{1},OutputDir,RootFileOut,FileExtOut,NomTypeOut,i1,i2,j1,j2);
    326336
    327337    %% recording the merged field
     
    337347            npy=siz(1);
    338348            npx=siz(2);
    339             if isfield(MergeData,'coord_x') && isfield(MergeData,'coord_y')
    340                 Rangx=MergeData.coord_x;
    341                 Rangy=MergeData.coord_y;
     349            if isfield(MergeData,'Coord_x') && isfield(MergeData,'Coord_y')
     350                Rangx=MergeData.Coord_x;
     351                Rangy=MergeData.Coord_y;
    342352            elseif isfield(MergeData,'AX')&& isfield(MergeData,'AY')
    343353                Rangx=[MergeData.AX(1) MergeData.AX(end)];
     
    392402    end
    393403end
    394 
     404disp(['total ellapsed time ' num2str(toc(tstart))])
    395405
    396406%'merge_field': concatene fields
  • trunk/src/series/time_series.m

    r875 r880  
    9090        if ismember(SeriesData.ProjObject.ProjMode,{'inside','outside'})
    9191            answer=msgbox_uvmat('INPUT_TXT','set bin size for histograms (or keep ''auto'' by default)?','auto');
    92             ParamOut.ActionInput.VarMesh=str2double(answer);
     92            ParamOut.ActionInput.VarMesh=str2num(answer);
    9393        end
    9494    end
     
    295295nbfile=0;% not used , to check
    296296nbmissing=0;
    297 VarMesh=NaN;
     297VarMesh=[];
    298298checkhisto=0;
    299299if isfield(Param,'ProjObject') && ismember(Param.ProjObject.ProjMode,{'inside','outside'})
    300300    checkhisto=1;
    301     if isfield(Param.ActionInput,'VarMesh')%case of histograms
    302     VarMesh=Param.ActionInput.VarMesh;
     301    if isfield(Param,'ActionInput') && isfield(Param.ActionInput,'VarMesh')%case of histograms
     302        VarMesh=Param.ActionInput.VarMesh;
    303303    end
    304304end
     
    320320        if ~isempty(errormsg)
    321321            errormsg=['time_series / read_field / ' errormsg];
    322             display(errormsg)
    323             break
     322            disp(errormsg)
     323            break% exit the loop on iview
    324324        end
    325325        if ~isempty(NbSlice_calib)
     
    327327        end
    328328    end
    329     if isempty(errormsg)
    330         Field=Data{1}; % default input field structure
    331         % coordinate transform (or other user defined transform)
    332         if ~isempty(transform_fct)
    333             switch nargin(transform_fct)
    334                 case 4
    335                     if length(Data)==2
    336                         Field=transform_fct(Data{1},XmlData{1},Data{2},XmlData{2});
    337                     else
    338                         Field=transform_fct(Data{1},XmlData{1});
     329    if ~isempty(errormsg)
     330        continue %in case of input error skip the current input field, go to next index
     331    end
     332    Field=Data{1}; % default input field structure
     333    % coordinate transform (or other user defined transform)
     334    if ~isempty(transform_fct)
     335        switch nargin(transform_fct)
     336            case 4
     337                if length(Data)==2
     338                    Field=transform_fct(Data{1},XmlData{1},Data{2},XmlData{2});
     339                else
     340                    Field=transform_fct(Data{1},XmlData{1});
     341                end
     342            case 3
     343                if length(Data)==2
     344                    Field=transform_fct(Data{1},XmlData{1},Data{2});
     345                else
     346                    Field=transform_fct(Data{1},XmlData{1});
     347                end
     348            case 2
     349                Field=transform_fct(Data{1},XmlData{1});
     350            case 1
     351                Field=transform_fct(Data{1});
     352        end
     353    end
     354   
     355    %field projection on an object
     356    if Param.CheckObject
     357        % calculate tps coefficients if needed
     358        if isfield(Param.ProjObject,'ProjMode')&& strcmp(Param.ProjObject.ProjMode,'interp_tps')
     359            Field=tps_coeff_field(Field,check_proj_tps);
     360        end
     361        [Field,errormsg]=proj_field(Field,Param.ProjObject,VarMesh);
     362        if ~isempty(errormsg)
     363            disp_uvmat('ERROR',['time_series / proj_field / ' errormsg],checkrun)
     364            return
     365        end
     366    end
     367    %         nbfile=nbfile+1;
     368   
     369    % initiate the time series at the first iteration
     370    if index==1
     371        % stop program if the first field reading is in error
     372        if ~isempty(errormsg)
     373            disp_uvmat('ERROR',['time_series / sub_field / ' errormsg],checkrun)
     374            return
     375        end
     376        if ~isfield(Field,'ListVarName')
     377            disp_uvmat('ERROR','no variable in the projected field',checkrun)
     378            return
     379        end
     380        DataOut=Field;%output reproduced the first projected field by default
     381        nbvar=length(Field.ListVarName);
     382        if nbvar==0
     383            disp_uvmat('ERROR','no input variable selected',checkrun)
     384            return
     385        end
     386        if checkhisto%case of histograms
     387            testsum=zeros(1,nbvar);%initiate flag for action on each variable
     388            for ivar=1:numel(Field.ListVarName)% list of variable names before projection (histogram)
     389                VarName=Field.ListVarName{ivar};
     390                if isfield(Data{1},VarName)
     391                    DataOut.ListVarName=[DataOut.ListVarName {[VarName 'Histo']}];
     392                    DataOut.VarDimName=[DataOut.VarDimName {{'Time',VarName}}];
     393%                     if isfield(DataOut.VarAttribute{ivar},'Role')
     394%                     DataOut.VarAttribute{ivar}=rmfield(DataOut.VarAttribute{ivar},'Role');
     395%                     end
     396                    StatName=pdf2stat;% get the names of statistical quantities to calcuilate at each time
     397                    for istat=1:numel(StatName)
     398                        DataOut.ListVarName=[DataOut.ListVarName {[VarName StatName{istat}]}];
     399                        DataOut.VarDimName=[DataOut.VarDimName {'Time'}];
    339400                    end
    340                 case 3
    341                     if length(Data)==2
    342                         Field=transform_fct(Data{1},XmlData{1},Data{2});
    343                     else
    344                         Field=transform_fct(Data{1},XmlData{1});
    345                     end
    346                 case 2
    347                     Field=transform_fct(Data{1},XmlData{1});
    348                 case 1
    349                     Field=transform_fct(Data{1});
     401                    testsum(ivar)=1;
     402                    DataOut.(VarName)=Field.(VarName);
     403                    DataOut.([VarName 'Histo'])=zeros([nbfield numel(DataOut.(VarName))]);
     404                    VarMesh=Field.(VarName)(2)-Field.(VarName)(1);
     405                end
    350406            end
    351         end
    352        
    353         %field projection on an object
    354         if Param.CheckObject
    355             % calculate tps coefficients if needed
    356             if isfield(Param.ProjObject,'ProjMode')&& strcmp(Param.ProjObject.ProjMode,'interp_tps')
    357                 Field=tps_coeff_field(Field,check_proj_tps);
    358             end
    359             [Field,errormsg]=proj_field(Field,Param.ProjObject,VarMesh);
    360             if ~isempty(errormsg)
    361                 msgbox_uvmat('ERROR',['time_series / proj_field / ' errormsg])
    362                 return
    363             end
    364         end
    365         %         nbfile=nbfile+1;
    366        
    367         % initiate the time series at the first iteration
    368         if index==1
    369             % stop program if the first field reading is in error
    370             if ~isempty(errormsg)
    371                 disp_uvmat('ERROR',['time_series / sub_field / ' errormsg],checkrun)
    372                 return
    373             end
    374             DataOut=Field;%default
    375             nbvar=length(Field.ListVarName);
    376             if nbvar==0
    377                 disp_uvmat('ERROR','no input variable selected',checkrun)
    378                 return
    379             end
    380             if checkhisto%case of histograms
    381                 testsum=zeros(1,nbvar);%initiate flag for action on each variable
    382                 for ivar=1:numel(Field.ListVarName)% list of variable names before projection (histogram)
    383                     VarName=Field.ListVarName{ivar};
    384                     if isfield(Data{1},VarName)
    385                         testsum(ivar)=1;
    386                         DataOut.(VarName)=Field.(VarName);
    387                         DataOut.([VarName 'Histo'])=zeros([nbfield numel(DataOut.(VarName))]);
    388                         VarMesh=Field.(VarName)(2)-Field.(VarName)(1);
    389                     end
    390                 end
    391                 disp(['mesh for histogram = ' num2str(VarMesh)])
    392             else
    393                 testsum=2*ones(1,nbvar);%initiate flag for action on each variable
    394                 if isfield(Field,'VarAttribute') % look for coordinate and flag variables
    395                     for ivar=1:nbvar
    396                         if length(Field.VarAttribute)>=ivar && isfield(Field.VarAttribute{ivar},'Role')
    397                             var_role=Field.VarAttribute{ivar}.Role;%'role' of the variable
    398                             if isequal(var_role,'errorflag')
    399                                 disp_uvmat('ERROR','do not handle error flags in time series',checkrun)
    400                                 return
    401                             end
    402                             if isequal(var_role,'warnflag')
    403                                 testsum(ivar)=0;  % not recorded variable
    404                                 eval(['DataOut=rmfield(DataOut,''' Field.ListVarName{ivar} ''');']);%remove variable
    405                             end
    406                             if strcmp(var_role,'coord_x')||strcmp(var_role,'coord_y')||strcmp(var_role,'coord_z')||strcmp(var_role,'coord')
    407                                 testsum(ivar)=1; %constant coordinates, record without time evolution
    408                             end
     407            disp(['mesh for histogram = ' num2str(VarMesh)])
     408        else
     409            testsum=2*ones(1,nbvar);%initiate flag for action on each variable
     410            if isfield(Field,'VarAttribute') % look for coordinate and flag variables
     411                for ivar=1:nbvar
     412                    if length(Field.VarAttribute)>=ivar && isfield(Field.VarAttribute{ivar},'Role')
     413                        var_role=Field.VarAttribute{ivar}.Role;%'role' of the variable
     414                        if isequal(var_role,'errorflag')
     415                            disp_uvmat('ERROR','do not handle error flags in time series',checkrun)
     416                            return
    409417                        end
    410                         % check whether the variable ivar is a dimension variable
    411                         DimCell=Field.VarDimName{ivar};
    412                         if ischar(DimCell)
    413                             DimCell={DimCell};
     418                        if isequal(var_role,'warnflag')
     419                            testsum(ivar)=0;  % not recorded variable
     420                            eval(['DataOut=rmfield(DataOut,''' Field.ListVarName{ivar} ''');']);%remove variable
    414421                        end
    415                         if numel(DimCell)==1 && isequal(Field.ListVarName{ivar},DimCell{1})%detect dimension variables
    416                             testsum(ivar)=1;
     422                        if strcmp(var_role,'coord_x')||strcmp(var_role,'coord_y')||strcmp(var_role,'coord_z')||strcmp(var_role,'coord')
     423                            testsum(ivar)=1; %constant coordinates, record without time evolution
    417424                        end
    418425                    end
    419                 end
    420                 for ivar=1:nbvar
    421                     if testsum(ivar)==2
    422                         VarName=Field.ListVarName{ivar};
    423                         siz=size(Field.(VarName));
    424                         DataOut.(VarName)=zeros([nbfield siz]);
     426                    % check whether the variable ivar is a dimension variable
     427                    DimCell=Field.VarDimName{ivar};
     428                    if ischar(DimCell)
     429                        DimCell={DimCell};
    425430                    end
     431                    if numel(DimCell)==1 && isequal(Field.ListVarName{ivar},DimCell{1})%detect dimension variables
     432                        testsum(ivar)=1;
     433                    end
    426434                end
    427435            end
    428             DataOut.ListVarName=[{'Time'} DataOut.ListVarName];
    429         end
    430        
    431         % add data to the current field
    432         if checkhisto
    433             for ivar=1:length(Field.ListVarName)
    434                 VarName=Field.ListVarName{ivar};
    435                 if isfield(Data{1},VarName)
    436                     MaxValue=max(DataOut.(VarName));% current max of histogram absissa
    437                     MinValue=min(DataOut.(VarName));% current min of histogram absissa
    438                     MaxIndex=round(MaxValue/VarMesh);
    439                     MinIndex=round(MinValue/VarMesh);
    440                     MaxIndex_new=round(max(Field.(VarName)/VarMesh));% max of the current field
    441                     MinIndex_new=round(min(Field.(VarName)/VarMesh));
    442                     if MaxIndex_new>MaxIndex% the variable max for the current field exceeds the previous one
    443                         DataOut.(VarName)=[DataOut.(VarName) VarMesh*(MaxIndex+1:MaxIndex_new)];% append the new variable values
    444                         DataOut.([VarName 'Histo'])=[DataOut.([VarName 'Histo']) zeros(nbfield,MaxIndex_new-MaxIndex)]; % append the new histo values
    445                     end
    446                     if MinIndex_new <= MinIndex-1
    447                         DataOut.(VarName)=[VarMesh*(MinIndex_new:MinIndex-1) DataOut.(VarName)];% insert the new variable values
    448                         DataOut.([VarName 'Histo'])=[zeros(nbfield,MinIndex-MinIndex_new) DataOut.([VarName 'Histo'])];% insert the new histo values
    449                         ind_start=1;
    450                     else
    451                         ind_start=MinIndex_new-MinIndex+1;
    452                     end
    453                     DataOut.([VarName 'Histo'])(index,ind_start:ind_start+MaxIndex_new-MinIndex_new)=...
    454                         DataOut.([VarName 'Histo'])(index,ind_start:ind_start+MaxIndex_new-MinIndex_new)+Field.([VarName 'Histo']);
     436            for ivar=1:nbvar
     437                if testsum(ivar)==2
     438                    VarName=Field.ListVarName{ivar};
     439                    siz=size(Field.(VarName));
     440                    DataOut.(VarName)=zeros([nbfield siz]);
    455441                end
    456442            end
     443        end
     444        DataOut.ListVarName=[{'Time'} DataOut.ListVarName];
     445    end
     446    % end initialisation for index==1
     447   
     448    % append data from the current field
     449
     450    if checkhisto % case of histogram (projection mode=inside or outside)
     451        for ivar=1:length(Field.ListVarName)
     452            VarName=Field.ListVarName{ivar};
     453            if isfield(Data{1},VarName)
     454                MaxValue=max(DataOut.(VarName));% current max of histogram absissa
     455                MinValue=min(DataOut.(VarName));% current min of histogram absissa
     456                MaxIndex=round(MaxValue/VarMesh);
     457                MinIndex=round(MinValue/VarMesh);
     458                MaxIndex_new=round(max(Field.(VarName)/VarMesh));% max of the current field
     459                MinIndex_new=round(min(Field.(VarName)/VarMesh));
     460                if MaxIndex_new>MaxIndex% the variable max for the current field exceeds the previous one
     461                    DataOut.(VarName)=[DataOut.(VarName) VarMesh*(MaxIndex+1:MaxIndex_new)];% append the new variable values
     462                    DataOut.([VarName 'Histo'])=[DataOut.([VarName 'Histo']) zeros(nbfield,MaxIndex_new-MaxIndex)]; % append the new histo values
     463                end
     464                if MinIndex_new <= MinIndex-1
     465                    DataOut.(VarName)=[VarMesh*(MinIndex_new:MinIndex-1) DataOut.(VarName)];% insert the new variable values
     466                    DataOut.([VarName 'Histo'])=[zeros(nbfield,MinIndex-MinIndex_new) DataOut.([VarName 'Histo'])];% insert the new histo values
     467                    ind_start=1;
     468                else
     469                    ind_start=MinIndex_new-MinIndex+1;
     470                end
     471                DataOut.([VarName 'Histo'])(index,ind_start:ind_start+MaxIndex_new-MinIndex_new)=...
     472                    DataOut.([VarName 'Histo'])(index,ind_start:ind_start+MaxIndex_new-MinIndex_new)+Field.([VarName 'Histo']);
     473                VarVal=pdf2stat(Field.(VarName),Field.([VarName 'Histo']));% max of the current field
     474                for istat=1:numel(VarVal)
     475                    DataOut.([VarName StatName{istat}])(index)=VarVal(istat);
     476                end
     477            end
     478        end
     479    else % not histogram
     480        for ivar=1:length(Field.ListVarName)
     481            VarName=Field.ListVarName{ivar};
     482            VarVal=Field.(VarName);
     483            if testsum(ivar)==2% test for recorded variable
     484                if isempty(errormsg)
     485                    VarVal=shiftdim(VarVal,-1); %shift dimension
     486                    DataOut.(VarName)(index,:,:)=VarVal;%concanete the current field to the time series
     487                end
     488            elseif testsum(ivar)==1% variable representing fixed coordinates
     489                VarInit=DataOut.(VarName);
     490                if isempty(errormsg) && ~isequal(VarVal,VarInit)
     491                    disp_uvmat('ERROR',['time series requires constant coordinates ' VarName ': use projection mode interp'],checkrun)
     492                    return
     493                end
     494            end
     495        end
     496    end
     497   
     498    % record the time:
     499    if isempty(time)% time not set by xml filer(s)
     500        if isfield(Data{1},'Time')
     501            DataOut.Time(index,1)=Field.Time;
    457502        else
    458             for ivar=1:length(Field.ListVarName)
    459                 VarName=Field.ListVarName{ivar};
    460                 VarVal=Field.(VarName);
    461                 if testsum(ivar)==2% test for recorded variable
    462                     if isempty(errormsg)
    463                         VarVal=shiftdim(VarVal,-1); %shift dimension
    464                         DataOut.(VarName)(index,:,:)=VarVal;%concanete the current field to the time series
    465                     end
    466                 elseif testsum(ivar)==1% variable representing fixed coordinates
    467                     VarInit=DataOut.(VarName);
    468                     if isempty(errormsg) && ~isequal(VarVal,VarInit)
    469                         disp_uvmat('ERROR',['time series requires constant coordinates ' VarName ': use projection mode interp'],checkrun)
    470                         return
    471                     end
    472                 end
    473             end
    474         end
    475        
    476         % record the time:
    477         if isempty(time)% time not set by xml filer(s)
    478             if isfield(Data{1},'Time')
    479                 DataOut.Time(index,1)=Field.Time;
    480             else
    481                 DataOut.Time(index,1)=index;%default
    482             end
    483         else % time from ImaDoc prevails  TODO: correct
    484             DataOut.Time(index,1)=time(index);%
    485         end
    486        
    487         % record the number of missing input fields
    488         if ~isempty(errormsg)
    489             nbmissing=nbmissing+1;
    490             display(['index=' num2str(index) ':' errormsg])
    491         end
    492     end
    493 end
     503            DataOut.Time(index,1)=index;%default
     504        end
     505    else % time from ImaDoc prevails  TODO: correct
     506        DataOut.Time(index,1)=time(index);%
     507    end
     508   
     509    % record the number of missing input fields
     510    if ~isempty(errormsg)
     511        nbmissing=nbmissing+1;
     512        display(['index=' num2str(index) ':' errormsg])
     513    end
     514end
     515
    494516%%%%%%% END OF LOOP WITHIN A SLICE
    495517
     
    535557end
    536558
    537 %case of histograms
    538 if checkhisto
    539     for ivar=1:numel(Field.ListVarName)
    540         VarName=Field.ListVarName{ivar};
    541         if isfield(Data{1},VarName)
    542             DataOut.ListVarName=[DataOut.ListVarName {[VarName 'Histo']}];
    543             DataOut.VarDimName=[DataOut.VarDimName {{'Time',VarName}}];
    544         end
    545     end
    546 end
     559% %case of histograms
     560% if checkhisto
     561%     for ivar=1:numel(Field.ListVarName)
     562%         VarName=Field.ListVarName{ivar};
     563%         if isfield(Data{1},VarName)
     564%             DataOut.ListVarName=[DataOut.ListVarName {[VarName 'Histo']}];
     565%             DataOut.VarDimName=[DataOut.VarDimName {{'Time',VarName}}];
     566%         end
     567%     end
     568% end
    547569% display nbmissing
    548570if ~isequal(nbmissing,0)
     
    559581end
    560582
    561 %% plot the time series (the last one in case of multislices)
    562 if checkrun
    563     figure
    564     haxes=axes;
    565     plot_field(DataOut,haxes)
    566    
    567     %% display the result file using the GUI get_field
    568     hget_field=findobj(allchild(0),'name','get_field');
    569     if ~isempty(hget_field)
    570         delete(hget_field)
    571     end
    572     get_field(OutputFile,DataOut)
    573 end
    574 
    575 
     583%% plot the time series for  (the last one in case of multislices)
     584if checkrun %&& isfield(Param,'ProjObject') && strcmp(Param.ProjObject.Type,'points')
     585    %% open the result file with uvmat (in RUN mode)
     586    uvmat(OutputFile)% open the last result file with uvmat
     587end
     588%     figure
     589%     haxes=axes;
     590%     plot_field(DataOut,haxes)
     591%     
     592%     %% display the result file using the GUI get_field
     593%     hget_field=findobj(allchild(0),'name','get_field');
     594%     if ~isempty(hget_field)
     595%         delete(hget_field)
     596%     end
     597%     get_field(OutputFile,DataOut)
     598% end
     599
     600
  • trunk/src/transform_field/phys_polar.m

    r810 r880  
    9595%transform first field to cartesian phys coordiantes
    9696if  ~isempty(Calib{1})
    97     DataOut=phys_1(Data,Calib{1},origin_xy,radius_offset,angle_offset,angle_scale);
     97    DataOut=phys_1(DataIn,Calib{1},origin_xy,radius_offset,angle_offset,angle_scale);
    9898    %case of images or scalar
    99     if isfield(Data,'A')&isfield(Data,'Coord_x')&~isempty(Data.Coord_x) & isfield(Data,'Coord_y')&...
    100                                            ~isempty(Data.Coord_y)&length(Data.A)>1
     99    if isfield(DataIn,'A')&isfield(DataIn,'Coord_x')&~isempty(DataIn.Coord_x) & isfield(DataIn,'Coord_y')&...
     100                                           ~isempty(DataIn.Coord_y)&length(DataIn.A)>1
    101101        iscalar=1;
    102         A{1}=Data.A;
     102        A{1}=DataIn.A;
    103103    end
    104104    %transform of X,Y coordinates for vector fields
    105     if isfield(Data,'ZIndex')&~isempty(Data.ZIndex)
    106         ZIndex=Data.ZIndex;
     105    if isfield(DataIn,'ZIndex')&~isempty(DataIn.ZIndex)
     106        ZIndex=DataIn.ZIndex;
    107107    else
    108108        ZIndex=0;
Note: See TracChangeset for help on using the changeset viewer.