Index: /trunk/src/series.m
===================================================================
--- /trunk/src/series.m	(revision 823)
+++ /trunk/src/series.m	(revision 824)
@@ -2828,70 +2828,70 @@
 
 % --------------------------------------------------------------------
-function MenuImportParam_Callback(hObject, eventdata, handles)
-%% use a starting file name for browserr
-InputTable=get(handles.InputTable,'Data');
-oldfile=InputTable{1,1};
-if isempty(oldfile)
-    % use a file name stored in prefdir
-    dir_perso=prefdir;
-    profil_perso=fullfile(dir_perso,'uvmat_perso.mat');
-    if exist(profil_perso,'file')
-        h=load (profil_perso);
-        if isfield(h,'RootPath') && ischar(h.RootPath)
-            oldfile=h.RootPath;
-        end
-    end
-end
-filexml=uigetfile_uvmat('pick a xml parameter file',oldfile,'.xml');% get the xml file containing processing parameters
-%proceed only if a file has been introduced by the browser
-if ~isempty(filexml)
-    Param=xml2struct(filexml);% read the input xml file as a Matlab structure
-    % ask to stop current Action if button RUN is in action (another process is already running)
-    if isequal(get(handles.RUN,'Value'),1)
-        answer= msgbox_uvmat('INPUT_Y-N','stop current Action process?');
-        if strcmp(answer,'Yes')
-            STOP_Callback(hObject, eventdata, handles)
-        else
-            return
-        end
-    end
-    Param.Action.RUN=0; %desactivate the input RUN=1
-    if ~isfield(Param,'InputTable')||~isfield(Param,'IndexRange')
-        msgbox_uvmat('ERROR','invalid config file: open a file in a folder ''/0_XML''')
-        return
-    end
-    Param=rmfield(Param,'InputTable');% do not refresh Input files and index range
-    Param=rmfield(Param,'IndexRange');  
-    fill_GUI(Param,handles.series)% fill the elements of the GUI series with the input parameters
-    SeriesData=get(handles.series,'UserData');
-    if isfield(Param,'InputFields')
-        ListField=Param.InputFields.FieldName;
-        set(handles.FieldName,'String',[ListField;{'get-field...'}])
-         set(handles.FieldName,'Value',1:numel(ListField))
-    end       
-    if isfield(Param,'ActionInput')%  introduce  parameters specific to an Action fct, for instance PIV parameters
-        set(handles.ActionInput,'Visible','on')
-        set(handles.ActionInput,'Value',0)
-        Param.ActionInput.ConfigSource=filexml;% record the source of config for future info
-        SeriesData.ActionInput=Param.ActionInput;
-    end
-    if isfield(Param,'ProjObject') %introduce projection object if relevant
-        SeriesData.ProjObject=Param.ProjObject;
-    end
-    set(handles.series,'UserData',SeriesData)
-    if isfield(Param,'CheckObject') && isequal(Param.CheckObject,1)
-        set(handles.ProjObject,'String',Param.ProjObject.Name)
-        set(handles.ViewObject,'Visible','on')
-        set(handles.EditObject,'Visible','on')
-        set(handles.DeleteObject,'Visible','on')
-    else     
-        set(handles.ProjObject,'String','')
-        set(handles.ProjObject,'Visible','off')
-        set(handles.ViewObject,'Visible','off')
-        set(handles.EditObject,'Visible','off')
-        set(handles.DeleteObject,'Visible','off')     
-    end     
-    set(handles.REFRESH,'BackgroundColor',[1 0 1]); %paint REFRESH button in magenta to indicate that it should be activated
-end
+% function MenuImportParam_Callback(hObject, eventdata, handles)
+% %% use a starting file name for browserr
+% InputTable=get(handles.InputTable,'Data');
+% oldfile=InputTable{1,1};
+% if isempty(oldfile)
+%     % use a file name stored in prefdir
+%     dir_perso=prefdir;
+%     profil_perso=fullfile(dir_perso,'uvmat_perso.mat');
+%     if exist(profil_perso,'file')
+%         h=load (profil_perso);
+%         if isfield(h,'RootPath') && ischar(h.RootPath)
+%             oldfile=h.RootPath;
+%         end
+%     end
+% end
+% filexml=uigetfile_uvmat('pick a xml parameter file',oldfile,'.xml');% get the xml file containing processing parameters
+% %proceed only if a file has been introduced by the browser
+% if ~isempty(filexml)
+%     Param=xml2struct(filexml);% read the input xml file as a Matlab structure
+%     % ask to stop current Action if button RUN is in action (another process is already running)
+%     if isequal(get(handles.RUN,'Value'),1)
+%         answer= msgbox_uvmat('INPUT_Y-N','stop current Action process?');
+%         if strcmp(answer,'Yes')
+%             STOP_Callback(hObject, eventdata, handles)
+%         else
+%             return
+%         end
+%     end
+%     Param.Action.RUN=0; %desactivate the input RUN=1
+%     if ~isfield(Param,'InputTable')||~isfield(Param,'IndexRange')
+%         msgbox_uvmat('ERROR','invalid config file: open a file in a folder ''/0_XML''')
+%         return
+%     end
+%     Param=rmfield(Param,'InputTable');% do not refresh Input files and index range
+%     Param=rmfield(Param,'IndexRange');  
+%     fill_GUI(Param,handles.series)% fill the elements of the GUI series with the input parameters
+%     SeriesData=get(handles.series,'UserData');
+%     if isfield(Param,'InputFields')
+%         ListField=Param.InputFields.FieldName;
+%         set(handles.FieldName,'String',[ListField;{'get-field...'}])
+%          set(handles.FieldName,'Value',1:numel(ListField))
+%     end       
+%     if isfield(Param,'ActionInput')%  introduce  parameters specific to an Action fct, for instance PIV parameters
+%         set(handles.ActionInput,'Visible','on')
+%         set(handles.ActionInput,'Value',0)
+%         Param.ActionInput.ConfigSource=filexml;% record the source of config for future info
+%         SeriesData.ActionInput=Param.ActionInput;
+%     end
+%     if isfield(Param,'ProjObject') %introduce projection object if relevant
+%         SeriesData.ProjObject=Param.ProjObject;
+%     end
+%     set(handles.series,'UserData',SeriesData)
+%     if isfield(Param,'CheckObject') && isequal(Param.CheckObject,1)
+%         set(handles.ProjObject,'String',Param.ProjObject.Name)
+%         set(handles.ViewObject,'Visible','on')
+%         set(handles.EditObject,'Visible','on')
+%         set(handles.DeleteObject,'Visible','on')
+%     else     
+%         set(handles.ProjObject,'String','')
+%         set(handles.ProjObject,'Visible','off')
+%         set(handles.ViewObject,'Visible','off')
+%         set(handles.EditObject,'Visible','off')
+%         set(handles.DeleteObject,'Visible','off')     
+%     end     
+%     set(handles.REFRESH,'BackgroundColor',[1 0 1]); %paint REFRESH button in magenta to indicate that it should be activated
+% end
 
 
@@ -3333,4 +3333,2 @@
 %------------------------------------------------------------------------
 Mode_Callback([],[])
-
-
Index: /trunk/src/series/civ_input.m
===================================================================
--- /trunk/src/series/civ_input.m	(revision 823)
+++ /trunk/src/series/civ_input.m	(revision 824)
@@ -2099,2 +2099,77 @@
 
 % handles    structure with handles and user data (see GUIDATA)
+
+
+% --- Executes on button press in InportParam.
+function InportParam_Callback(hObject, eventdata, handles)
+hseries=findobj(allchild(0),'Tag','series');
+hhseries=guidata(hseries);
+InputTable=get(hhseries.InputTable,'Data');% read the input file(s) table in the GUI series
+oldfile=InputTable{1,1};
+if isempty(oldfile)
+    % use a file name stored in prefdir
+    dir_perso=prefdir;
+    profil_perso=fullfile(dir_perso,'uvmat_perso.mat');
+    if exist(profil_perso,'file')
+        h=load (profil_perso);
+        if isfield(h,'RootPath') && ischar(h.RootPath)
+            oldfile=h.RootPath;
+        end
+    end
+end
+filexml=uigetfile_uvmat('pick a xml parameter file for civ',oldfile,'.xml');% get the xml file containing processing parameters
+%proceed only if a file has been introduced by the browser
+if ~isempty(filexml)
+    Param=xml2struct(filexml);% read the input xml file as a Matlab structure
+
+   % Param.Action.RUN=0; %desactivate the input RUN=1
+    if ~isfield(Param,'InputTable')||~isfield(Param,'IndexRange')
+        msgbox_uvmat('ERROR','invalid config file: open a file in a folder ''/0_XML''')
+        return
+    end
+    check_input=0;
+    if isfield(Param,'ActionInput')
+        if isfield(Param.ActionInput,'Program')&& strcmp(Param.ActionInput.Program,'civ_series')
+            fill_GUI(Param.ActionInput,handles.civ_input)% fill the elements of the GUI series with the input parameters
+            check_input=1;
+            update_CivOptions(handles,0)
+                
+        end
+    end
+    if ~check_input
+        msgbox_uvmat('ERROR','invalid config file (not for civ_series')
+        return
+    end
+%     Param=rmfield(Param,'InputTable');% do not refresh Input files and index range
+%     Param=rmfield(Param,'IndexRange');  
+%     fill_GUI(Param,handles.civ_input)% fill the elements of the GUI series with the input parameters
+% %     SeriesData=get(h,'UserData');
+%     if isfield(Param,'InputFields')
+%         ListField=Param.InputFields.FieldName;
+%         set(handles.FieldName,'String',[ListField;{'get-field...'}])
+%          set(handles.FieldName,'Value',1:numel(ListField))
+%     end       
+%     if isfield(Param,'ActionInput')%  introduce  parameters specific to an Action fct, for instance PIV parameters
+%         set(handles.ActionInput,'Visible','on')
+%         set(handles.ActionInput,'Value',0)
+%         Param.ActionInput.ConfigSource=filexml;% record the source of config for future info
+%         SeriesData.ActionInput=Param.ActionInput;
+%     end
+%     if isfield(Param,'ProjObject') %introduce projection object if relevant
+%         SeriesData.ProjObject=Param.ProjObject;
+%     end
+%     set(handles.series,'UserData',SeriesData)
+%     if isfield(Param,'CheckObject') && isequal(Param.CheckObject,1)
+%         set(handles.ProjObject,'String',Param.ProjObject.Name)
+%         set(handles.ViewObject,'Visible','on')
+%         set(handles.EditObject,'Visible','on')
+%         set(handles.DeleteObject,'Visible','on')
+%     else     
+%         set(handles.ProjObject,'String','')
+%         set(handles.ProjObject,'Visible','off')
+%         set(handles.ViewObject,'Visible','off')
+%         set(handles.EditObject,'Visible','off')
+%         set(handles.DeleteObject,'Visible','off')     
+%     end     
+%     set(handles.REFRESH,'BackgroundColor',[1 0 1]); %paint REFRESH button in magenta to indicate that it should be activated
+end
Index: /trunk/src/series/civ_series.m
===================================================================
--- /trunk/src/series/civ_series.m	(revision 823)
+++ /trunk/src/series/civ_series.m	(revision 824)
@@ -131,5 +131,5 @@
             PairCiv1=Param.ActionInput.PairIndices.ListPairCiv1;
             if isfield(Param.ActionInput.PairIndices,'ListPairCiv2')
-                PairCiv2=Param.ActionInput.PairIndices.ListPairCiv2;
+                PairCiv2=Param.ActionInput.PairIndices.ListPairCiv2;%string which determines the civ2 pair
             end
             if iview_A==1% if Civ1 is performed
@@ -157,9 +157,9 @@
 %             j2_series_Civ1=j2_series_Civ1(~check_bounds);
         case 'displacement'
-            i1_series_Civ1=Param.ActionInput.OriginIndex*ones(size(i_series{1}));
-            i2_series_Civ1=i_series{1};i2_series_Civ2=i_series{1};
-            j1_series_Civ1=ones(size(i_series{1}));% first j index is 1
+            i1_series_Civ1=Param.ActionInput.OriginIndex*ones(size(i1_series{1}));
+            i2_series_Civ1=i1_series{1};i2_series_Civ2=i1_series{1};
+            j1_series_Civ1=ones(size(i1_series{1}));% first j index is 1
             if isempty(j1_series_Civ1)
-                j2_series_Civ1=ones(size(i_series{1}));
+                j2_series_Civ1=ones(size(i1_series{1}));
             else
                 j2_series_Civ1=j1_series_Civ1;
@@ -170,12 +170,12 @@
             NomTypeNc=NomType;
         case 'shift'
-            i1_series_Civ1=i_series{1};i1_series_Civ2=i_series{1};
-            i2_series_Civ1=i_series{1};i2_series_Civ2=i_series{1};
-            if isempty(j_series{1})
-                j1_series_Civ1=ones(size(i_series{1}));
-                j2_series_Civ1=ones(size(i_series{1}));
+            i1_series_Civ1=i1_series{1};i1_series_Civ2=i1_series{1};
+            i2_series_Civ1=i1_series{2};i2_series_Civ2=i1_series{2};
+            if isempty(j1_series{1})
+                j1_series_Civ1=ones(size(i1_series{1}));
+                j2_series_Civ1=ones(size(i1_series{2}));
             else
-                j1_series_Civ1=j_series{1};
-                j2_series_Civ1=j_series{1};
+                j1_series_Civ1=j1_series{1};
+                j2_series_Civ1=j1_series{2};
             end
             j1_series_Civ2=j1_series_Civ1;
@@ -192,9 +192,8 @@
         FrameIndex_B_Civ1=j2_series_Civ1;
     end
-    if ~isempty(PairCiv2)
-%         i1_series_Civ2=i1_series_Civ2(~check_bounds);
-%         i2_series_Civ2=i2_series_Civ2(~check_bounds);
-%         j1_series_Civ2=j1_series_Civ2(~check_bounds);
-%         j2_series_Civ2=j2_series_Civ2(~check_bounds);
+    if isempty(PairCiv2)
+            FrameIndex_A_Civ2=FrameIndex_A_Civ1;
+            FrameIndex_B_Civ2=FrameIndex_B_Civ1;
+    else
         if isempty(j1_series_Civ2)
             FrameIndex_A_Civ2=i1_series_Civ2;
Index: /trunk/src/series/extract_rdvision.m
===================================================================
--- /trunk/src/series/extract_rdvision.m	(revision 823)
+++ /trunk/src/series/extract_rdvision.m	(revision 824)
@@ -117,4 +117,8 @@
     return
 end
+if exist(fullfile(RootPath{1},OutputDir),'dir')
+     msgbox_uvmat('ERROR',['output folder ' OutputDir ' already exists, put data in a new folder Experiment']);
+     return
+end
 
 %% calibration data and timing: read the ImaDoc files
@@ -198,5 +202,5 @@
     ImageName='img_1.png';
 end
-
+ 
 %update information of 'Heading'
 uid_Heading=find(t,'ImaDoc/Heading');
Index: /trunk/src/series/turb_stat.m
===================================================================
--- /trunk/src/series/turb_stat.m	(revision 823)
+++ /trunk/src/series/turb_stat.m	(revision 824)
@@ -221,5 +221,9 @@
         Uprev=Field.U;
         Vprev=Field.V;
+        if isfield(Field,'FF')
         FFprev=Field.FF;
+        else
+            FFprev=true(size(Field.U));
+        end
     end
     FF=isnan(Field.U);%|Field.U<-60|Field.U>30;% threshold on U
Index: /trunk/src/uigetfile_uvmat.m
===================================================================
--- /trunk/src/uigetfile_uvmat.m	(revision 823)
+++ /trunk/src/uigetfile_uvmat.m	(revision 824)
@@ -147,5 +147,7 @@
 htitlebox=findobj(hfig,'tag','titlebox');  % display the current dir name  
 DirName=get(htitlebox,'String');
-
+if isempty(regexp(DirName,'^http://'))% if the input dir is not a web site (begins by http://)
+%     FullSelectName=DirName;
+% else
 if ~strcmp(filter_ext,'uigetdir')% a file is expected as output, not a dir
     hlist=findobj(hfig,'Tag','list');
@@ -162,4 +164,6 @@
     end
     FullSelectName=fullfile(DirName,SelectName);
+    % if regexp(DirName,'^http://')% if the input dir is a web site (begins by http://)
+
     if exist(FullSelectName,'file')
         switch option
@@ -181,4 +185,5 @@
     end
 end
+end
 set(hObject,'backgroundColor',[0 1 0])% indicate end button activation
 uiresume(get(hObject,'parent'))
@@ -313,6 +318,10 @@
 NumFiles=0; %default
 if numel(ListStruct)<1  % case of empty dir
+%     if regexp(DirName,'^http://')% if the input dir is a web site (begins by http://)
+%         web(DirName)
+%     else
     ListFiles={};
     return
+%     end
 end
 ListCells=struct2cell(ListStruct);% transform dir struct to a cell arrray
