Index: trunk/src/series/aver_stat.m
===================================================================
--- trunk/src/series/aver_stat.m	(revision 381)
+++ trunk/src/series/aver_stat.m	(revision 392)
@@ -51,10 +51,4 @@
 [filecell,i1_series,i2_series,j1_series,j2_series]=get_file_series(Param);
 
-%% coordinate transform or other user defined transform (TODO: case BATCH ?)
-transform_fct='';%default
-if isfield(Param,'transform_fct') % transform function handle
-    transform_fct=Param.transform_fct;
-end
-
 %% projection object
 test_object=get(hseries.GetObject,'Value');
@@ -63,5 +57,4 @@
     %ProjObject=read_set_object(guidata(hset_object));
     ProjObject=read_GUI(hset_object);
-    %answeryes=questdlg({['field series projected on ' Series.ProjObject.Style]});
     answeryes=msgbox_uvmat('INPUT_Y-N',['field series projected on ' ProjObject.Style ' before averaging']);
     if ~isequal(answeryes,'Yes')
@@ -138,5 +131,4 @@
 %% number of slices
 NbSlice=Param.IndexRange.NbSlice;
-NbSlice_name=num2str(NbSlice);
 
 %% Field and velocity type (the same for the two views)
@@ -157,5 +149,4 @@
            return
         end
-        %hhget_field=guidata(hget_field);%handles of GUI elements in get_field
         SubField=read_get_field(hget_field); %read the names of the variables to plot in the get_field GUI
     end
@@ -164,5 +155,4 @@
 %% get the velocity type
 testcivx=0;
-% FileExt=get(hseries.FileExt,'String');
 if ~isequal(FieldName,{'get_field...'})
     testcivx=isequal(FileType{1},'netcdf');
@@ -223,5 +213,5 @@
 end
 
-%% check coincidence in time
+%% check coincidence in time for several input file series
 multitime=0;
 if isempty(timecell)
@@ -249,5 +239,5 @@
     end   
 end
-if size(time,2) < i2_series{1}(end) || size(time,3) < num_j2{1}(end)% ime array absent or too short in ImaDoc xml file' 
+if size(time,2) < i2_series{1}(end) || size(time,3) < num_j2{1}(end)% time array absent or too short in ImaDoc xml file' 
     time=[];
 end
@@ -269,7 +259,5 @@
         %NomTypeOut=nomtype2pair(Param.InputTable{1,4},i2_series{end}(end)-i1_series{1}(1),j2_series{end}(end)-j1_series{1}(1));
         NomTypeOut='_1-2';
-%         RootPath,SubDir,RootFile,FileExt,NomType,i1,i2,j1,j2)
-        fileresult{1}=fullfile_uvmat(RootPath{1},subdir_result,RootFile{1},ext_out,NomTypeOut,i1_series{1}(1),[],[],[]);
-%         fileresult{1}=name_generator(filebase_out,i1_series{1}(1),j1_series{1}(1),ext_out,NomTypeOut,1,i2_series{end}(end),j2_series{end}(end),subdir_result);
+        fileresult{1}=fullfile_uvmat(RootPath{1},subdir_result,RootFile{1},ext_out,NomTypeOut,i1_series{1}(1),i1_series{1}(end),[],[]);
         testexist=exist(fileresult{1},'file');
     else % simplified indexing with i_slice for multiple slices
@@ -277,5 +265,4 @@
         for i_slice=1:NbSlice
             fileresult{1}=fullfile_uvmat(RootPath{1},subdir_result,RootFile{1},ext_out,NomTypeOut,i_slice,[],[],[]);
-            %fileresult{i_slice}=name_generator(filebase_out,i_slice,[],ext_out,'_1',1,i_slice,[],subdir_result);
             if exist(fileresult{i_slice},'file')
                 testexist=1;
@@ -303,6 +290,6 @@
 %% coordinate transform or other user defined transform
 transform_fct='';%default
-if isfield(Param,'FieldTransform')&&isfield(Param.FieldTransform,'transform_fct')
-    transform_fct=Param.FieldTransform.transform_fct;
+if isfield(Param,'FieldTransform')&&isfield(Param.FieldTransform,'fct_handle')
+    transform_fct=Param.FieldTransform.fct_handle;
 end
 
@@ -329,6 +316,4 @@
             % reading input file(s)
             for iview=1:nbview
-%                 [filename]=...
-%                     name_generator(filebase{iview},num_i1{iview}(ifile),num_j1{iview}(ifile),FileExt{iview},NomType{iview},1,num_i2{iview}(ifile),j2_series{iview}(ifile),SubDir{iview});
                     filename=filecell{iview,index};
                     if ~isequal(FileType{iview},'netcdf')
@@ -442,5 +427,4 @@
     end
     if isempty(time) % time read from files  prevails
-        time_end=[];
         if isfield(Field,'Time')
             time_end=Field.Time(1);%last time read
@@ -490,6 +474,6 @@
 %% reproduce ImaDoc/GeometryCalib for image series
 if isfield(XmlData{1},'GeometryCalib') && ~isempty(XmlData{1}.GeometryCalib) 
-    [pp,RootFile]=fileparts(filebase_out);
-    outputxml=fullfile(pathdir,[RootFile '.xml'])
+    [tild,RootFile]=fileparts(filebase_out);
+    outputxml=fullfile(pathdir,[RootFile '.xml']);
     errormsg=update_imadoc(XmlData{1}.GeometryCalib,outputxml);% introduce the calibration data in the xml file
     if strcmp(errormsg,'')
