Changeset 1098


Ignore:
Timestamp:
Apr 13, 2021, 7:19:35 PM (16 months ago)
Author:
sommeria
Message:

various bugs repaired

Location:
trunk/src
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/find_field_cells.m

    r1095 r1098  
    429429                NbDim(icell)=size(Data.(Data.ListVarName{ivar}),2);
    430430            else
    431                 DimIndex=find(strcmp(Data.VarDimName{ivar},Data.ListDimName));
     431                DimIndex=find(strcmp(Data.VarDimName{ivar}{2},Data.ListDimName));
    432432                NbDim(icell)= Data.DimValue(DimIndex);
    433433            end
     
    497497        for ivar=ind_discrete
    498498            DimCell=Data.VarDimName{ivar};
    499             if  numel(DimCell)==1 && strcmp(DimCell_x{1},DimCell{1})
     499            %if  numel(DimCell)==1 && strcmp(DimCell_x{1},DimCell{1})
     500            if  strcmp(DimCell_x{1},DimCell{1})
    500501                y_nbre(icell)=y_nbre(icell)+1;
    501502                Cell1DPlot{icell}.YIndex_discrete(y_nbre(icell))=ivar;
  • trunk/src/get_field.m

    r1095 r1098  
    822822        end
    823823    else
    824         coord_val=[0 0 0];
     824        coord_val=[0 0];
    825825        for ilist=1:numel(var_component)
    826826            ivar=var_component(ilist);
  • trunk/src/mouse_down.m

    r1093 r1098  
    115115            AxeData.CurrentOrigin=xy(1,1:2);% The current point set by the mouse becomes the current origin
    116116           
    117             if test_edit_vect 
     117            if test_edit_vect
    118118                ivec=[];
    119119                FigData=get(hCurrentGUI,'UserData');
     
    123123                    [CellInfo,NbDim,errormsg]=find_field_cells(Field);%analyse the physical fields contained in Field
    124124                    if isempty(errormsg)
    125                     for icell=1:numel(CellInfo)%look for all physical fields
    126                         if NbDim(icell)==2 % select 2D field
    127                             if  isfield(Field,'CoordMesh') && ~isempty(Field.CoordMesh)&&...
    128                                     ~isempty(CellInfo{icell}.VarIndex_coord_x) && ~isempty(CellInfo{icell}.VarIndex_coord_y)%case of unstructured data
    129                                 X=Field.(Field.ListVarName{CellInfo{icell}.VarIndex_coord_x});
    130                                 Y=Field.(Field.ListVarName{CellInfo{icell}.VarIndex_coord_y});
    131                                 flag_vec=(X<(xy(1,1)+Field.CoordMesh/4) & X>(xy(1,1)-Field.CoordMesh/4)) & ...%flagx=1 for the vectors with x position selected by the mouse
    132                                     (Y<(xy(1,2)+Field.CoordMesh/4) & Y>(xy(1,2)-Field.CoordMesh/4));%f
    133                                 ivec=find(flag_vec,1);% search the (first) selected vector index ivec
     125                        for icell=1:numel(CellInfo)%look for all physical fields
     126                            if NbDim(icell)==2 % select 2D field
     127                                if  isfield(Field,'CoordMesh') && ~isempty(Field.CoordMesh)&&...
     128                                        ~isempty(CellInfo{icell}.VarIndex_coord_x) && ~isempty(CellInfo{icell}.VarIndex_coord_y)%case of unstructured data
     129                                    X=Field.(Field.ListVarName{CellInfo{icell}.VarIndex_coord_x});
     130                                    Y=Field.(Field.ListVarName{CellInfo{icell}.VarIndex_coord_y});
     131                                    flag_vec=(X<(xy(1,1)+Field.CoordMesh/4) & X>(xy(1,1)-Field.CoordMesh/4)) & ...%flagx=1 for the vectors with x position selected by the mouse
     132                                        (Y<(xy(1,2)+Field.CoordMesh/4) & Y>(xy(1,2)-Field.CoordMesh/4));%f
     133                                    ivec=find(flag_vec,1);% search the (first) selected vector index ivec
     134                                end
    134135                            end
    135136                        end
    136                     end
    137137                    end
    138138                end
  • trunk/src/mouse_motion.m

    r1097 r1098  
    339339        text_displ(ind_blank)=[];
    340340    end
    341     %set(handles.text_display,'String',text_displ)
    342341    set(htext_display,'String',text_displ)
    343342else
    344    %set(handles.text_display,'String',get(handles.text_display,'UserData'))
    345343   set(htext_display,'String',get(handles.text_display,'UserData'))
    346344end
  • trunk/src/mouse_up.m

    r1093 r1098  
    172172            if ~isempty(errormsg)
    173173                msgbox_uvmat('ERROR',errormsg)
    174                 return
     174%                 AxeData.Drawing='off';%exit the ruler drawing mode
     175%                 set(hcurrentaxes,'UserData',AxeData);
     176%                 set(gcf,'Pointer','arrow')
     177%                 return
    175178            end
    176179            set(hhuvmat.CheckViewField,'Value',1);%
  • trunk/src/plot_field.m

    r1097 r1098  
    114114
    115115%% check input structure
    116     [CellInfo,NbDimArray,errormsg]=find_field_cells(Data);
    117     if ~isempty(errormsg)
    118         msgbox_uvmat('ERROR',['input of plot_field/find_field_cells: ' errormsg]);
    119         return
    120     end
    121     index_0D=find(NbDimArray==0);
    122     index_1D=find(NbDimArray==1);
    123     index_2D=find(NbDimArray==2);%find 2D fields
    124     index_3D=find(NbDimArray>2,1);
    125     if ~isempty(index_3D)
    126         msgbox_uvmat('ERROR','volume plot not implemented yet');
    127         return
    128     end
     116[CellInfo,NbDimArray,errormsg]=find_field_cells(Data);
     117if ~isempty(errormsg)
     118    msgbox_uvmat('ERROR',['input of plot_field/find_field_cells: ' errormsg]);
     119    return
     120end
     121index_0D=find(NbDimArray==0);
     122index_1D=find(NbDimArray==1);
     123index_2D=find(NbDimArray==2);%find 2D fields
     124index_3D=find(NbDimArray>2,1);
     125if ~isempty(index_3D)
     126    msgbox_uvmat('ERROR','volume plot not implemented yet');
     127    return
     128end
    129129
    130130%% test axes and figure
  • trunk/src/plot_object.m

    r1093 r1098  
    136136
    137137%% determine the coordinates xline, yline,xsup,xinf, yinf,ysup determining the new object plot
    138 %test_line= isequal(ObjectData.Type,'points')||isequal(ObjectData.Type,'line')||...
    139 %   isequal(ObjectData.Type,'polyline')||isequal(ObjectData.Type,'polygon')|| isequal(ObjectData.Type,'plane')|| isequal(ObjectData.Type,'volume');
    140 %test_patch=isequal(ObjectData.ProjMode,'inside')||isequal(ObjectData.ProjMode,'outside')||isequal(ObjectData.Type,'volume')...
    141 %    ||isequal(ObjectData.ProjMode,'mask_inside')||isequal(ObjectData.ProjMode,'mask_outside');
    142138test_line=ismember(ObjectData.Type,{'points','line','polyline','polygon','plane','plane_z','volume'});
    143139test_patch=ismember(ObjectData.ProjMode,{'inside','outside','mask_inside','mask_outside'});
     
    346342                    %complement missing points
    347343                    if length(PlotData.SubObject)>nbpoints% fpoints in excess on the graph
    348                         for ii=nbpoints+1: length(PlotData.SubObject);
     344                        for ii=nbpoints+1: length(PlotData.SubObject)
    349345                            if ishandle(PlotData.SubObject(ii))
    350346                                delete(PlotData.SubObject(ii))
     
    352348                        end
    353349                    end
    354                     %                NbDeformPoint=nbpoints;
    355                    
    356350                    if nbpoints>length(PlotData.SubObject)
    357351                        for ipt=length(PlotData.SubObject)+1:nbpoints
     
    374368        if isfield(PlotData,'DeformPoint')
    375369            NbDeformPoint=length(PlotData.DeformPoint);
    376             if NbDeformPoint>nbpoints% fpoints in excess on the graph
     370            % delete deformpoints in excess on the graph
     371            if NbDeformPoint>nbpoints
    377372                for ii=nbpoints+1:NbDeformPoint
    378373                    if ishandle(PlotData.DeformPoint(ii))
     
    382377                NbDeformPoint=nbpoints;
    383378            end
     379            % update the position of the existing deformpoints
    384380            for ipt=1:NbDeformPoint
    385381                if ishandle(PlotData.DeformPoint(ipt))
     
    389385                end
    390386            end
     387            % add neww deform points if requested
    391388            if nbpoints>length(PlotData.DeformPoint)
    392389                for ipt=length(PlotData.DeformPoint)+1:nbpoints
    393390                    PlotData.DeformPoint(ipt)=line(xline(ipt),yline(ipt),'Color',col,'LineStyle','-','Tag','DeformPoint',...
    394                         'SelectionHighlight','off','UserData',hplot);
     391                        'Marker','.','MarkerSize',12,'SelectionHighlight','off','UserData',hplot);
    395392                end
    396393                set(hplot,'UserData',PlotData)
     
    431428%% create the object
    432429if test_newobj
    433 %     axes(haxes)
    434430    hother=findobj('Tag','proj_object');%find all the proj objects
    435431    for iobj=1:length(hother)
     
    456452            for ipt=1:length(xline)
    457453                PlotData.DeformPoint(ipt)=line(ObjectData.Coord(ipt,1),ObjectData.Coord(ipt,2),'Color',...
    458                     col,'LineStyle','none','SelectionHighlight','off','UserData',hh,'Tag','DeformPoint');
     454                    col,'LineStyle','none','Marker','.','MarkerSize',12,'SelectionHighlight','off','UserData',hh,'Tag','DeformPoint');
    459455                %create circle around each point
    460456                if ~isequal(YMax,0)
     
    470466                for ipt=1:sizcoord(1)
    471467                    PlotData.DeformPoint(ipt)=line(ObjectData.Coord(ipt,1),ObjectData.Coord(ipt,2),'Color',...
    472                         col,'LineStyle','none','Marker','.','Tag','DeformPoint','SelectionHighlight','off','UserData',hh);
     468                        col,'LineStyle','none','Marker','.','MarkerSize',12,'Tag','DeformPoint','SelectionHighlight','off','UserData',hh);
    473469                end
    474470        case {'plane','volume'}
  • trunk/src/proj_field.m

    r1096 r1098  
    817817                    ObjectData.Coord(1,3)=0;
    818818                end
    819                 dline=ObjectData.Coord(2,:)-ObjectData.Coord(1,:); 
     819                dline=ObjectData.Coord(2,:)-ObjectData.Coord(1,:);
    820820                linelength=norm(dline);
    821821                if isfield(FieldData,'RangeX')
     
    825825                end
    826826                ProjData.(AXName)=XMin:ObjectData.DX:XMin+linelength;%abscissa of the projected data along the line
    827                
     827                
    828828                XI_proj=ObjectData.Coord(1,1)*ones(size(ProjData.(AXName)));
    829829                YI_proj=ObjectData.Coord(1,2)*ones(size(ProjData.(AXName)));
     
    839839                end
    840840                for ivar=VarIndex
    841                                       VarName=FieldData.ListVarName{ivar};
     841                    VarName=FieldData.ListVarName{ivar};
    842842                    %                         ListVarName=[ListVarName VarName];
    843843                    %                         VarDimName=[VarDimName {{'coord_y','coord_x'}}];
     
    852852                    ProjData.(VarName)=interp3(Coord{3},Coord{2},Coord{1},double(FieldData.(VarName)),XI_proj,YI_proj,ZI_proj,'*linear');
    853853                    ProjData.(VarName)=squeeze(ProjData.(VarName));
    854                 end           
    855            
     854                end
     855               
    856856            else
    857857                AYName=FieldData.ListVarName{CellInfo{icell}.CoordIndex(end-1)};
     
    895895                dliny=ObjectData.Coord(2,2)-ObjectData.Coord(1,2);
    896896                linelength=sqrt(dlinx*dlinx+dliny*dliny);
    897                 theta=angle(dlinx+i*dliny);%angle of the line
     897                theta=angle(dlinx+1i*dliny);%angle of the line
    898898                if isfield(FieldData,'RangeX')
    899899                    XMin=min(FieldData.RangeX);%shift of the origin on the line
     
    923923                else
    924924                    errormsg='multicomponent field not projected';
    925                     display(errormsg)
    926925                    return
    927926                end
     
    931930                ProjData.VarAttribute{nbvar}.Role='coord_x';
    932931                for ivar=VarIndex
    933                     %VarName{ivar}=FieldData.ListVarName{ivar};
    934932                    if test_interp2% interpolate on new grid
    935933                        FieldData.(FieldData.ListVarName{ivar})=interp2(FieldData.(AXName),FieldData.(AYName),FieldData.(FieldData.ListVarName{ivar}),AXI,AYI');
     
    969967                    ProjData.VarDimName{end}={AXName,'rgb'};
    970968                end
    971     end
    972    
    973 end
    974 % for vector fields, take the components longitudinal and tranverse to the projection line
    975 if ~isempty(ivar_U) && ~isempty(ivar_V)
    976     vector_x =ProjData.(ProjData.ListVarName{ivar_U});
    977     ProjData.(ProjData.ListVarName{ivar_U}) =cos(theta)*vector_x+sin(theta)*ProjData.(ProjData.ListVarName{ivar_V});
    978     ProjData.(ProjData.ListVarName{ivar_V}) =-sin(theta)*vector_x+cos(theta)*ProjData.(ProjData.ListVarName{ivar_V});
    979 end
     969            end
     970           
     971    end
     972    % for vector fields, take the components longitudinal and tranverse to the projection line
     973    if ~isempty(ivar_U) && ~isempty(ivar_V)
     974        vector_x =ProjData.(ProjData.ListVarName{ivar_U});
     975        ProjData.(ProjData.ListVarName{ivar_U}) =cos(theta)*vector_x+sin(theta)*ProjData.(ProjData.ListVarName{ivar_V});
     976        ProjData.(ProjData.ListVarName{ivar_V}) =-sin(theta)*vector_x+cos(theta)*ProjData.(ProjData.ListVarName{ivar_V});
     977    end
    980978end
    981979
  • trunk/src/series/civ_input.m

    r1097 r1098  
    17951795
    17961796if get(handles.TestPatch1,'Value')% if TestPatch1 is activated
    1797      set(handles.TestPatch1,'BackgroundColor',[1 1 0])%paint TestPatch1 button in yellow to indicate activation
    1798      set(handles.Civ1,'BackgroundColor',[1 1 0])% indicate civ1 calculation is performed
    1799      hseries=findobj(allchild(0),'Tag','series');
    1800      Param=read_GUI(hseries);
    1801      Param.Action.RUN=1;
    1802      Param.ActionInput=read_GUI(handles.civ_input);
    1803      if isfield(Param.ActionInput,'Civ2')%remove options that may be selected beyond Patch1
    1804          Param.ActionInput=rmfield(Param.ActionInput,'Civ2');
    1805      end
    1806      if isfield(Param.ActionInput,'Fix2')
    1807          Param.ActionInput=rmfield(Param.ActionInput,'Fix2');
    1808      end
    1809      if isfield(Param.ActionInput,'Patch2')
    1810          Param.ActionInput=rmfield(Param.ActionInput,'Patch2');
    1811      end
    1812      if isfield(Param,'OutputSubDir')
    1813          Param=rmfield(Param,'OutputSubDir'); %remove output file option from civ_series
    1814      end
    1815      ParamPatch1=Param.ActionInput.Patch1; %store the patch1 parameters
    1816      Param.ActionInput=rmfield(Param.ActionInput,'Patch1');% does not execute Patch
    1817      Param.IndexRange.first_i=str2num(get(handles.ref_i,'String'));
    1818      Param.IndexRange.last_i=Param.IndexRange.first_i;
    1819      if strcmp(get(handles.ref_j,'Visible'),'on')
    1820          Param.IndexRange.first_j=str2num(get(handles.ref_j,'String'));
    1821          Param.IndexRange.last_j=Param.IndexRange.first_j;
    1822      else
    1823          Param.IndexRange.first_j=1;
    1824          Param.IndexRange.last_j=1;
    1825      end
    1826      [Data,errormsg]=civ_series(Param);% get the civ1+fix1 results
    1827      bckcolor=get(handles.civ_input,'Color');
    1828      set(handles.Civ1,'BackgroundColor',bckcolor)% indicate civ1 calculation is finished
    1829      
    1830      %% prepare Param for iterative Patch processing without input file reading
    1831      Param.Civ1_X=Data.Civ1_X;
    1832      Param.Civ1_Y=Data.Civ1_Y;
    1833      Param.Civ1_U=Data.Civ1_U;
    1834      Param.Civ1_V=Data.Civ1_V;
    1835      Param.Civ1_FF=Data.Civ1_FF;
    1836      Param=rmfield(Param,'InputTable');%desactivate input file reading
    1837     if isfield(Param.ActionInput,'Civ1')
    1838         Param.ActionInput=rmfield(Param.ActionInput,'Civ1');%desactivate civ1: remove civ1 input param if relevant
    1839     end
    1840     if isfield(Param.ActionInput,'Fix1')
    1841         Param.ActionInput=rmfield(Param.ActionInput,'Fix1');%desactivate fix1:remove fix1 input param if relevant
    1842     end
    1843     SmoothingParam=(ParamPatch1.FieldSmooth/10)*2.^(1:7);%scan the smoothing param from 1/10 to 12.8 current value
    1844     NbGood=numel(find(Data.Civ1_FF==0));
    1845     NbExclude=zeros(1,7);% initialize the set of smoothing parameters
    1846     DiffVel=zeros(1,7);% initialize the rms difference between patch and civ
    1847     Param.ActionInput.Patch1=ParamPatch1;% retrieve Patch1 parameters
    1848     for irho=1:7
    1849         Param.ActionInput.Patch1.FieldSmooth=SmoothingParam(irho);
    1850         [Data,errormsg]= civ_series(Param);%apply the processing fct
    1851         if ~isempty(errormsg)
    1852             msgbox_uvmat('ERROR',errormsg)
    1853             return
    1854         end
    1855         ind_good=find(Data.Civ1_FF==0);
    1856         Civ1_U_Diff=Data.Civ1_U(ind_good)-Data.Civ1_U_smooth(ind_good);
    1857         Civ1_V_Diff=Data.Civ1_V(ind_good)-Data.Civ1_V_smooth(ind_good);
    1858         DiffVel(irho)=sqrt(mean(Civ1_U_Diff.*Civ1_U_Diff+Civ1_V_Diff.*Civ1_V_Diff));
    1859         NbExclude(irho)=(NbGood-numel(ind_good))/NbGood;
    1860     end
    1861     figure(1)
    1862     semilogx(SmoothingParam,DiffVel,'b',SmoothingParam,NbExclude,'r',SmoothingParam,0.2*ones(size(SmoothingParam)),'m')
    1863     grid on
    1864     legend('rms velocity diff. Patch1-Civ1 (pixels)','proportion of excluded vectors (between 0 to 1)','recommended diff Patch1-Civ1')
    1865     xlabel('smoothing parameter')
    1866     ylabel('smoothing effect')
    1867     set(handles.TestPatch1,'BackgroundColor',[0 1 0])
    1868 else
    1869     corrfig=findobj(allchild(0),'tag','corrfig');% look for a current figure for image correlation display
    1870     if ~isempty(corrfig)
    1871         delete(corrfig)
    1872     end
    1873     hview_field=findobj(allchild(0),'tag','view_field');% look for view_field
    1874     if ~isempty(hview_field)
    1875         delete(hview_field)
    1876     end
    1877 end
    1878 
     1797    hseries=findobj(allchild(0),'Tag','series');
     1798    Param=read_GUI(hseries);
     1799    CivDir=fullfile(Param.OutputPath,Param.Experiment,Param.Device,[Param.OutputSubDir Param.OutputDirExt]);
     1800    % ListXml=dir(CivXmlDir);
     1801    if exist(CivDir,'dir')
     1802        CivFile=uigetfile_uvmat('pick .nc file with civ1-fix1 data',CivDir,'.nc');
     1803        [Field,VelTypeOut,errormsg]=read_civdata(CivFile)
     1804        for ilist=1:numel(Field.ListGlobalAttribute)
     1805            r=regexp(Field.ListGlobalAttribute{ilist},'Civ1_(?<field>.+)','names');% \D = not a digit, \d =digi
     1806            if ~isempty(r)
     1807                ParamTest.Civ1.(r.field)=(Field.(['Civ1_' r.field]));
     1808            end
     1809            r=regexp(Field.ListGlobalAttribute{ilist},'Fix1_(?<field>.+)','names');% \D = not a digit, \d =digi
     1810            if ~isempty(r)
     1811                ParamTest.Fix1.(r.field)=(Field.(['Fix1_' r.field]));
     1812            end
     1813        end
     1814        fill_GUI(ParamTest,handles.civ_input)% fill the elements of the GUI series with the input parameters
     1815        drawnow
     1816        update_CivOptions(handles,0)
     1817       
     1818        set(handles.TestPatch1,'BackgroundColor',[1 1 0])%paint TestPatch1 button in yellow to indicate activation
     1819%         set(handles.Civ1,'BackgroundColor',[1 1 0])% indicate civ1 calculation is performed
     1820        Param.Action.RUN=1;
     1821         Param.ActionInput=read_GUI(handles.civ_input);
     1822         Param.ActionInput.CheckCiv1=0;% do not repeat Civ1 computation       
     1823        if isfield(Param.ActionInput,'Civ2')%remove options that may be selected beyond Patch1
     1824            Param.ActionInput=rmfield(Param.ActionInput,'Civ2');
     1825        end
     1826        if isfield(Param.ActionInput,'Fix2')
     1827            Param.ActionInput=rmfield(Param.ActionInput,'Fix2');
     1828        end
     1829        if isfield(Param.ActionInput,'Patch2')
     1830            Param.ActionInput=rmfield(Param.ActionInput,'Patch2');
     1831        end
     1832        if isfield(Param,'OutputSubDir')
     1833            Param=rmfield(Param,'OutputSubDir'); %remove output file option from civ_series
     1834        end
     1835        ParamPatch1=Param.ActionInput.Patch1; %store the patch1 parameters
     1836        Param.ActionInput=rmfield(Param.ActionInput,'Patch1');% does not execute Patch
     1837        Param.IndexRange.first_i=str2num(get(handles.ref_i,'String'));
     1838        Param.IndexRange.last_i=Param.IndexRange.first_i;
     1839        if strcmp(get(handles.ref_j,'Visible'),'on')
     1840            Param.IndexRange.first_j=str2num(get(handles.ref_j,'String'));
     1841            Param.IndexRange.last_j=Param.IndexRange.first_j;
     1842        else
     1843            Param.IndexRange.first_j=1;
     1844            Param.IndexRange.last_j=1;
     1845        end
     1846        [Data,errormsg]=civ_series(Param);% get the civ1+fix1 results
     1847        bckcolor=get(handles.civ_input,'Color');
     1848        set(handles.Civ1,'BackgroundColor',bckcolor)% indicate civ1 calculation is finished
     1849       
     1850        %% prepare Param for iterative Patch processing without input file reading
     1851        Param.Civ1_X=Data.Civ1_X;
     1852        Param.Civ1_Y=Data.Civ1_Y;
     1853        Param.Civ1_U=Data.Civ1_U;
     1854        Param.Civ1_V=Data.Civ1_V;
     1855        Param.Civ1_FF=Data.Civ1_FF;
     1856        Param=rmfield(Param,'InputTable');%desactivate input file reading
     1857        if isfield(Param.ActionInput,'Civ1')
     1858            Param.ActionInput=rmfield(Param.ActionInput,'Civ1');%desactivate civ1: remove civ1 input param if relevant
     1859        end
     1860        if isfield(Param.ActionInput,'Fix1')
     1861            Param.ActionInput=rmfield(Param.ActionInput,'Fix1');%desactivate fix1:remove fix1 input param if relevant
     1862        end
     1863        SmoothingParam=(ParamPatch1.FieldSmooth/10)*2.^(1:7);%scan the smoothing param from 1/10 to 12.8 current value
     1864        NbGood=numel(find(Data.Civ1_FF==0));
     1865        NbExclude=zeros(1,7);% initialize the set of smoothing parameters
     1866        DiffVel=zeros(1,7);% initialize the rms difference between patch and civ
     1867        Param.ActionInput.Patch1=ParamPatch1;% retrieve Patch1 parameters
     1868        for irho=1:7
     1869            Param.ActionInput.Patch1.FieldSmooth=SmoothingParam(irho);
     1870            [Data,errormsg]= civ_series(Param);%apply the processing fct
     1871            if ~isempty(errormsg)
     1872                msgbox_uvmat('ERROR',errormsg)
     1873                return
     1874            end
     1875            ind_good=find(Data.Civ1_FF==0);
     1876            Civ1_U_Diff=Data.Civ1_U(ind_good)-Data.Civ1_U_smooth(ind_good);
     1877            Civ1_V_Diff=Data.Civ1_V(ind_good)-Data.Civ1_V_smooth(ind_good);
     1878            DiffVel(irho)=sqrt(mean(Civ1_U_Diff.*Civ1_U_Diff+Civ1_V_Diff.*Civ1_V_Diff));
     1879            NbExclude(irho)=(NbGood-numel(ind_good))/NbGood;
     1880        end
     1881        figure(1)
     1882        semilogx(SmoothingParam,DiffVel,'b',SmoothingParam,NbExclude,'r',SmoothingParam,0.2*ones(size(SmoothingParam)),'m')
     1883        grid on
     1884        legend('rms velocity diff. Patch1-Civ1 (pixels)','proportion of excluded vectors (between 0 to 1)','recommended diff Patch1-Civ1')
     1885        xlabel('smoothing parameter')
     1886        ylabel('smoothing effect')
     1887        set(handles.TestPatch1,'BackgroundColor',[0 1 0])
     1888    else
     1889        corrfig=findobj(allchild(0),'tag','corrfig');% look for a current figure for image correlation display
     1890        if ~isempty(corrfig)
     1891            delete(corrfig)
     1892        end
     1893        hview_field=findobj(allchild(0),'tag','view_field');% look for view_field
     1894        if ~isempty(hview_field)
     1895            delete(hview_field)
     1896        end
     1897    end
     1898else
     1899    msgbox_uvmat('ERROR','no output file: first perform a civ1-fix1 computation')
     1900    return
     1901end
     1902 
    18791903%------------------------------------------------------------------------
    18801904% --- Executes on button press in TestCiv2.
  • trunk/src/series/sub_background_special.m

    r1097 r1098  
    5050%     UVMAT is free software; you can redistribute it and/or modify
    5151%     it under the terms of the GNU General Public License as published
    52 %     by the Free Software Foundation; either version 2 of the license,
     52%     by the Free Software Foundation; either version 2 of the license,series
    5353%     or (at your option) any later version.
    5454%
     
    6666    ParamOut.AllowInputSort='off';% allow alphabetic sorting of the list of input file SubDir (options 'off'/'on', 'off' by default)
    6767    ParamOut.WholeIndexRange='on';% prescribes the file index ranges from min to max (options 'off'/'on', 'off' by default)
    68     ParamOut.NbSlice='off'; %nbre of slices ('off' by default)
     68    ParamOut.NbSlice='on'; %nbre of slices ('off' by default)
    6969    ParamOut.VelType='off';% menu for selecting the velocity type (options 'off'/'one'/'two',  'off' by default)
    7070    ParamOut.FieldName='off';% menu for selecting the field (s) in the input file(options 'off'/'one'/'two', 'off' by default)
     
    9393end
    9494%% estimate the position of bottom and mask for each Z Index
    95 BottomIndex=[1900 1800 1700 1650 1650 1600 1600 1600 1600 1600 1600];
     95NbSlice=Param.IndexRange.NbSlice;
     96switch NbSlice
     97    case 11
     98        BottomIndex=[1900 1800 1700 1650 1650 1600 1600 1600 1600 1600 1600];
     99    case 4
     100        BottomIndex=[1950 1850 1740 1700];
     101end
    96102MaxIndex=BottomIndex+100;
    97103MinIndex=BottomIndex-100;
     104
    98105maskindex=[665 1080];% range of x index perturbed by shadows
    99 NbSlice=11;
    100106Bfilter=ones(1,20)/20;
    101107%% root input file names and nomenclature type (cell arrays with one element)
    102 OutputDir=[Param.OutputSubDir Param.OutputDirExt];
     108OutputDir=[Param.OutputSubDir Param.OutputDirExt];4
    103109nbj=numel(Param.IndexRange.first_i:Param.IndexRange.last_i);
    104110for i_ind=Param.IndexRange.first_i:Param.IndexRange.last_i
  • trunk/src/set_object.m

    r1093 r1098  
    596596
    597597%% update the object refresh
    598 hobject=UvData.ProjObject{IndexObj}.DisplayHandle.uvmat;
     598%hobject=UvData.ProjObject{IndexObj}.DisplayHandle.uvmat;
    599599% if we are editing the object used for projection in uvmat
    600600if isequal(IndexObj_1,IndexObj)
  • trunk/src/uvmat.m

    r1095 r1098  
    52795279
    52805280%% delete drawn objects if the output CooordUnit is different from the previous one
    5281 if  ~strcmp(CoordUnit,CoordUnitPrev)
    5282     set(handles.CheckFixLimits,'Value',0)
    5283     hother=findobj('Tag','proj_object');%find all the proj objects
    5284     for iobj=1:length(hother)
    5285         delete(hother(iobj))
    5286     end
    5287     hother=findobj('Tag','DeformPoint');%find all the proj objects
    5288     for iobj=1:length(hother)
    5289         delete(hother(iobj))
    5290     end
    5291     hh=findobj('Tag','calib_points');
    5292     if ~isempty(hh)
    5293         delete(hh)
    5294     end
    5295     hhh=findobj('Tag','calib_marker');
    5296     if ~isempty(hhh)
    5297         delete(hhh)
    5298     end
    5299     set(handles.ListObject,'Value',1)
    5300     set(handles.ListObject,'String',{''})
    5301     set(handles.ListObject_1,'Value',1)
    5302     set(handles.ListObject_1,'String',{''})
    5303     set(handles.CheckViewObject,'value',0)
    5304     CheckViewObject_Callback(hObject, eventdata, handles)
    5305     set(handles.CheckViewField,'value',0)
    5306     CheckViewField_Callback(hObject, eventdata, handles)
    5307     set(handles.CheckEditObject,'Value',0)
    5308     CheckEditObject_Callback(hObject, eventdata, handles)
    5309     UvData.ProjObject={[]};
    5310 end
     5281% if  ~strcmp(CoordUnit,CoordUnitPrev)
     5282%     set(handles.CheckFixLimits,'Value',0)
     5283%     hother=findobj('Tag','proj_object');%find all the proj objects
     5284%     for iobj=1:length(hother)
     5285%         delete(hother(iobj))
     5286%     end
     5287%     hother=findobj('Tag','DeformPoint');%find all the proj objects
     5288%     for iobj=1:length(hother)
     5289%         delete(hother(iobj))
     5290%     end
     5291%     hh=findobj('Tag','calib_points');
     5292%     if ~isempty(hh)
     5293%         delete(hh)
     5294%     end
     5295%     hhh=findobj('Tag','calib_marker');
     5296%     if ~isempty(hhh)
     5297%         delete(hhh)
     5298%     end
     5299%     set(handles.ListObject,'Value',1)
     5300%     set(handles.ListObject,'String',{''})
     5301%     set(handles.ListObject_1,'Value',1)
     5302%     set(handles.ListObject_1,'String',{''})
     5303%     set(handles.CheckViewObject,'value',0)
     5304%     CheckViewObject_Callback(hObject, eventdata, handles)
     5305%     set(handles.CheckViewField,'value',0)
     5306%     CheckViewField_Callback(hObject, eventdata, handles)
     5307%     set(handles.CheckEditObject,'Value',0)
     5308%     CheckEditObject_Callback(hObject, eventdata, handles)
     5309%     UvData.ProjObject={[]};
     5310% end
    53115311set(handles.uvmat,'UserData',UvData)
    53125312set(handles.TransformName,'backgroundColor',[1 1 1])% indicate desactivation  of the menu
Note: See TracChangeset for help on using the changeset viewer.