Index: /trunk/src/get_field.m
===================================================================
--- /trunk/src/get_field.m	(revision 910)
+++ /trunk/src/get_field.m	(revision 911)
@@ -244,8 +244,9 @@
 
 %% put the GUI on the lower right of the sceen
-set(hObject,'Unit','pixel')
-pos_view_field=get(hObject,'Position');
+set(hObject,'Unit','pixels')
+%pos_view_field=get(hObject,'Position');
 set(0,'Unit','pixels')
 ScreenSize=get(0,'ScreenSize');
+pos_view_field(3:4)=[955 648];
 pos_view_field(1)=ScreenSize(1)+ScreenSize(3)-pos_view_field(3);
 pos_view_field(2)=ScreenSize(2);
Index: /trunk/src/series.m
===================================================================
--- /trunk/src/series.m	(revision 910)
+++ /trunk/src/series.m	(revision 911)
@@ -1916,18 +1916,18 @@
         %create subdirectory for oar command and log files
         %DirOARLog=fullfile(OutputDir,'0_LOG');
-        %DirOARExe=fullfile(OutputDir,'0_EXE');
-%         if exist(DirOAR,'dir')% delete the content of the dir 0_LOG to allow new input
-%             curdir=pwd;
-%             cd(DirOAR)
-%             delete('*')
-%             cd(curdir)
-%         else
-%             [tild,msg1]=mkdir(DirOAR);
-%             if ~strcmp(msg1,'')
-%                 errormsg=['cannot create ' DirOAR ': ' msg1];%error message for directory creation
-%                 return
-%             end
-%         end
-        filename_joblist=fullfile(DirExe,'0_job_list.txt');%create name of the global executable file
+        DirOAR=fullfile(OutputDir,'0_OAR');
+        if exist(DirOAR,'dir')% delete the content of the dir 0_LOG to allow new input
+            curdir=pwd;
+            cd(DirOAR)
+            delete('*')
+            cd(curdir)
+        else
+            [tild,msg1]=mkdir(DirOAR);
+            if ~strcmp(msg1,'')
+                errormsg=['cannot create ' DirOAR ': ' msg1];%error message for directory creation
+                return
+            end
+        end
+        filename_joblist=fullfile(DirOAR,'0_job_list.txt');%create name of the global executable file
         filename_log=fullfile(DirLog,'job_list.stdout');%file for output messages of the master oar process
         filename_errors=fullfile(DirLog,'job_list.stderr');%file for error messages of the master oar process
@@ -1963,11 +1963,12 @@
             '"oar-parexec -s -f ' filename_joblist ' '...
             '-l ' filename_joblist '.log"\n'];
-        
-        filename_oarcommand=fullfile(DirExe,'0_oar_command');
+        fprintf(oar_command);% display  system command on the Matlab command window
+         [status,result]=system(oar_command)% execute system command and show the result (ID number of the launched job) on the Matlab command window
+        filename_oarcommand=fullfile(DirOAR,'0_oar_command');% keep track of the command in file '0-OAR/0_oar_command'
         fid=fopen(filename_oarcommand,'w');
-        fprintf(fid,oar_command);
+        fprintf(fid,oar_command); % store the command
+        fprintf(fid,result);% store the result (job ID number)
         fclose(fid);
-        fprintf(oar_command);% display in command line
-        system(oar_command);  
+
         msgbox_uvmat('CONFIRMATION',[ActionName ' launched as  ' num2str(NbProcess) ' processes in cluster: press STATUS to see results'])
     case 'cluster_pbs' % for LMFA Kepler machine
Index: /trunk/src/series/civ_series.m
===================================================================
--- /trunk/src/series/civ_series.m	(revision 910)
+++ /trunk/src/series/civ_series.m	(revision 911)
@@ -1093,8 +1093,8 @@
                         xtable(ivec)=iref+utable(ivec)/2-0.5;% convec flow (velocity taken at the point middle from imgae 1 and 2)
                         ytable(ivec)=jref+vtable(ivec)/2-0.5;% and position of pixel 1=0.5 (convention for image coordinates=0 at the edge)
-                        iref=round(xtable(ivec));% nearest image index for the middle of the vector
-                        jref=round(ytable(ivec));
+                        iref=round(xtable(ivec)+0.5);% nearest image index for the middle of the vector
+                        jref=round(ytable(ivec)+0.5);
                         % eliminate vectors located in the mask
-                        if checkmask && par_civ.Mask(jref,iref)<200 && par_civ.Mask(jref,iref)>=100
+                        if  checkmask && (iref<1 || jref<1 ||iref>npx_ima || jref>npy_ima ||( par_civ.Mask(jref,iref)<200 && par_civ.Mask(jref,iref)>=100))
                             utable(ivec)=0;
                             vtable(ivec)=0;
@@ -1129,9 +1129,9 @@
 F=0;
 [npy,npx]=size(result_conv);
-result_conv(result_conv<1)=1; %set to 1 correlation values smaller than 1 (to avoid divergence in the log)
+result_conv(result_conv<1)=1; %set to 1 correlation values smaller than 1  (=0 by discretisation, to avoid divergence in the log)
 %the following 8 lines are copyright (c) 1998, Uri Shavit, Roi Gurka, Alex Liberzon, Technion ï¿œ Israel Institute of Technology
 %http://urapiv.wordpress.com
 peaky = y;
-if y <= npy-1 && y > 1
+if y < npy && y > 1
     f0 = log(result_conv(y,x));
     f1 = log(result_conv(y-1,x));
@@ -1142,5 +1142,5 @@
 end
 peakx=x;
-if x <= npx-1 && x > 1
+if x < npx-1 && x > 1
     f0 = log(result_conv(y,x));
     f1 = log(result_conv(y,x-1));
@@ -1162,5 +1162,5 @@
 result_conv(result_conv<1)=1; %set to 1 correlation values smaller than 1 (to avoid divergence in the log)
 [npy,npx]=size(result_conv);
-if (x <= npx-1) && (y <= npy-1) && (x >= 1) && (y >= 1)
+if (x < npx) && (y < npy) && (x > 1) && (y > 1)
     F=0;
     for i=-1:1
Index: /trunk/src/set_object.m
===================================================================
--- /trunk/src/set_object.m	(revision 910)
+++ /trunk/src/set_object.m	(revision 911)
@@ -38,5 +38,5 @@
 function varargout = set_object(varargin)
 
-% Last Modified by GUIDE v2.5 16-Jan-2015 11:03:00
+% Last Modified by GUIDE v2.5 15-Jun-2015 19:51:15
 
 % Begin initialization code - DO NOT REFRESH
@@ -797,2 +797,25 @@
     REFRESH_Callback(hObject,eventdata,handles)
 end
+
+
+
+function num_RangeInterp_Callback(hObject, eventdata, handles)
+% hObject    handle to num_RangeInterp (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,'String') returns contents of num_RangeInterp as text
+%        str2double(get(hObject,'String')) returns contents of num_RangeInterp as a double
+
+
+% --- Executes during object creation, after setting all properties.
+function num_RangeInterp_CreateFcn(hObject, eventdata, handles)
+% hObject    handle to num_RangeInterp (see GCBO)
+% eventdata  reserved - to be defined in a future version of MATLAB
+% handles    empty - handles not created until after all CreateFcns called
+
+% Hint: edit controls usually have a white background on Windows.
+%       See ISPC and COMPUTER.
+if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
+    set(hObject,'BackgroundColor','white');
+end
