Index: /trunk/src/calc_field.m
===================================================================
--- /trunk/src/calc_field.m	(revision 410)
+++ /trunk/src/calc_field.m	(revision 411)
@@ -168,48 +168,52 @@
                 case 'velocity'
                     ListFields={'U', 'V'};
-                    VarAttributes{var_count+1}.Role='vector_x';
-                    VarAttributes{var_count+2}.Role='vector_y';
+                    VarAttribute{var_count+1}.Role='vector_x';
+                    VarAttribute{var_count+2}.Role='vector_y';
                     DataOut.U(ind_sel)=DataOut.U(ind_sel)+EM *DataIn.U_tps(1:nbvec_sub+3,isub);
                     DataOut.V(ind_sel)=DataOut.V(ind_sel)+EM *DataIn.V_tps(1:nbvec_sub+3,isub);
                 case 'u'
                     ListFields={'u'};
-                    VarAttributes{var_count+1}.Role='scalar';
+                    VarAttribute{var_count+1}.Role='scalar';
                     DataOut.u(ind_sel)=DataOut.u(ind_sel)+EM *DataIn.U_tps(1:nbvec_sub+3,isub);
                 case 'v'
                     ListFields={'v'};
-                    VarAttributes{var_count+1}.Role='scalar';
+                    VarAttribute{var_count+1}.Role='scalar';
                     DataOut.v(ind_sel)=DataOut.v(ind_sel)+EM *DataIn.V_tps(1:nbvec_sub+3,isub);
                 case 'norm_vel'
                     ListFields={'norm_vel'};
-                    VarAttributes{var_count+1}.Role='scalar';
-                    V=DataOut.U(ind_sel)+EM *DataIn.U_tps(1:nbvec_sub+3,isub);
+                    VarAttribute{var_count+1}.Role='scalar';
+                    U=DataOut.U(ind_sel)+EM *DataIn.U_tps(1:nbvec_sub+3,isub);
                     V=DataOut.V(ind_sel)+EM *DataIn.V_tps(1:nbvec_sub+3,isub);
                     DataOut.norm_vel(ind_sel)=sqrt(U.*U+V.*V);
                 case 'vort'
                     ListFields={'vort'};
-                    VarAttributes{var_count+1}.Role='scalar';
-                    DataOut.vort(ind_sel)=DataOut.vort(ind_sel)+EMDY *DataIn.U_tps(1:nbvec_sub+3,isub)-EMDX *DataIn.V_tps(1:nbvec_sub+3,isub);
+                    VarAttribute{var_count+1}.Role='scalar';
+                    DataOut.vort(ind_sel)=DataOut.vort(ind_sel)-EMDY *DataIn.U_tps(1:nbvec_sub+3,isub)+EMDX *DataIn.V_tps(1:nbvec_sub+3,isub);
                 case 'div'
                     ListFields={'div'};
-                    VarAttributes{var_count+1}.Role='scalar';
+                    VarAttribute{var_count+1}.Role='scalar';
                     DataOut.div(ind_sel)=DataOut.div(ind_sel)+EMDX*DataIn.U_tps(1:nbvec_sub+3,isub)+EMDY *DataIn.V_tps(1:nbvec_sub+3,isub);
                 case 'strain'
                     ListFields={'strain'};
-                    VarAttributes{var_count+1}.Role='scalar';
+                    VarAttribute{var_count+1}.Role='scalar';
                     DataOut.strain(ind_sel)=DataOut.strain(ind_sel)+EMDY*DataIn.U_tps(1:nbvec_sub+3,isub)+EMDX *DataIn.V_tps(1:nbvec_sub+3,isub);
             end
-            DataOut.FF=nbval==0; %put errorflag to 1 for points outside the interpolation rang
-            nbval(nbval==0)=1;
-            DataOut.ListVarName=[DataOut.ListVarName ListFields {'FF'}];
-            for ilist=1:numel(ListFields)
-                VarDimName{ilist}={'coord_y','coord_x'};
-                DataOut.(ListFields{ilist})=reshape(DataOut.(ListFields{ilist}),npy,npx);
-            end
-            DataOut.FF=reshape(DataOut.FF,npy,npx);
-            DataOut.VarDimName=[DataOut.VarDimName VarDimName {{'coord_y','coord_x'}}] ;
-            VarAttributes{length(ListFields)+1}.Role='errorflag';
-            DataOut.VarAttribute=[DataOut.VarAttribute VarAttributes];
-        end
-    end
+        end
+    end
+    DataOut.FF=nbval==0; %put errorflag to 1 for points outside the interpolation rang
+    nbval(nbval==0)=1;
+    if isempty(find(strcmp('FF',DataOut.ListVarName),1))% if FF is not already listed
+        DataOut.ListVarName=[DataOut.ListVarName {'FF'}];
+        DataOut.VarDimName=[DataOut.VarDimName {{'coord_y','coord_x'}}];
+        DataOut.VarAttribute{length(DataOut.ListVarName)}.Role='errorflag';
+    end
+    DataOut.ListVarName=[DataOut.ListVarName ListFields];
+    for ifield=1:numel(ListFields)
+        VarDimName{ifield}={'coord_y','coord_x'};
+        DataOut.(ListFields{ifield})=reshape(DataOut.(ListFields{ifield}),npy,npx);
+    end
+    DataOut.FF=reshape(DataOut.FF,npy,npx);
+    DataOut.VarDimName=[DataOut.VarDimName VarDimName];     
+    DataOut.VarAttribute=[DataOut.VarAttribute VarAttribute];
 else
 
Index: /trunk/src/civ_matlab.m
===================================================================
--- /trunk/src/civ_matlab.m	(revision 410)
+++ /trunk/src/civ_matlab.m	(revision 411)
@@ -490,9 +490,9 @@
 
 %% Apply mask
-    % Convention for mask
+    % Convention for mask IDEAS TO IMPLEMENT ?
     % mask >200 : velocity calculated
     %  200 >=mask>150;velocity not calculated, interpolation allowed (bad spots)
     % 150>=mask >100: velocity not calculated, nor interpolated
-    %  100>=mask> 20: velocity not calculated, impermeable (no flux through mask boundaries) TO IMPLEMENT
+    %  100>=mask> 20: velocity not calculated, impermeable (no flux through mask boundaries) 
     %  20>=mask: velocity=0
 checkmask=0;
@@ -504,5 +504,5 @@
    end
   %  check_noflux=(par_civ.Mask<100) ;%TODO: to implement
-    check_undefined=(par_civ.Mask<200 & par_civ.Mask>=100 );
+    check_undefined=(par_civ.Mask<200 & par_civ.Mask>=20 );
     par_civ.ImageA(check_undefined)=min(min(par_civ.ImageA));% put image A to zero (i.e. the min image value) in the undefined  area
     par_civ.ImageB(check_undefined)=min(min(par_civ.ImageB));% put image B to zero (i.e. the min image value) in the undefined  area
Index: /trunk/src/find_field_indices.m
===================================================================
--- /trunk/src/find_field_indices.m	(revision 410)
+++ /trunk/src/find_field_indices.m	(revision 411)
@@ -52,4 +52,5 @@
 function [CellVarIndex,NbDim,VarType,errormsg]=find_field_indices(Data)
 CellVarIndex={};
+
 NbDim=[];
 VarType=[];
@@ -105,4 +106,9 @@
     'ancillary','image','color','discrete','scalar','coord_tps'};
 NbDim=zeros(size(CellVarIndex));%default
+if isfield(Data,'VarAttribute');
+    VarAttribute=Data.VarAttribute;
+else
+    VarAttribute={};
+end
 for icell=1:length(CellVarIndex)
     for ilist=1:numel(ListRole)
@@ -111,9 +117,4 @@
     VarIndex=CellVarIndex{icell};%set of variable indices with the same dim 
     DimCell=Data.VarDimName{VarIndex(1)};% list of dimensions for each variable in the cell #icell
-    if isfield(Data,'VarAttribute');
-        VarAttribute=Data.VarAttribute;
-    else
-        VarAttribute={};
-    end
     test_2D=0;
     for ivar=VarIndex
@@ -181,5 +182,5 @@
     VarType{icell}.coord=coord; 
     if NbDim(icell)==0 && test_2D %look at attributes Coord_1, coord_2 (obsolete convention)
-        NbDim(icell)=2;
+        NbDim(icell)=2;     
     end
     %look for tps data
Index: /trunk/src/plot_field.m
===================================================================
--- /trunk/src/plot_field.m	(revision 410)
+++ /trunk/src/plot_field.m	(revision 411)
@@ -100,7 +100,6 @@
 PlotType='text'; %default
 PlotParamOut=PlotParam;%default
-Coordinates=[];
-if isfield(PlotParam,'Coordinates')
-Coordinates=PlotParam.Coordinates;
+if ~isfield(PlotParam,'Coordinates')
+    PlotParam.Coordinates=[];
 end
 
@@ -193,5 +192,5 @@
     
     %% set axes properties
-    if isfield(Coordinates,'CheckFixLimits') && isequal(Coordinates.CheckFixLimits,1)  %adjust the graph limits
+    if isfield(PlotParam.Coordinates,'CheckFixLimits') && isequal(PlotParam.Coordinates.CheckFixLimits,1)  %adjust the graph limits
         set(haxes,'XLimMode', 'manual')
         set(haxes,'YLimMode', 'manual')
@@ -200,8 +199,8 @@
         set(haxes,'YLimMode', 'auto')
     end
-    if ~isfield(Coordinates,'CheckFixEqual')&& isfield(Data,'CoordUnit')
-        Coordinates.CheckFixEqual=1;
-    end
-    if isfield(Coordinates,'CheckFixEqual') && isequal(Coordinates.CheckFixEqual,1)
+    if ~isfield(PlotParam.Coordinates,'CheckFixEqual')&& isfield(Data,'CoordUnit')
+        PlotParam.Coordinates.CheckFixEqual=1;% if CoordUnit is defined, the two coordiantes should be plotted with equal scale by default
+    end
+    if isfield(PlotParam.Coordinates,'CheckFixEqual') && isequal(PlotParam.Coordinates.CheckFixEqual,1)
         set(haxes,'DataAspectRatioMode','manual')
         set(haxes,'DataAspectRatio',[1 1 1])
@@ -228,5 +227,5 @@
         end
     else
-        Coordinates=plot_profile(Data,CellVarIndex(index_1D),VarType(index_1D),haxes,Coordinates);%
+        Coordinates=plot_profile(Data,CellVarIndex(index_1D),VarType(index_1D),haxes,PlotParam.Coordinates);%
         if testzoomaxes
             [zoomaxes,Coordinates]=plot_profile(Data,CellVarIndex(index_1D),VarType(index_1D),zoomaxes,PlotParam.Coordinates);
@@ -499,5 +498,6 @@
 function [haxes,PlotParamOut,PlotType,errormsg]=plot_plane(Data,CellVarIndex,VarTypeCell,haxes,PlotParam,PosColorbar)
 %-------------------------------------------------------------------
-grid(haxes, 'off')
+
+grid(haxes, 'off')% remove grid (possibly remaining from other graphs)
 %default plotting parameters
 PlotType='plane';%default
@@ -505,7 +505,5 @@
     PlotParam=[];
 end
-if ~isfield(PlotParam,'Coordinates')
-    PlotParam.Coordinates=[];
-end
+
 if ~isfield(PlotParam,'Scalar')
     PlotParam.Scalar=[];
@@ -866,5 +864,12 @@
                 hima=imagesc(AX,AY,B,[MaxA-1 MaxA]);
             end
-            set(hima,'Tag','ima','HitTest','off')
+            % the function imagesc reset the axes 'DataAspectRatioMode'='auto', change if .CheckFixEqual is
+            % requested:
+           if isfield(PlotParam.Coordinates,'CheckFixEqual') && isequal(PlotParam.Coordinates.CheckFixEqual,1)
+                set(haxes,'DataAspectRatioMode','manual')
+                set(haxes,'DataAspectRatio',[1 1 1])
+           end 
+            set(hima,'Tag','ima')
+            set(hima,'HitTest','off')
             set(haxes,'Tag',tag);%preserve the axes tag (removed by image fct !!!)     
             uistack(hima, 'bottom')
Index: /trunk/src/uvmat.m
===================================================================
--- /trunk/src/uvmat.m	(revision 410)
+++ /trunk/src/uvmat.m	(revision 411)
@@ -2456,13 +2456,17 @@
 %% Plot the projections on the selected  projection objects
 % main projection object (uvmat display)
-list_object=get(handles.ListObject,'String');
+list_object=get(handles.ListObject_1,'String');
 if isequal(list_object,{''})%refresh list of objects if the menu is empty
     UvData.Object={[]}; 
-    set(handles.ListObject,'Value',1)
-end
-IndexObj=get(handles.ListObject,'Value');%selected projection object for main view
+    set(handles.ListObject_1,'Value',1)
+end
+IndexObj(1)=get(handles.ListObject_1,'Value');%selected projection object for main view
 if IndexObj(1)> numel(UvData.Object)
     IndexObj(1)=1;%select the first object if the selected one does not exist
-    set(handles.ListObject,'Value',1)
+    set(handles.ListObject_1,'Value',1)
+end
+IndexObj(2)=get(handles.ListObject,'Value');%selected projection object for main view
+if isequal(IndexObj(2),IndexObj(1))
+    IndexObj(2)=[];
 end
 plot_handles{1}=handles;
@@ -2744,13 +2748,10 @@
 % --- Executes on button press in CheckFixEqual.
 function CheckFixEqual_Callback(hObject, eventdata, handles)
-test=get(handles.CheckFixEqual,'Value');
-if test
+if get(handles.CheckFixEqual,'Value')
     set(handles.CheckFixEqual,'BackgroundColor',[1 1 0])
-    cla(handles.axes3)
     update_plot(handles);
 else
     set(handles.CheckFixEqual,'BackgroundColor',[0.7 0.7 0.7])
     update_plot(handles);
-%     axis(handles.axes3,'image')
 end
 
@@ -3465,7 +3466,7 @@
 
 %delete mask if it is displayed 
-if isequal(get(handles.CheckMask,'Value'),1)%if the mask option is on
-   UvData=rmfield(UvData,'MaskName'); %will impose mask refresh  
-end
+% if isequal(get(handles.CheckMask,'Value'),1)%if the mask option is on
+%    UvData=rmfield(UvData,'MaskName'); %will impose mask refresh  
+% end
 set(handles.uvmat,'UserData',UvData)
 run0_Callback(hObject, eventdata, handles)
