Index: /trunk/src/calc_field.m
===================================================================
--- /trunk/src/calc_field.m	(revision 516)
+++ /trunk/src/calc_field.m	(revision 517)
@@ -25,6 +25,6 @@
 % varname_generator.m: determines the field names to read in the netcdf
 % file, depending on the scalar
-
-function [DataOut,errormsg]=calc_field(FieldList,DataIn,Coord_interp)
+function [FieldOptions,ColorList]=calc_field
+%function [DataOut,errormsg]=calc_field(FieldList,DataIn,Coord_interp)
 
 %list of defined scalars to display in menus (in addition to 'ima_cor').
@@ -49,10 +49,15 @@
     'w_normal';... %w velocity component normal to the plane
     'error'}; %error associated to a vector (for stereo or patch)
-errormsg=[]; %default error message
-if ~exist('FieldList','var')
-    DataOut=FieldOptions;% gives the list of possible field inputs in the absence of input
-    return
-end
-
+ColorList={'C';...%image correlation corresponding to a vel vector
+    'norm(U,V)';...%norm of the velocity
+    'U';... %u velocity component
+    'V';... %v velocity component
+    }
+% errormsg=[]; %default error message
+% if ~exist('FieldList','var')
+%     DataOut=FieldOptions;% gives the list of possible field inputs in the absence of input
+%     return
+% end
+return
 %% check input
 if ~exist('DataIn','var')
Index: /trunk/src/calc_field_interp.m
===================================================================
--- /trunk/src/calc_field_interp.m	(revision 516)
+++ /trunk/src/calc_field_interp.m	(revision 517)
@@ -1,4 +1,4 @@
 
-%'calc_field': defines fields (velocity, vort, div...) from civx data and calculate them
+%'calc_field': defines fields (velocity, vort, div...) from civ data and calculate them
 %---------------------------------------------------------------------
 % [DataOut,VarAttribute,errormsg]=calc_field_interp(Coord_tps,NbSites,SubRange,FieldVar,Operation,Coord_interp)
@@ -15,5 +15,5 @@
 % Coord_interp: coordiantes of sites on which the fields need to be calculated
 
-function [VarVal,ListVarName,VarAttribute,errormsg]=calc_field_interp(Coord,FieldVar,Operation,XI,YI)
+function [VarVal,ListVarName,VarAttribute,errormsg]=calc_field_interp(Coord,Data,Operation,XI,YI)
 
 VarVal=[];
@@ -21,51 +21,84 @@
 VarAttribute={};
 errormsg='';
-check_u=0;
-check_v=0;
-for ilist=1:length(Operation)
-    switch Operation{ilist}
-        case {'U'}
-           check_u=1;
-        case {'V'}
-            check_v=1;
-          case {'vec(U,V)','norm(U,V)'}  
-             check_u=1;
-             check_v=1;
+InputVarList={};
+if ischar(Operation),Operation={Operation};end
+for ilist=1:numel(Operation)
+    r=regexp(Operation{ilist},'(?<Operator>(^vec|^norm))\((?<UName>.+),(?<VName>.+)\)$','names');
+    if isempty(r) % the operation is the variable
+        if isempty(find(strcmp(Operation{ilist},InputVarList)));
+            InputVarList=[InputVarList Operation{ilist}];
+        end
+        Operator{ilist}='';
+    else
+        UName{ilist}=r.UName;
+        VName{ilist}=r.VName;
+        if isempty(find(strcmp(r.UName,InputVarList)));
+            InputVarList=[InputVarList UName{ilist}];
+        end
+        if isempty(find(strcmp(r.VName,InputVarList)));
+            InputVarList=[InputVarList VName{ilist}];
+        end
+        Operator{ilist}=r.Operator;
     end
 end
-if check_u
-    F_u = TriScatteredInterp(Coord,FieldVar(:,1),'linear');
+%create interpolator for linear interpolation
+if exist('XI','var')
+    for ilist=1:numel(InputVarList)
+        F.(InputVarList{ilist})=TriScatteredInterp(Coord,Data.(InputVarList{ilist}),'linear');
+    end
 end
-if check_v
-    F_v = TriScatteredInterp(Coord,FieldVar(:,2),'linear');
-end
-for ilist=1:length(Operation)
+for ilist=1:numel(Operation)
     nbvar=numel(ListVarName);
-    switch Operation{ilist}
-        case 'vec(U,V)'
-            VarVal{nbvar+1}=F_u(XI,YI);
-            VarVal{nbvar+2}=F_v(XI,YI);
-            ListVarName{nbvar+1}='U';
-            ListVarName{nbvar+2}='V';
+    switch Operator{ilist}
+        case 'vec'
+            if exist('XI','var')
+                VarVal{nbvar+1}=F.(UName{ilist})(XI,YI);
+                VarVal{nbvar+2}=F.(VName{ilist})(XI,YI);
+            else
+                VarVal{nbvar+1}=Data.(UName{ilist});
+                VarVal{nbvar+2}=Data.(VName{ilist});
+            end
+            ListVarName{nbvar+1}=UName{ilist};
+            ListVarName{nbvar+2}=VName{ilist};
             VarAttribute{nbvar+1}.Role='vector_x';
             VarAttribute{nbvar+2}.Role='vector_y';
-        case 'U'
-            VarVal{nbvar+1}=F_u(XI,YI);
-            ListVarName{nbvar+1}='U';
+            %         case 'U'
+            %             VarVal{nbvar+1}=F_u(XI,YI);
+            %             ListVarName{nbvar+1}='U';
+            %             VarAttribute{nbvar+1}.Role='scalar';
+            %         case 'V'
+            %             VarVal{nbvar+1}=F_v(XI,YI);
+            %             ListVarName{nbvar+1}='V';
+            %             VarAttribute{nbvar+1}.Role='scalar';
+        case 'norm'
+            if exist('XI','var')
+                U2=F.(UName{ilist})(XI,YI).*F.(UName{ilist})(XI,YI);
+                V2=F.(VName{ilist})(XI,YI).*F.(VName{ilist})(XI,YI);
+            else
+                U2=Data.(UName{ilist}).*Data.(UName{ilist});
+                V2=Data.(VName{ilist}).*Data.(VName{ilist});
+            end
+            VarVal{nbvar+1}=sqrt(U2+V2);
+            ListVarName{nbvar+1}='norm';
             VarAttribute{nbvar+1}.Role='scalar';
-        case 'V'
-            VarVal{nbvar+1}=F_v(XI,YI);
-            ListVarName{nbvar+1}='V';
-            VarAttribute{nbvar+1}.Role='scalar';
-        case 'norm(U,V)'
-            VarVal{nbvar+1}=sqrt(F_u(XI,YI).*F_u(XI,YI)+F_v(XI,YI).*F_v(XI,YI));
-            ListVarName{nbvar+1}='norm(U,V)';
-            VarAttribute{nbvar+1}.Role='scalar';
+        otherwise
+            if ~isempty(Operation{ilist})
+                if exist('XI','var')
+                    VarVal{nbvar+1}=F.(Operation{ilist})(XI,YI);
+                else
+                    VarVal{nbvar+1}= Data.(Operation{ilist});
+                end
+                ListVarName{nbvar+1}=Operation{ilist};
+                VarAttribute{nbvar+1}.Role='scalar';
+            end
     end
 end
+% put an error flag to indicate NaN data
+if exist('XI','var')
 nbvar=numel(ListVarName);
 ListVarName{nbvar+1}='FF';
 VarVal{nbvar+1}=isnan(VarVal{nbvar});
 VarAttribute{nbvar+1}.Role='errorflag';
+end
 
 % Attr_FF.Role='errorflag';
Index: /trunk/src/geometry_calib.m
===================================================================
--- /trunk/src/geometry_calib.m	(revision 516)
+++ /trunk/src/geometry_calib.m	(revision 517)
@@ -1000,5 +1000,5 @@
 %axes(hhuvmat.axes3)
 set(0,'CurrentFigure',huvmat)
-set(huvmat,'CurrentAxes',hhuvmat.axes3)
+set(huvmat,'CurrentAxes',hhuvmat.PlotAxes)
 hh=findobj('Tag','calib_points');
 if  ~isempty(ObjectData.Coord) && isempty(hh)
Index: /trunk/src/get_field.m
===================================================================
--- /trunk/src/get_field.m	(revision 516)
+++ /trunk/src/get_field.m	(revision 517)
@@ -60,50 +60,50 @@
 %% prepare the list of RUN fcts and set their paths
 % functions included by default in 'get_field.m
-menu_str={'PLOT';'FFT';'filter_band'}; 
-nb_builtin=numel(menu_str);
-path_uvmat=fileparts(which('uvmat'));%path of the function 'uvmat'
-addpath(fullfile(path_uvmat,'get_field'))
-testexist=zeros(size(menu_str'));%default
-for ilist=1:length(menu_str)
-    if exist(menu_str{ilist},'file')
-        fct_handle{ilist,1}=str2func(menu_str{ilist});
-        testexist(ilist)=1;
-    else
-        fct_handle{ilist,1}=[];
-        testexist(ilist)=0;
-    end
-end
-rmpath(fullfile(path_uvmat,'get_field'))
-dir_perso=prefdir;
+% menu_str={'PLOT';'FFT';'filter_band'}; 
+% nb_builtin=numel(menu_str);
+% path_uvmat=fileparts(which('uvmat'));%path of the function 'uvmat'
+% addpath(fullfile(path_uvmat,'get_field'))
+% testexist=zeros(size(menu_str'));%default
+% for ilist=1:length(menu_str)
+%     if exist(menu_str{ilist},'file')
+%         fct_handle{ilist,1}=str2func(menu_str{ilist});
+%         testexist(ilist)=1;
+%     else
+%         fct_handle{ilist,1}=[];
+%         testexist(ilist)=0;
+%     end
+% end
+% rmpath(fullfile(path_uvmat,'get_field'))
+% dir_perso=prefdir;
 
 % look for functions previously used (names and paths saved in the personal file uvmat_perso.mat):
-profil_perso=fullfile(dir_perso,'uvmat_perso.mat');
-if exist(profil_perso,'file')
-      h=load (profil_perso);
-     if isfield(h,'get_field_fct') && iscell(h.get_field_fct)
-         for ilist=1:length(h.get_field_fct)
-            [path,file]=fileparts(h.get_field_fct{ilist});
-            addpath(path)        
-            if exist(file,'file')
-                h_func=str2func(file);
-                testexist=[testexist 1]; 
-             else
-                h_func=[];
-                testexist=[testexist 0]; 
-             end
-             fct_handle=[fct_handle; {h_func}]; %concatene the list of paths
-             rmpath(path)
-             menu_str=[menu_str; {file}]; 
-         end
-     end
-end
-
-menu_str=menu_str(testexist==1);%=menu_str(testexist~=0)
-fct_handle=fct_handle(testexist==1);
-menu_str=[menu_str;{'more...'}];
-set(handles.ACTION,'String',menu_str)
-set(handles.ACTION,'UserData',fct_handle)% store the list of path in UserData of ACTION
-set(handles.path_action,'String',fullfile(path_uvmat,'get_field'))
-set(handles.ACTION,'Value',1)% PLOT option selected
+% profil_perso=fullfile(dir_perso,'uvmat_perso.mat');
+% if exist(profil_perso,'file')
+%       h=load (profil_perso);
+%      if isfield(h,'get_field_fct') && iscell(h.get_field_fct)
+%          for ilist=1:length(h.get_field_fct)
+%             [path,file]=fileparts(h.get_field_fct{ilist});
+%             addpath(path)        
+%             if exist(file,'file')
+%                 h_func=str2func(file);
+%                 testexist=[testexist 1]; 
+%              else
+%                 h_func=[];
+%                 testexist=[testexist 0]; 
+%              end
+%              fct_handle=[fct_handle; {h_func}]; %concatene the list of paths
+%              rmpath(path)
+%              menu_str=[menu_str; {file}]; 
+%          end
+%      end
+% end
+
+% menu_str=menu_str(testexist==1);%=menu_str(testexist~=0)
+% fct_handle=fct_handle(testexist==1);
+% menu_str=[menu_str;{'more...'}];
+% set(handles.ACTION,'String',menu_str)
+% set(handles.ACTION,'UserData',fct_handle)% store the list of path in UserData of ACTION
+% set(handles.path_action,'String',fullfile(path_uvmat,'get_field'))
+% set(handles.ACTION,'Value',1)% PLOT option selected
 
 %% settings for 'slave' mode, called by uvamt, or 'master' mode
@@ -122,24 +122,24 @@
 
 %% load the list of previously browsed files for the upper bar menu Open
-dir_perso=prefdir;
-profil_perso=fullfile(dir_perso,'uvmat_perso.mat');%
-if exist(profil_perso,'file')
-    h=load (profil_perso);
-    if isfield(h,'MenuFile_1')
-        set(handles.MenuFile_1,'Label',h.MenuFile_1);
-    end
-    if isfield(h,'MenuFile_1')
-        set(handles.MenuFile_2,'Label',h.MenuFile_2);
-    end
-    if isfield(h,'MenuFile_1')
-        set(handles.MenuFile_3,'Label',h.MenuFile_3);
-    end
-    if isfield(h,'MenuFile_1')
-        set(handles.MenuFile_4,'Label',h.MenuFile_4);
-    end
-    if isfield(h,'MenuFile_1')
-        set(handles.MenuFile_5,'Label',h.MenuFile_5);
-    end
-end
+% dir_perso=prefdir;
+% profil_perso=fullfile(dir_perso,'uvmat_perso.mat');%
+% if exist(profil_perso,'file')
+%     h=load (profil_perso);
+%     if isfield(h,'MenuFile_1')
+%         set(handles.MenuFile_1,'Label',h.MenuFile_1);
+%     end
+%     if isfield(h,'MenuFile_1')
+%         set(handles.MenuFile_2,'Label',h.MenuFile_2);
+%     end
+%     if isfield(h,'MenuFile_1')
+%         set(handles.MenuFile_3,'Label',h.MenuFile_3);
+%     end
+%     if isfield(h,'MenuFile_1')
+%         set(handles.MenuFile_4,'Label',h.MenuFile_4);
+%     end
+%     if isfield(h,'MenuFile_1')
+%         set(handles.MenuFile_5,'Label',h.MenuFile_5);
+%     end
+% end
 
 %% put the GUI on the lower right of the sceen
@@ -831,40 +831,76 @@
 function RUN_Callback(hObject, eventdata, handles)
 %---------------------------------------------------------
-set(handles.RUN,'BackgroundColor',[1 1 0])% mark use of RUN action
-test_fig=get(handles.SelectFigure,'Value');
-
-% plot requested in uvmat
-if ~test_fig
-    inputfile=get(handles.inputfile,'String');
-    huvmat=findobj(allchild(0),'tag','uvmat');
-    if isempty(huvmat)
-        input.InputFile=inputfile;
-        input.FieldsString={'get_field...'};
-        uvmat(input)
-    else
-        set(huvmat,'Visible','on')%make uvmat visible (bugs can hide it in some cases)
-        hhuvmat=guidata(huvmat);
-        set(hhuvmat.Fields,'Value',1)
-        set(hhuvmat.Fields,'String',{'get_field...'})
-        uvmat('run0_Callback',hObject,eventdata,hhuvmat); % display field in uvmat
-    end
-   
-% other kind of plot
-else  %TODO: check and update: add plot on an existing axes
-    figcell=get(handles.list_fig,'String');
-    index=get(handles.list_fig,'value');
-    figstring=figcell{index};
-    index=get(handles.ACTION,'Value');
-    list_func=get(handles.ACTION,'UserData');
-    h_fun=list_func{index};
-    set(handles.RUN,'BackgroundColor',[0.831 0.816 0.784])
-    drawnow
-    SubField=h_fun(handles.get_field);%handles.figure1 =handles of the GUI get_field
-    if ~isempty(SubField)
-        plot_get_field(SubField,handles)
-    end
-    browse_fig(handles.list_fig); %update the list of new existing figures
-end
-set(handles.RUN,'BackgroundColor',[1 0 0])
+% set(handles.RUN,'BackgroundColor',[1 1 0])% mark use of RUN action
+% test_fig=get(handles.SelectFigure,'Value');
+% 
+% % plot requested in uvmat
+% if ~test_fig
+%     inputfile=get(handles.inputfile,'String');
+%     huvmat=findobj(allchild(0),'tag','uvmat');
+%     if isempty(huvmat)
+%         input.InputFile=inputfile;
+%         input.FieldsString={'get_field...'};
+%         uvmat(input)
+%     else
+%         set(huvmat,'Visible','on')%make uvmat visible (bugs can hide it in some cases)
+%         hhuvmat=guidata(huvmat);
+%         set(hhuvmat.Fields,'Value',1)
+%         set(hhuvmat.Fields,'String',{'get_field...'})
+%         uvmat('run0_Callback',hObject,eventdata,hhuvmat); % display field in uvmat
+%     end
+%    
+% % other kind of plot
+% else  %TODO: check and update: add plot on an existing axes
+%     figcell=get(handles.list_fig,'String');
+%     index=get(handles.list_fig,'value');
+%     figstring=figcell{index};
+%     index=get(handles.ACTION,'Value');
+%     list_func=get(handles.ACTION,'UserData');
+%     h_fun=list_func{index};
+%     set(handles.RUN,'BackgroundColor',[0.831 0.816 0.784])
+%     drawnow
+%     SubField=h_fun(handles.get_field);%handles.figure1 =handles of the GUI get_field
+%     if ~isempty(SubField)
+%         plot_get_field(SubField,handles)
+%     end
+%     browse_fig(handles.list_fig); %update the list of new existing figures
+% end
+% set(handles.RUN,'BackgroundColor',[1 0 0])
+huvmat=findobj(allchild(0),'tag','uvmat');
+if ~isempty(huvmat)
+         set(huvmat,'Visible','on')%make uvmat visible (bugs can hide it in some cases)
+         hhuvmat=guidata(huvmat);
+         get_field_GUI=read_GUI(handles.get_field);
+         if isfield(get_field_GUI,'PanelVectors')
+             set(hhuvmat.Coord_x,'value',1)
+             set(hhuvmat.Coord_y,'value',1)
+             set(hhuvmat.Coord_x,'String',{get_field_GUI.PanelVectors.coord_x_vectors})
+             set(hhuvmat.Coord_y,'String',{get_field_GUI.PanelVectors.coord_y_vectors})
+             UName=get_field_GUI.PanelVectors.vector_x;
+             VName=get_field_GUI.PanelVectors.vector_y;
+             menu_str=[{['vec(' UName ',' VName ')']};{UName};{VName};{['norm(' UName ',' VName ')']};{'get_field...'}];
+             menu_color=[{''};{UName};{VName};{['norm(' UName ',' VName ')']}];
+             FieldsMenu=get(hhuvmat.Fields,'String');
+             Fields=FieldsMenu{get(hhuvmat.Fields,'Value')};
+             if strcmp(Fields,'get_field...')
+                  set(hhuvmat.Fields,'Value',1)
+                 set(hhuvmat.Fields,'String',menu_str)
+             else %get_field has been called by Fields_1
+                  set(hhuvmat.Fields_1,'Value',1)
+                 set(hhuvmat.Fields_1,'String',menu_str)
+             end
+             ind_menu=find(strcmp(get_field_GUI.PanelVectors.vec_color,menu_color));
+             if ~isempty(ind_menu)
+             set(hhuvmat.ColorScalar,'Value',ind_menu)
+             else
+                 set(hhuvmat.ColorScalar,'Value',1)
+             end
+               set(hhuvmat.ColorScalar,'String',menu_color)
+         end
+end
+delete(handles.get_field)
+%         set(hhuvmat.Fields,'String',{'get_field...'})
+%         uvmat('run0_Callback',hObject,eventdata,hhuvmat); % display field in uvmat
+%     end
 
 %------------------------------------------------------------------------
Index: /trunk/src/nc2struct.m
===================================================================
--- /trunk/src/nc2struct.m	(revision 516)
+++ /trunk/src/nc2struct.m	(revision 517)
@@ -145,4 +145,13 @@
         Data.ListVarName=ListVarNameNetcdf;
     else   %select input variables, if requested by the input ListVarName
+        ind_remove=[];
+        for ivar=1:numel(ListVarName) % check redondancy
+            if ~isempty(find(strcmp(ListVarName{ivar},ListVarName(1:ivar-1))))
+                ind_remove=[ind_remove ivar];
+            end
+        end
+        if ~isempty(ind_remove)
+            ListVarName(ind_remove)=[];
+        end           
         sizvar=size(ListVarName);
         testmulti=(sizvar(1)>1);%test for multiple choice of variable ranked by order of priority
Index: /trunk/src/plot_field.m
===================================================================
--- /trunk/src/plot_field.m	(revision 516)
+++ /trunk/src/plot_field.m	(revision 517)
@@ -540,5 +540,5 @@
 for icell=1:length(CellVarIndex) % length(CellVarIndex) =1 or 2 (from the calling function)
     VarType=VarTypeCell{icell};
-    if ~isempty(VarType.coord_tps)
+    if ~isempty(VarType.coord_tps) %do not plot directly tps data (used for projection only)
         continue
     end
@@ -566,12 +566,12 @@
             vec_U=Data.(Data.ListVarName{ivar_U}); 
             vec_V=Data.(Data.ListVarName{ivar_V});
-            if ~isempty(ivar_X) && ~isempty(ivar_Y)% 2D field (with unstructured coordinates or structured ones (then ivar_X and ivar_Y empty)
+            if ~isempty(ivar_X) && ~isempty(ivar_Y)% 2D field with unstructured coordinates 
                 XName=Data.ListVarName{ivar_X};
                 YName=Data.ListVarName{ivar_Y};
-                eval(['vec_X=reshape(Data.' XName ',[],1);']) 
-                eval(['vec_Y=reshape(Data.' YName ',[],1);'])
+                vec_X=reshape(Data.(XName),[],1); %transform vectors in column matlab vectors
+                vec_Y=reshape(Data.(YName),[],1);
             elseif numel(VarType.coord)==2 && ~isequal(VarType.coord,[0 0]);%coordinates defines by dimension variables
-                eval(['y=Data.' Data.ListVarName{VarType.coord(1)} ';']) 
-                eval(['x=Data.' Data.ListVarName{VarType.coord(2)} ';'])
+                y=Data.(Data.ListVarName{VarType.coord(1)});
+                x=Data.(Data.ListVarName{VarType.coord(2)});
                 if numel(y)==2 % y defined by first and last values on aregular mesh
                     y=linspace(y(1),y(2),size(vec_U,1));
@@ -585,8 +585,12 @@
                 return
             end
-            if ~isempty(ivar_C)
-                 eval(['vec_C=Data.' Data.ListVarName{ivar_C} ';']) ;
-                 vec_C=reshape(vec_C,1,numel(vec_C));
+            if isfield(PlotParam.Vectors,'ColorScalar') && ~isempty(PlotParam.Vectors.ColorScalar)
+                [VarVal,ListVarName,VarAttribute,errormsg]=calc_field_interp([],Data,PlotParam.Vectors.ColorScalar);
+%             if ~isempty(ivar_C)
+                 %vec_C=Data.(Data.ListVarName{ivar_C});
+                 if ~isempty(VarVal)
+                 vec_C=reshape(VarVal{1},1,numel(VarVal{1}));
                  test_C=1;
+                 end
             end
             if ~isempty(ivar_F)%~(isfield(PlotParam.Vectors,'HideWarning')&& isequal(PlotParam.Vectors.HideWarning,1)) 
Index: /trunk/src/proj_field.m
===================================================================
--- /trunk/src/proj_field.m	(revision 516)
+++ /trunk/src/proj_field.m	(revision 517)
@@ -1181,5 +1181,5 @@
                         FieldVar=FieldData.(VarName_scalar);
                     end
-                    [VarVal,ListFieldProj,VarAttribute,errormsg]=calc_field_interp([coord_X coord_Y],FieldVar,VarType.Operation,XI,YI);
+                    [VarVal,ListFieldProj,VarAttribute,errormsg]=calc_field_interp([coord_X coord_Y],FieldData,VarType.Operation,XI,YI);
                     if isfield(VarType,'CheckSub') && VarType.CheckSub && ~isempty(vector_x_proj)
                         ProjData.(ProjData.ListVarName{vector_x_proj})=ProjData.(ProjData.ListVarName{vector_x_proj})-VarVal{1};
Index: /trunk/src/read_GUI.m
===================================================================
--- /trunk/src/read_GUI.m	(revision 516)
+++ /trunk/src/read_GUI.m	(revision 517)
@@ -60,8 +60,8 @@
                                     input=listinput;
                                 else
-                            input=listinput{value};
+                                    input=listinput{value};
                                 end
                             else % multiple selection
-                              input=listinput(value);  
+                                input=listinput(value);
                             end
                         else
Index: /trunk/src/read_civdata.m
===================================================================
--- /trunk/src/read_civdata.m	(revision 516)
+++ /trunk/src/read_civdata.m	(revision 517)
@@ -47,5 +47,5 @@
 % 'nc2struct': reads a netcdf file 
 
-function [Field,VelTypeOut,errormsg]=read_civdata(filename,FieldNames,VelType,CivStage)
+function [Field,VelTypeOut,errormsg]=read_civdata(filename,FieldNames,VelType)
 
 %% default input
@@ -77,5 +77,6 @@
 
 %% reading data
-[varlist,role,VelTypeOut]=varcivx_generator(FieldRequest,VelType,CivStage);
+Data=nc2struct(filename,'ListGlobalAttribute','CivStage');
+[varlist,role,VelTypeOut]=varcivx_generator(FieldRequest,VelType,Data.CivStage);
 if isempty(varlist)
     erromsg=['error in read_civdata: unknow velocity type ' VelType];
Index: /trunk/src/read_field.m
===================================================================
--- /trunk/src/read_field.m	(revision 516)
+++ /trunk/src/read_field.m	(revision 517)
@@ -42,111 +42,142 @@
 try
     switch FileType
-        case {'civx','civdata','netcdf'}  %read the first nc field
-            GUIName='get_field'; %default name of the GUI get_field
-            if isfield(ParamIn,'GUIName')
-                GUIName=ParamIn.GUIName;
-            end
-            CivStage=0;
-            if ~strcmp(ParamIn.FieldName,'get_field...')% if get_field is not requested, look for Civx data
-                FieldList=calc_field;%list of possible fields for Civx data
-                ParamOut.ColorVar='';%default
-                if ischar(ParamIn.FieldName)
-                    FieldName=ParamIn.FieldName;
-                else
-                    FieldName=ParamIn.FieldName{1};
-                end
-                field_index=strcmp(FieldName,FieldList);%look for ParamIn.FieldName in the list of possible fields for Civx data
-                if isempty(find(field_index,1))% ParamIn.FieldName is not in the list, check whether Civx data exist
-                    Data=nc2struct(FileName,'ListGlobalAttribute','Conventions','absolut_time_T0','civ','CivStage');
-                    % case of new civdata conventions
-                    if isequal(Data.Conventions,'uvmat/civdata')
-                        ParamOut.FieldName='velocity';%Civx data found, set .FieldName='velocity' by default
-                        ParamOut.ColorVar='ima_cor';
-                        InputField=[{ParamOut.FieldName} {ParamOut.ColorVar}];
-                        [Field,ParamOut.VelType,errormsg]=read_civdata(FileName,InputField,ParamIn.VelType,Data.CivStage);
+        case 'civdata'
+%             ParamOut.FieldName='velocity';%Civx data found, set .FieldName='velocity' by default
+%                         ParamOut.ColorVar='ima_cor';
+                        InputField=[{ParamIn.FieldName} {ParamIn.ColorVar}];
+                        [Field,ParamOut.VelType,errormsg]=read_civdata(FileName,InputField,ParamIn.VelType);
                         if ~isempty(errormsg),errormsg=['read_civdata:' errormsg];return,end
-                        CivStage=Field.CivStage;
                         ParamOut.CivStage=Field.CivStage;
-                        %case of old civx conventions
-                    elseif ~isempty(Data.absolut_time_T0)&& ~isequal(Data.civ,0)
-                        ParamOut.FieldName='velocity';%Civx data found, set .FieldName='velocity' by default
+         case 'civx'
+            ParamOut.FieldName='velocity';%Civx data found, set .FieldName='velocity' by default
                         ParamOut.ColorVar='ima_cor';
                         InputField=[{ParamOut.FieldName} {ParamOut.ColorVar}];
                         [Field,ParamOut.VelType]=read_civxdata(FileName,InputField,ParamIn.VelType);
                         if ~isempty(errormsg),errormsg=['read_civxdata:' errormsg];return,end
-                        CivStage=Field.CivStage;
                         ParamOut.CivStage=Field.CivStage;
-                        % not cvix file, fields will be chosen through the GUI get_field
-                    else
-                        ParamOut.FieldName='get_field...';
-                        hget_field=findobj(allchild(0),'Name',GUIName);%find the get_field... GUI
-                        if ~isempty(hget_field)
-                            delete(hget_field)%delete  get_field for reinitialisation
-                        end
-                    end
-                else              
-                    InputField=ParamOut.FieldName;
-                    if ischar(InputField)
-                        InputField={InputField};
-                    end
-                    if isfield(ParamIn,'ColorVar')
-                        ParamOut.ColorVar=ParamIn.ColorVar;
-                        InputField=[InputField {ParamOut.ColorVar}];
-                    end
-                    [Field,ParamOut.VelType,errormsg]=read_civxdata(FileName,InputField,ParamIn.VelType);
-                    if ~isempty(errormsg),errormsg=['read_civxdata:' errormsg];return,end
-                    CivStage=Field.CivStage;
-                    ParamOut.CivStage=Field.CivStage;
+        case 'netcdf'
+            r=regexp(ParamIn.FieldName,'(^vec|^norm)\((?<UName>.+),(?<VName>.+)\)$','names');
+            if isempty(r)
+                ListVar={ParamIn.FieldName};
+                input='scalar';
+            else
+                ListVar={r.UName,r.VName};
+                input='vectors';
+            end
+            if ~isempty(ParamIn.ColorVar)
+                r=regexp(ParamIn.ColorVar,'(^vec|^norm)\((?<UName>.+),(?<VName>.+)\)$','names');
+                if isempty(r)
+                    ListVar=[ListVar {ParamIn.ColorVar}];
+                else
+                    ListVar=[ListVar {r.UName,r.VName}];
                 end
-                ParamOut.FieldList=[{'image'};FieldList;{'get_field...'}];
-            end
-            if CivStage==0% read the field names on the interface get_field.
-                hget_field=findobj(allchild(0),'Name',GUIName);%find the get_field... GUI
-                if isempty(hget_field)% open the GUI get_field if it is not found
-                    hget_field= get_field(FileName);%open the get_field GUI
-                    set(hget_field,'Name',GUIName)%update the name of get_field (e.g. get_field_1)
+            end
+                [Field,var_detect,ichoice]=nc2struct(FileName,[ParamIn.CoordName ListVar]);
+                if strcmp(input,'vectors')
+                    Field.VarAttribute{3}.Role='vector_x';
+                    Field.VarAttribute{4}.Role='vector_y';
+                else
+                    Field.VarAttribute{3}.Role='scalar';
                 end
-                hhget_field=guidata(hget_field);
-                %% update  the get_field GUI
-                set(hhget_field.inputfile,'String',FileName)
-                set(hhget_field.list_fig,'Value',1)
-                if exist('num','var')&&~isnan(num)
-                    set(hhget_field.TimeIndexValue,'String',num2str(num))
-                end
-%                 funct_list=get(hhget_field.ACTION,'UserData');
-%                 funct_index=get(hhget_field.ACTION,'Value');
-%                 funct=funct_list{funct_index};%select  the current action in get_field, e;g. PLOT
-%                 Field=funct(hget_field); %%activate the current action selected in get_field, e;g.read the names of the variables to plot
-                [Field,errormsg]=read_get_field(hget_field);
-                Tabchar={''};%default
-                Tabcell=[];
-                set(hhget_field.inputfile,'String',FileName)
-                if isfield(Field,'ListGlobalAttribute')&& ~isempty(Field.ListGlobalAttribute)
-                    for iline=1:length(Field.ListGlobalAttribute)
-                        Tabcell{iline,1}=Field.ListGlobalAttribute{iline};
-                        if isfield(Field, Field.ListGlobalAttribute{iline})
-                            val=Field.(Field.ListGlobalAttribute{iline});
-                            if ischar(val);
-                                Tabcell{iline,2}=val;
-                            else
-                                Tabcell{iline,2}=num2str(val);
-                            end
-                        end
-                    end
-                    if ~isempty(Tabcell)
-                        Tabchar=cell2tab(Tabcell,'=');
-                        Tabchar=[{''};Tabchar];
-                    end
-                end
-                ParamOut.CivStage=0;
-                ParamOut.VelType=[];
-                if isfield(Field,'TimeIndex')
-                    ParamOut.TimeIndex=Field.TimeIndex;
-                end
-                if isfield(Field,'TimeValue')
-                    ParamOut.TimeValue=Field.TimeValue;
-                end
-                ParamOut.FieldList={'get_field...'};
-            end
+%             GUIName='get_field'; %default name of the GUI get_field
+%             if isfield(ParamIn,'GUIName')
+%                 GUIName=ParamIn.GUIName;
+%             end
+%             CivStage=0;
+% %             if ~strcmp(ParamIn.FieldName,'get_field...')% if get_field is not requested, look for Civx data
+%                 FieldList=calc_field;%list of possible fields for Civx data
+%                 ParamOut.ColorVar='';%default
+%                 if ischar(ParamIn.FieldName)
+%                     FieldName=ParamIn.FieldName;
+%                 else
+%                     FieldName=ParamIn.FieldName{1};
+%                 end
+%                 field_index=strcmp(FieldName,FieldList);%look for ParamIn.FieldName in the list of possible fields for Civx data
+%                 if isempty(find(field_index,1))% ParamIn.FieldName is not in the list, check whether Civx data exist
+%                     Data=nc2struct(FileName,'ListGlobalAttribute','Conventions','absolut_time_T0','civ','CivStage');
+%                     % case of new civdata conventions
+%                     if isequal(Data.Conventions,'uvmat/civdata')
+%                         
+%                         %case of old civx conventions
+%                     elseif ~isempty(Data.absolut_time_T0)&& ~isequal(Data.civ,0)
+%                         ParamOut.FieldName='velocity';%Civx data found, set .FieldName='velocity' by default
+%                         ParamOut.ColorVar='ima_cor';
+%                         InputField=[{ParamOut.FieldName} {ParamOut.ColorVar}];
+%                         [Field,ParamOut.VelType]=read_civxdata(FileName,InputField,ParamIn.VelType);
+%                         if ~isempty(errormsg),errormsg=['read_civxdata:' errormsg];return,end
+%                         CivStage=Field.CivStage;
+%                         ParamOut.CivStage=Field.CivStage;
+%                         % not cvix file, fields will be chosen through the GUI get_field
+%                     else
+%                         ParamOut.FieldName='get_field...';
+%                         hget_field=findobj(allchild(0),'Name',GUIName);%find the get_field... GUI
+%                         if ~isempty(hget_field)
+%                             delete(hget_field)%delete  get_field for reinitialisation
+%                         end
+%                     end
+%                 else              
+%                     InputField=ParamOut.FieldName;
+%                     if ischar(InputField)
+%                         InputField={InputField};
+%                     end
+%                     if isfield(ParamIn,'ColorVar')
+%                         ParamOut.ColorVar=ParamIn.ColorVar;
+%                         InputField=[InputField {ParamOut.ColorVar}];
+%                     end
+%                     [Field,ParamOut.VelType,errormsg]=read_civxdata(FileName,InputField,ParamIn.VelType);
+%                     if ~isempty(errormsg),errormsg=['read_civxdata:' errormsg];return,end
+%                     CivStage=Field.CivStage;
+%                     ParamOut.CivStage=Field.CivStage;
+%                 end
+%                 ParamOut.FieldList=[{'image'};FieldList;{'get_field...'}];
+%             end
+%             if CivStage==0% read the field names on the interface get_field.
+%                 hget_field=findobj(allchild(0),'Name',GUIName);%find the get_field... GUI
+%                 if isempty(hget_field)% open the GUI get_field if it is not found
+%                     hget_field= get_field(FileName);%open the get_field GUI
+%                     set(hget_field,'Name',GUIName)%update the name of get_field (e.g. get_field_1)
+%                 end
+%                 hhget_field=guidata(hget_field);
+%                 %% update  the get_field GUI
+%                 set(hhget_field.inputfile,'String',FileName)
+%                 set(hhget_field.list_fig,'Value',1)
+%                 if exist('num','var')&&~isnan(num)
+%                     set(hhget_field.TimeIndexValue,'String',num2str(num))
+%                 end
+% %                 funct_list=get(hhget_field.ACTION,'UserData');
+% %                 funct_index=get(hhget_field.ACTION,'Value');
+% %                 funct=funct_list{funct_index};%select  the current action in get_field, e;g. PLOT
+% %                 Field=funct(hget_field); %%activate the current action selected in get_field, e;g.read the names of the variables to plot
+%                 [Field,errormsg]=read_get_field(hget_field);
+%                 Tabchar={''};%default
+%                 Tabcell=[];
+%                 set(hhget_field.inputfile,'String',FileName)
+%                 if isfield(Field,'ListGlobalAttribute')&& ~isempty(Field.ListGlobalAttribute)
+%                     for iline=1:length(Field.ListGlobalAttribute)
+%                         Tabcell{iline,1}=Field.ListGlobalAttribute{iline};
+%                         if isfield(Field, Field.ListGlobalAttribute{iline})
+%                             val=Field.(Field.ListGlobalAttribute{iline});
+%                             if ischar(val);
+%                                 Tabcell{iline,2}=val;
+%                             else
+%                                 Tabcell{iline,2}=num2str(val);
+%                             end
+%                         end
+%                     end
+%                     if ~isempty(Tabcell)
+%                         Tabchar=cell2tab(Tabcell,'=');
+%                         Tabchar=[{''};Tabchar];
+%                     end
+%                 end
+%                 ParamOut.CivStage=0;
+%                 ParamOut.VelType=[];
+%                 if isfield(Field,'TimeIndex')
+%                     ParamOut.TimeIndex=Field.TimeIndex;
+%                 end
+%                 if isfield(Field,'TimeValue')
+%                     ParamOut.TimeValue=Field.TimeValue;
+%                 end
+%                 ParamOut.FieldList={'get_field...'};
+
         case 'video'
             if strcmp(class(ParamIn),'VideoReader')
Index: /trunk/src/set_col_vec.m
===================================================================
--- /trunk/src/set_col_vec.m	(revision 516)
+++ /trunk/src/set_col_vec.m	(revision 517)
@@ -21,20 +21,15 @@
 % vec_C: matlab vector representing the scalar setting the color
 function [colorlist,col_vec,colcode_out]=set_col_vec(colcode,vec_C)
-col_vec=[]; 
+col_vec=ones(size(vec_C));%all vectors at color#1 by default
+
 if ~isstruct(colcode),colcode=[];end;
 colcode_out=colcode;%default
 if isempty(vec_C) || ~isnumeric(vec_C)
     colorlist=[0 0 1]; %blue
-    col_vec=ones(size(vec_C));
     return
 end
 
-
-
-% colcode_out.ColCode1=ColCode1;
-% colcode_out.ColCode2=ColCode2;
 %% uniform color plot
 check_multicolors=0;
-col_vec=ones(size(vec_C));%all vectors at color#1 by default
 %default input parameters
 if ~isfield(colcode,'ColorCode') || isempty(colcode.ColorCode)
Index: /trunk/src/uvmat.m
===================================================================
--- /trunk/src/uvmat.m	(revision 516)
+++ /trunk/src/uvmat.m	(revision 517)
@@ -180,5 +180,5 @@
 UvData.OpenParam.PosColorbar=[0.805 0.022 0.019 0.445];
 UvData.OpenParam.PosSetObject=[-0.05 -0.03 0.3 0.7]; %position for set_object
-UvData.OpenParam.PosGeometryCalic=[0.95 -0.03 0.28 1 ];%position for geometry_calib (TO IMPROVE)
+UvData.OpenParam.PosGeometryCalib=[0.95 -0.03 0.28 1 ];%position for geometry_calib (TO IMPROVE)
 % UvData.OpenParam.CalSize=[0.28 1];
 % UvData.PlotAxes=[];%initiate the record of plotted field
@@ -990,27 +990,35 @@
 
 %% set default options in menu 'Fields'
-if ~testima
-    testcivx=0;
-    if isfield(UvData,'FieldsString') && isequal(UvData.FieldsString,{'get_field...'})% field menu defined as input (from get_field)
+switch FileType
+    case {'civx','civdata'}
+            [FieldList,ColorList]=calc_field;
+            set(handles_Fields,'String',[{'image'};FieldList;{'get_field...'}]);%standard menu for civx data
+            set(handles_Fields,'Value',2) % set menu to 'velocity
+          %  col_vec=FieldList;
+           % col_vec(1)=[];%remove 'velocity' option for vector color (must be a scalar)
+           set(handles.ColorScalar,'Value',1)
+            set(handles.ColorScalar,'String',ColorList)
+            set(handles.Coord_x,'Value',1);
+           set(handles.Coord_x,'String',{'X'});
+           set(handles.Coord_y,'Value',1);
+           set(handles.Coord_y,'String',{'Y'});
+    case 'netcdf'
         set(handles_Fields,'Value',1)
         set(handles_Fields,'String',{'get_field...'})
-        UvData=rmfield(UvData,'FieldsString');
-    else
-        Data=nc2struct(FileName,'ListGlobalAttribute','Conventions','absolut_time_T0','civ');
-        if strcmp(Data.Conventions,'uvmat/civdata') ||( ~isempty(Data.absolut_time_T0)&& ~isequal(Data.civ,0))%if the new input is Civx
-            FieldList=calc_field;
-            set(handles_Fields,'String',[{'image'};FieldList;{'get_field...'}]);%standard menu for civx data
-            set(handles_Fields,'Value',2) % set menu to 'velocity'
-            col_vec=FieldList;
-            col_vec(1)=[];%remove 'velocity' option for vector color (must be a scalar)
-            testcivx=1;
-        end
-        if ~testcivx
-            set(handles_Fields,'Value',1) % set menu to 'get_field...
-            set(handles_Fields,'String',{'get_field...'})
-            col_vec={'get_field...'};
-        end
-        set(handles.ColorScalar,'String',col_vec)
-    end
+        hget_field=get_field(FileName);
+        hhget_field=guidata(hget_field);
+        get_field('RUN_Callback',hhget_field.RUN,[],hhget_field); 
+%             set(handles_Fields,'Value',1) % set menu to 'get_field...
+%             set(handles_Fields,'String',{'get_field...'})
+%             col_vec={'get_field...'};
+% 
+%         set(handles.ColorScalar,'String',col_vec)
+    otherwise
+        set(handles_Fields,'Value',1) % set menu to 'image'
+        set(handles_Fields,'String',{'image'})
+                    set(handles.Coord_x,'Value',1);
+           set(handles.Coord_x,'String',{'AX'});
+           set(handles.Coord_y,'Value',1);
+           set(handles.Coord_y,'String',{'AY'});
 end
 set(handles.uvmat,'UserData',UvData)
@@ -2038,5 +2046,5 @@
             end
         end
-        if strcmp(FieldName,'velocity')
+        if ~isempty(regexp(FieldName,'^vec('))
             list_code=get(handles.ColorCode,'String');% list menu fields
             index_code=get(handles.ColorCode,'Value');% selected string index
@@ -2070,9 +2078,12 @@
 end
 if isstruct (ParamIn)
-ParamIn.FieldName=FieldName;
-ParamIn.VelType=VelType;
-ParamIn.GUIName='get_field';
-end
-check_tps=0;         
+    ParamIn.FieldName=FieldName;
+    ParamIn.VelType=VelType;
+    XNameMenu=get(handles.Coord_x,'String');
+    ParamIn.CoordName=XNameMenu{get(handles.Coord_x,'Value')};
+    YNameMenu=get(handles.Coord_y,'String');
+    ParamIn.CoordName={ParamIn.CoordName, YNameMenu{get(handles.Coord_y,'Value')}};
+end
+check_tps = 0;         
 if strcmp(UvData.FileType{1},'civdata')&&~strcmp(ParamIn.FieldName,'velocity')&&~strcmp(ParamIn.FieldName,'get_field...') 
        check_tps=1;%tps needed to get the requested field
@@ -2215,17 +2226,17 @@
 end
 % display the Fields menu from the input file and pick the selected one: 
-if isstruct(ParamOut)
-    field_index=strcmp(ParamOut.FieldName,ParamOut.FieldList);
-    set(handles.Fields,'String',ParamOut.FieldList); %update the field menu
-    set(handles.Fields,'Value',find(field_index,1))
-end
+% if isstruct(ParamOut)
+%     field_index=strcmp(ParamOut.FieldName,ParamOut.FieldList);
+%     set(handles.Fields,'String',ParamOut.FieldList); %update the field menu
+%     set(handles.Fields,'Value',find(field_index,1))
+% end
 
 %% update the display menu for the second velocity type (second menuline)
 test_veltype_1=0;
 if isempty(FileName_1)
-    set(handles.Fields_1,'Value',1); %update the field menu
-    if isstruct(ParamOut)
-    set(handles.Fields_1,'String',[{''};ParamOut.FieldList]); %update the field menu
-    end
+%     set(handles.Fields_1,'Value',1); %update the field menu
+%     if isstruct(ParamOut)
+%     set(handles.Fields_1,'String',[{''};ParamOut.FieldList]); %update the field menu
+%     end
 elseif ~test_keepdata_1
     if (~strcmp(UvData.FileType{2},'netcdf')&&~strcmp(UvData.FileType{2},'civdata')&&~strcmp(UvData.FileType{2},'civx'))|| isequal(FieldName_1,'get_field...')
@@ -2625,5 +2636,5 @@
         PlotParam{1}.Vectors.ColCode1=0.33;
         PlotParam{1}.Vectors.ColCode2=0.66;
-        PlotParam{1}.Vectors.ColorScalar={'ima_cor'};
+        PlotParam{1}.Vectors.ColorScalar={''};
         PlotParam{1}.Vectors.ColorCode= {'rgb'};
     end
@@ -3082,5 +3093,4 @@
     [RootPath,SubDir,RootFile,FileIndices,FileExt]=read_file_boxes(handles);
     FileName=[fullfile(RootPath,SubDir,RootFile) FileIndices FileExt];
-    %FileName=read_file_boxes(handles);
     hget_field=findobj(allchild(0),'name','get_field');
     if ~isempty(hget_field)
@@ -3088,15 +3098,13 @@
     end
     hget_field=get_field(FileName);
-    set(hget_field,'Name','get_field')
-    hhget_field=guidata(hget_field);
-    set(hhget_field.list_fig,'Value',1)
-    set(hhget_field.list_fig,'String',{'uvmat'})
+%     set(hget_field,'Name','get_field')
+%     hhget_field=guidata(hget_field);
+%     set(hhget_field.list_fig,'Value',1)
+%     set(hhget_field.list_fig,'String',{'uvmat'})
   %  set(handles.transform_fct,'Value',1)% no transform by default
   %  set(handles.path_transform,'String','')
-    return %no action
-end
-list_fields=get(handles.Fields_1,'String');% list menu fields
-index_fields=get(handles.Fields_1,'Value');% selected string index
-field_1= list_fields{index_fields(1)}; % selected string
+    return %no further action
+end
+
 UvData=get(handles.uvmat,'UserData');
 
@@ -3148,4 +3156,9 @@
 
 %common to Fields_1_Callback
+list_fields_1=get(handles.Fields_1,'String');% list menu fields
+field_1='';
+if ~isempty(list_fields_1)
+field_1= list_fields_1{get(handles.Fields_1,'Value')}; % selected string
+end
 if isequal(field,'image')||isequal(field_1,'image')
     set(handles.TitleNpx,'Visible','on')% visible npx,pxcm... buttons
@@ -4669,16 +4682,14 @@
     data.CoordType=UvData.CoordType;
 end
-pos=get(handles.uvmat,'Position');
-pos(1)=pos(1)+pos(3)-0.311+0.04; %0.311= width of the geometry_calib interface (units relative to the srcreen)
-pos(2)=pos(2)-0.02;
+% pos=get(handles.uvmat,'Position');
+% pos(1)=pos(1)+pos(3)-0.311+0.04; %0.311= width of the geometry_calib interface (units relative to the srcreen)
+% pos(2)=pos(2)-0.02;
 [RootPath,SubDir,RootFile,FileIndex,FileExt]=read_file_boxes(handles);
 FileName=[fullfile(RootPath,SubDir,RootFile) FileIndex FileExt];
 set(handles.view_xml,'Backgroundcolor',[1 1 0])%indicate the reading of the current xml file by geometry_calib
-if isfield(UvData.OpenParam,'CalOrigin')
-    pos_uvmat=get(handles.uvmat,'Position');
-    pos_cal(1)=pos_uvmat(1)+UvData.OpenParam.PosGeometryCalib(1)*pos_uvmat(3);
-    pos_cal(2)=pos_uvmat(2)+UvData.OpenParam.PosGeometryCalib(2)*pos_uvmat(4);
-    pos_cal(3:4)=UvData.OpenParam.PosGeometryCalib(3:4).* pos_uvmat(3:4);
-end
+pos_uvmat=get(handles.uvmat,'Position');
+pos_cal(1)=pos_uvmat(1)+UvData.OpenParam.PosGeometryCalib(1)*pos_uvmat(3);
+pos_cal(2)=pos_uvmat(2)+UvData.OpenParam.PosGeometryCalib(2)*pos_uvmat(4);
+pos_cal(3:4)=UvData.OpenParam.PosGeometryCalib(3:4).* pos_uvmat(3:4);
 geometry_calib(FileName,pos_cal);% call the geometry_calib interface	
 set(handles.view_xml,'Backgroundcolor',[1 1 1])%indicate the end of reading of the current xml file by geometry_calib
@@ -4902,2 +4913,9 @@
 ProjectDir = uigetdir(fileparts(fileparts(RootPath)), 'select the project directory');
 datatree_browser(ProjectDir)
+
+
+% --- Executes on selection change in Coord_y.
+function Coord_y_Callback(hObject, eventdata, handles)
+
+% --- Executes on selection change in Coord_x.
+function Coord_x_Callback(hObject, eventdata, handles)
