Index: trunk/src/series/civ_series.m
===================================================================
--- trunk/src/series/civ_series.m	(revision 1066)
+++ trunk/src/series/civ_series.m	(revision 1068)
@@ -89,5 +89,39 @@
     end
     % estimated CPUTime
-Data.CPUTime=1; % 1 minute per field pair
+    CPUtime_unit=0.01;%estimated time for a multiplication (in microsecond)
+    if isfield(Param.SeriesData,'FileInfo')&&isfield(Param.SeriesData.FileInfo{1},'Height')&&isfield(Param.SeriesData.FileInfo{1},'Width')
+        pixnbre=Param.SeriesData.FileInfo{1}.Height*Param.SeriesData.FileInfo{1}.Width; % total number of pxels for input images  
+        CPUtime=0;
+        if isfield(Data.ActionInput,'Civ1')
+            %BoxSize=Data.ActionInput.Civ1.CorrBoxSize(1)*Data.ActionInput.Civ1.CorrBoxSize(2);
+            tic
+            testboxa=rand(Data.ActionInput.Civ1.CorrBoxSize(1),Data.ActionInput.Civ1.CorrBoxSize(2));
+            testboxb=rand(Data.ActionInput.Civ1.SearchBoxSize(1),Data.ActionInput.Civ1.SearchBoxSize(2));
+            anss=conv2(testboxa,testboxb);
+            CPUtime_unit=toc;
+            nb_box=pixnbre/(Data.ActionInput.Civ1.Dx*Data.ActionInput.Civ1.Dy);    
+            %nbpos=Data.ActionInput.Civ1.SearchBoxSize-Data.ActionInput.Civ1.CorrBoxSize;
+            CPUtime=2*CPUtime_unit*nb_box%*BoxSize*nbpos(1)*nbpos(2);% adjustement factor 2 used
+        end
+        if isfield(Data.ActionInput,'Patch1')
+            CPUtime=2*CPUtime;
+        end
+        if isfield(Data.ActionInput,'Civ2')
+            tic
+            testboxa=rand(Data.ActionInput.Civ2.CorrBoxSize(1),Data.ActionInput.Civ2.CorrBoxSize(2));
+            testboxb=rand(Data.ActionInput.Civ2.SearchBoxSize(1),Data.ActionInput.Civ2.SearchBoxSize(2));
+            anss=conv2(testboxa,testboxb);
+            CPUtime_unit=toc;
+            nb_box=pixnbre/(Data.ActionInput.Civ2.Dx*Data.ActionInput.Civ2.Dy);
+            %BoxSize=Data.ActionInput.Civ2.CorrBoxSize(1)*Data.ActionInput.Civ2.CorrBoxSize(2);
+            %nbpos=Data.ActionInput.Civ2.SearchBoxSize-Data.ActionInput.Civ2.CorrBoxSize;
+            CPUtime=CPUtime+2*CPUtime_unit*nb_box;%*BoxSize*nbpos(1)*nbpos(2);
+        end
+        if isfield(Data.ActionInput,'Patch2')
+            CPUtime=(4/3)*CPUtime;
+        end
+        Data.CPUTime=ceil(CPUtime/6); % estimated CPU time per field pair in minute
+        Data.CPUTime=Data.CPUTime/10; % displqy CPU time with 1 digit beyond dot
+    end
     return
 end
Index: trunk/src/series/extract_multitif.m
===================================================================
--- trunk/src/series/extract_multitif.m	(revision 1066)
+++ trunk/src/series/extract_multitif.m	(revision 1068)
@@ -73,5 +73,6 @@
     ParamOut.OutputDirExt='.png';%set the output dir extension
     ParamOut.OutputFileMode='NbSlice';% '=NbInput': 1 output file per input file index, '=NbInput_i': 1 file per input file index i, '=NbSlice': 1 file per slice
-      ParamOut.CheckOverwriteVisible='on'; % manage the overwrite of existing files (default=1)
+    ParamOut.CheckOverwriteVisible='on'; % manage the overwrite of existing files (default=1)
+    ParamOut.CPUTime=7;% expected time for writting one image ( in minute)
     %% root input file(s) and type
     % check the existence of the first file in the series
@@ -113,24 +114,4 @@
 end
 
-%% list of input images
-% DirImages=fullfile(Param.InputTable{1,1},Param.InputTable{1,2});
-% ListStruct=dir(DirImages);
-% ListCells=struct2cell(ListStruct);% transform dir struct to a cell arrray
-% check_bad=strcmp('.',ListCells(1,:))|strcmp('..',ListCells(1,:));%detect the dir '.' to exclude it
-% check_dir=cell2mat(ListCells(4,:));% =1 for directories, =0 for files
-% ListFile=ListCells(1,find(~check_dir & ~check_bad));
-
-%% check file names
-% RootName=regexprep(ListFile{1},'.tif$','')
-% rank(1)=1;
-% for ilist=2:numel(ListFile)
-%     rank_str=regexprep(ListFile{ilist},'.tif$','');
-%     rank(ilist)=regexprep(rank_str,['^' RootName '@'],'');
-% %     if ~isequal(str2num(rank),ilist-1)
-% %         disp(['error in the list of input file # ' num2str(ilist-1)])
-% %         return
-% %     end
-% end
-
 %% output directory
 OutputDir=fullfile(Param.InputTable{1,1},[Param.OutputSubDir Param.OutputDirExt]);
@@ -156,10 +137,4 @@
 end
 
-%% Main loop
-
-
-% count=0;
-%count=316;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%CORRECTION EXP08: 4684 images -> start at 316 start 67->_11_1
-%count=1934%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%CORRECTION EXP07: 3066 images
 %% loop on the files
 % include the first tiff file with no index in the first iteration
@@ -174,4 +149,5 @@
 end
 for ifile=firstindex:Param.IndexRange.last_i
+    tic
     if firstindex==0 && ifile==0% first slice of processing
         ImageName=fullfile(Param.InputTable{1,1},Param.InputTable{1,2},'im.tif')
@@ -181,5 +157,4 @@
     NbFrames=numel(imfinfo(ImageName));
     for iframe=1:NbFrames
-        iframe
         if isequal(ImagesPerLevel,1)% mode series
             OutputFile=fullfile(OutputDir,['img_' num2str(count+1) '.png']);
@@ -198,4 +173,7 @@
         count=count+1;
     end
+    tt=toc;
+    disp(['elapsed time (in min.) for the file im@' num2str(ifile,'%04d')])
+    disp(num2str(tt/60))
 end
 
Index: trunk/src/series/extract_rdvision.m
===================================================================
--- trunk/src/series/extract_rdvision.m	(revision 1066)
+++ trunk/src/series/extract_rdvision.m	(revision 1068)
@@ -489,12 +489,12 @@
 
 %% correct NbDtj and NbDti (error from RDvision)
-if NbDtj==numel(Dtj)% case of bursts
-    NbDtj=1;
-    uid_motor_nbslice=find(t,'ImaDoc/TranslationMotor/Nbslice');
-    if ~isempty(uid_motor_nbslice)&& ~isempty(uid_Dtk)% case of multilevel
-        NbSlice=str2num(get(t,get(t,uid_motor_nbslice,'contents'),'value'));
-        NbDti=NbSlice-1;
-    end
-end
+% if NbDtj==numel(Dtj)% case of bursts
+%     NbDtj=1;
+%     uid_motor_nbslice=find(t,'ImaDoc/TranslationMotor/Nbslice');
+%     if ~isempty(uid_motor_nbslice)&& ~isempty(uid_Dtk)% case of multilevel
+%         NbSlice=str2num(get(t,get(t,uid_motor_nbslice,'contents'),'value'));
+%         NbDti=NbSlice-1;
+%     end
+% end
 
 if isempty(Dtj)% case of simple series
@@ -509,40 +509,40 @@
     nbfield2=NbDtj*numel(Dtj)+1;
     NbFrames_xml=nbfield1*nbfield2;
-   if NbFrames_xml<numel(timestamp)
-       disp(['ERROR: size from xml ' num2str(NbFrame_xml) ' smaller than timestamp size ' num2str(numel(timestamp))])
-       return
-   end
-   if NbFrames_xml>numel(timestamp)
-       nbfield1=floor(numel(timestamp)/nbfield2);
-       nbfieldk=floor(nbfield1/nbfieldi);
-       nbfield1=nbfieldi*nbfieldk;
-       NbDtk=nbfieldk-1;
-       t=set(t,uid_content_NbDtk,'value',num2str(NbDtk));% correct NbDtk in the xml file (in practice numel(Dtk)=1;
-       timestamp=timestamp(1:nbfield1*nbfield2);
-       disp(['image record stopped before end: max index i= ' num2str(nbfield1)]);
-       timestamp=reshape(timestamp,nbfield2,nbfield1);
-   end
-   % check Dtj with respect to timestamp
-    timestamp=(reshape(timestamp,nbfield2,[]))';
-    diff_Dtj=diff(timestamp(1,:))-Dtj;
-    if max(abs(diff_Dtj))>min(Dtj)/1000
-        disp(['Dtj from xml file differs from time stamp by ' num2str(max(abs(diff_Dtj))) ', '])%'
-    else
-        disp('Dtj OK');
-    end
+%    if NbFrames_xml<numel(timestamp)
+%        disp(['ERROR: size from xml ' num2str(NbFrame_xml) ' smaller than timestamp size ' num2str(numel(timestamp))])
+%        return
+%    end
+%    if NbFrames_xml>numel(timestamp)
+%        nbfield1=floor(numel(timestamp)/nbfield2);
+%        nbfieldk=floor(nbfield1/nbfieldi);
+%        nbfield1=nbfieldi*nbfieldk;
+%        NbDtk=nbfieldk-1;
+%        t=set(t,uid_content_NbDtk,'value',num2str(NbDtk));% correct NbDtk in the xml file (in practice numel(Dtk)=1;
+%        timestamp=timestamp(1:nbfield1*nbfield2);
+%        disp(['image record stopped before end: max index i= ' num2str(nbfield1)]);
+%        timestamp=reshape(timestamp,nbfield2,nbfield1);
+%    end
+%    % check Dtj with respect to timestamp
+%     timestamp=(reshape(timestamp,nbfield2,[]))';
+%     diff_Dtj=diff(timestamp(1,:))-Dtj;
+%     if max(abs(diff_Dtj))>min(Dtj)/1000
+%         disp(['Dtj from xml file differs from time stamp by ' num2str(max(abs(diff_Dtj))) ', '])%'
+%     else
+%         disp('Dtj OK');
+%     end
 end
 
 %% adjust Dti
-if NbDti+1>size(timestamp,1)
-    NbDti=size(timestamp,1)-1;
-end
-Dti_stamp=(timestamp(1+NbDti,1)-timestamp(1,1))/NbDti;
-Dti_stamp=(timestamp(1+NbDti,1)-timestamp(2,1))/(NbDti-1);
-t=set(t,uid_content_Dti,'value',num2str(Dti_stamp));%corret Dti
-if abs(Dti_stamp-Dti)>Dti/1000
-    disp([msg 'Dti from xml file corrected by ' num2str(Dti_stamp-Dti) ', ']);%'
-else
-    disp('Dti OK')
-end
+% if NbDti+1>size(timestamp,1)
+%     NbDti=size(timestamp,1)-1;
+% end
+% Dti_stamp=(timestamp(1+NbDti,1)-timestamp(1,1))/NbDti;
+% Dti_stamp=(timestamp(1+NbDti,1)-timestamp(2,1))/(NbDti-1);
+% t=set(t,uid_content_Dti,'value',num2str(Dti_stamp));%corret Dti
+% if abs(Dti_stamp-Dti)>Dti/1000
+%     disp([msg 'Dti from xml file corrected by ' num2str(Dti_stamp-Dti) ', ']);%'
+% else
+%     disp('Dti OK')
+% end
 
 %% adjust Dtk
Index: trunk/src/series/merge_proj_polar.m
===================================================================
--- trunk/src/series/merge_proj_polar.m	(revision 1066)
+++ trunk/src/series/merge_proj_polar.m	(revision 1068)
@@ -63,5 +63,5 @@
     ParamOut.AllowInputSort='on';% allow alphabetic sorting of the list of input file SubDir (options 'off'/'on', 'off' by default)
     ParamOut.WholeIndexRange='off';% prescribes the file index ranges from min to max (options 'off'/'on', 'off' by default)
-    ParamOut.NbSlice='on'; %nbre of slices ('off' by default)
+    ParamOut.NbSlice='off'; %nbre of slices ('off' by default)
     ParamOut.VelType='one';% menu for selecting the velocity type (options 'off'/'one'/'two',  'off' by default)
     ParamOut.FieldName='off';% menu for selecting the field (s) in the input file(options 'off'/'one'/'two', 'off' by default)
@@ -268,8 +268,6 @@
     CheckOverwrite=Param.CheckOverwrite;
 end
-
+NbField 
 for index=1:NbField
-    disp(['index=' num2str(index)])
-    disp(['ellapsed time ' num2str(toc(tstart)/60,4) ' minutes'])
     update_waitbar(WaitbarHandle,index/NbField)
     if ~isempty(RUNHandle) && ~strcmp(get(RUNHandle,'BusyAction'),'queue')
@@ -352,8 +350,12 @@
         %% calculate tps coefficients
         Data{iview}=tps_coeff_field(Data{iview},1);
-        
+        'tps_coeff done'
         %% projection on the polar grid
         [DataOut,VarAttribute,errormsg]=calc_field_tps(Data{iview}.Coord_tps,Data{iview}.NbCentre,Data{iview}.SubRange,...
             cat(3,Data{iview}.U_tps,Data{iview}.V_tps),FieldNames,cat(3,XI,YI));
+        if ~isempty(errormsg)
+            disp(errormsg)
+        end
+        
         % set to NaN interpolation points which are too far from any initial data (more than 2 CoordMesh)
         Coord=permute(Data{iview}.Coord_tps,[1 3 2]);
@@ -366,4 +368,5 @@
             G=TriScatteredInterp(Coord,Coord(:,2),'nearest');
         end
+        'Interp done'
         Distx=F(XI,YI)-XI;% diff of x coordinates with the nearest measurement point
         Disty=G(XI,YI)-YI;% diff of y coordinates with the nearest measurement point
@@ -390,4 +393,5 @@
     
     %% merge the NbView fields
+    ProjData
     [MergeData,errormsg]=merge_field(ProjData);
     if ~isempty(errormsg)
@@ -446,5 +450,5 @@
        TimeData.div=MergeData.div;
 
-            [error,ncid]=struct2nc(OutputFile,TimeData);%save result file
+            error=struct2nc(OutputFile,TimeData);%save result file
         if isempty(error)
             disp(['output file ' OutputFile ' written'])
@@ -453,9 +457,7 @@
         end
             ellapsed_time=toc(tstart);
-    disp(['total ellapsed time ' num2str(ellapsed_time/60,2) ' minutes'])
-end
-
-ellapsed_time=toc(tstart);
-disp(['total ellapsed time ' num2str(ellapsed_time/60,2) ' minutes'])
+    disp(['ellapsed time since start ' num2str(ellapsed_time/60,2) ' minutes'])
+end
+
 disp([ num2str(ellapsed_time/(60*NbField),3) ' minutes per iteration'])
 
