Index: trunk/src/uvmat.m
===================================================================
--- trunk/src/uvmat.m	(revision 427)
+++ trunk/src/uvmat.m	(revision 428)
@@ -1611,7 +1611,7 @@
 sub_value= get(handles.SubField,'Value');
 if sub_value % a second input file has been entered 
-    [FileName_1,RootPath_1,filebase_1,FileIndices_1,FileExt_1,SubDir_1]=read_file_boxes_1(handles);
-    [tild,tild,tild,i1_1,i2_1,j1_1,j2_1]=fileparts_uvmat(FileIndices_1);
-    NomType_1=get(handles.NomType_1,'String');
+     [InputFile.RootPath_1,InputFile.SubDir_1,InputFile.RootFile_1,InputFile.FileIndex_1,InputFile.FileExt_1,InputFile.NomType_1]=read_file_boxes_1(handles);   
+    [tild,tild,tild,i1_1,i2_1,j1_1,j2_1]=fileparts_uvmat(InputFile.FileIndex_1);
+%     InputFile.NomType_1=get(handles.NomType_1,'String');
 else
     filename_1=[];
@@ -1742,5 +1742,5 @@
 filename=fullfile_uvmat(InputFile.RootPath,InputFile.SubDir,InputFile.RootFile,FileExt,NomType,i1,i2,j1,j2);
 if sub_value
-    filename_1=fullfile_uvmat(InputFile.RootPath_1,InputFile.SubDir_1,InputFile.RootFile_1,FileExt_1,NomType_1,i1_1,i2_1,j1_1,j2_1);
+    filename_1=fullfile_uvmat(InputFile.RootPath_1,InputFile.SubDir_1,InputFile.RootFile_1,InputFile.FileExt_1,InputFile.NomType_1,i1_1,i2_1,j1_1,j2_1);
 end
 
@@ -1762,10 +1762,8 @@
         set(handles.j2,'String',num2stra(j2,NomType,2));
     end
-   % [indices]=name_generator('',i1,j1,'',NomType,1,i2,j2,'');
     indices=fullfile_uvmat('','','','',NomType,i1,i2,j1,j2);
     set(handles.FileIndex,'String',indices);
     if ~isempty(filename_1)
-        indices_1=fullfile_uvmat('','','','',NomType_1,i1_1,i2_1,j1_1,j2_1);
-        %indices_1=name_generator('',i1_1,j1_1,'',NomType_1,1,i2_1,j2_1,'');
+        indices_1=fullfile_uvmat('','','','',InputFile.NomType_1,i1_1,i2_1,j1_1,j2_1);
         set(handles.FileIndex_1,'String',indices_1);
     end
@@ -2105,5 +2103,9 @@
             end
     end
+    if isequal(get(handles.NomType_1,'Visible'),'on')
     NomType_1=get(handles.NomType_1,'String');
+    else
+        NomType_1=get(handles.NomType,'String');
+    end
     test_keepdata_1=0;% test for keeping the previous stored data if the input files are unchanged
     if ~isequal(NomType_1,'*')%in case of a series of files (not avi movie)
@@ -2638,5 +2640,6 @@
         PlotParam{imap}.Scalar.CheckBW=[]; %B/W option depends on the input field (image or scalar)
         if isfield(ObjectData,'CoordUnit')
-        PlotParam{imap}.Coordinates.CheckFixEqual=1;% set x and y scaling equal if CoordUnit is defined (common unit for x and y)
+        PlotParam{imap}.Coordinates.CheckFixAspectRatio=1;% set x and y scaling equal if CoordUnit is defined (common unit for x and y)
+        PlotParam{imap}.Coordinates.AspectRatio=1; %set aspect ratio to 1
         end
     end
@@ -2883,4 +2886,18 @@
 indy=1+round((nxy(1)-1)*(y12-rangy0(1))/(rangy0(2)-rangy0(1)));% index y of pixel
 
+
+%-------------------------------------------------------------------
+% --- Executes on button press in 'CheckZoom'.
+%-------------------------------------------------------------------
+function CheckZoom_Callback(hObject, eventdata, handles)
+
+if (get(handles.CheckZoom,'Value') == 1); 
+    set(handles.CheckZoom,'BackgroundColor',[1 1 0])
+    set(handles.CheckFixLimits,'Value',1)% propose by default fixed limits for the plotting axes
+    set(handles.CheckFixLimits,'BackgroundColor',[1 1 0]) 
+else
+    set(handles.CheckZoom,'BackgroundColor',[0.7 0.7 0.7])
+end
+
 %-------------------------------------------------------------------
 % --- Executes on button press in 'CheckFixLimits'.
@@ -2896,28 +2913,26 @@
 
 %-------------------------------------------------------------------
-% --- Executes on button press in CheckFixEqual.
-function CheckFixEqual_Callback(hObject, eventdata, handles)
-if get(handles.CheckFixEqual,'Value')
-    set(handles.CheckFixEqual,'BackgroundColor',[1 1 0])
+% --- Executes on button press in CheckFixAspectRatio.
+function CheckFixAspectRatio_Callback(hObject, eventdata, handles)
+%-------------------------------------------------------------------
+if get(handles.CheckFixAspectRatio,'Value')
+    set(handles.CheckFixAspectRatio,'BackgroundColor',[1 1 0])
     update_plot(handles);
 else
-    set(handles.CheckFixEqual,'BackgroundColor',[0.7 0.7 0.7])
+    set(handles.CheckFixAspectRatio,'BackgroundColor',[0.7 0.7 0.7])
     update_plot(handles);
 end
 
 %-------------------------------------------------------------------
-
+function num_AspectRatio_Callback(hObject, eventdata, handles)
 %-------------------------------------------------------------------
-% --- Executes on button press in 'CheckZoom'.
+set(handles.CheckFixAspectRatio,'Value',1)% select the fixed aspect ratio button
+set(handles.CheckFixAspectRatio,'BackgroundColor',[1 1 0])% mark in yellow
+update_plot(handles);
 %-------------------------------------------------------------------
-function CheckZoom_Callback(hObject, eventdata, handles)
-
-if (get(handles.CheckZoom,'Value') == 1); 
-    set(handles.CheckZoom,'BackgroundColor',[1 1 0])
-    set(handles.CheckFixLimits,'Value',1)% propose by default fixed limits for the plotting axes
-    set(handles.CheckFixLimits,'BackgroundColor',[1 1 0]) 
-else
-    set(handles.CheckZoom,'BackgroundColor',[0.7 0.7 0.7])
-end
+
+%-------------------------------------------------------------------
+
+
 
 %-------------------------------------------------------------------
@@ -2982,8 +2997,8 @@
 fin=close(nc);
 
-%---------------------------------------------------
+%-------------------------------------------------------------------
 % --- Executes on button press in SubField
 function SubField_Callback(hObject, eventdata, handles)
-% huvmat=get(handles.run0,'parent');
+%-------------------------------------------------------------------
 UvData=get(handles.uvmat,'UserData');
 if get(handles.SubField,'Value')==0% if the subfield button is desactivated   
@@ -3002,4 +3017,5 @@
     set(handles.Fields_1,'Value',1);%set to blank state
     set(handles.VelType_1,'Value',1);%set to blank state
+    set(handles.num_Opacity,'String','')% desactivate opacity setting
     if ~strcmp(get(handles.VelType,'Visible'),'on')
         set(handles.VelType_1,'Visible','off')
@@ -3172,9 +3188,6 @@
 if isempty(field_1)%||(numel(UvData.FileType)>=2 && strcmp(UvData.FileType{2},'image'))
     set(handles.SubField,'Value',0)
-%     check_new=1;
     SubField_Callback(hObject, eventdata, handles)
-%     if isempty(field_1)%remove second field if 'blank' field is selected
-        return
-%     end
+    return
 else
     set(handles.SubField,'Value',1)%state that a second field is now entered
@@ -3201,4 +3214,10 @@
         set(handles.transform_fct,'Value',1)% no transform by default
         set(handles.path_transform,'String','')
+        if check_new
+            UvData.FileType{2}=UvData.FileType{1};
+            set(handles.FileIndex_1,'String',get(handles.FileIndex,'String'))
+%             set(handles.FileExt_1,'String',get(handles.FileExt,'String'))
+              set(handles.uvmat,'UserData',UvData)
+        end
     case 'image'
         % guess the image name corresponding to the current netcdf name (no unique correspondance)
@@ -3708,4 +3727,9 @@
 %-------------------------------------------------------------------
 update_plot(handles);
+
+%-------------------------------------------------------------------
+function num_Opacity_Callback(hObject, eventdata, handles)
+update_plot(handles);
+%-------------------------------------------------------------------
 
 %-------------------------------------------------------------------
@@ -4786,12 +4810,2 @@
     web(helpfile);
 end
-
-
-% --- Executes on slider movement.
-function slider7_Callback(hObject, eventdata, handles)
-% hObject    handle to slider7 (see GCBO)
-% eventdata  reserved - to be defined in a future version of MATLAB
-% handles    structure with handles and user data (see GUIDATA)
-
-% Hints: get(hObject,'Value') returns position of slider
-%        get(hObject,'Min') and get(hObject,'Max') to determine range of slider
