Index: trunk/src/proj_field.m
===================================================================
--- trunk/src/proj_field.m	(revision 1099)
+++ trunk/src/proj_field.m	(revision 1100)
@@ -1125,4 +1125,10 @@
 icell_grid=[];% field cell index which defines the grid
 icell_scattered=[];% field cell index which defines fields with scattered coordinates
+for icell=1:numel(CellInfo)
+    if strcmp(ObjectData.ProjMode,'interp_lin')&& ~strcmp(ProjMode{icell},'interp_tps')
+        errormsg='ProjMode interp_tps needed ';
+        return
+    end
+end
 if strcmp(ObjectData.ProjMode,'projection')
     %% case of a grid requested by the input field
@@ -1130,6 +1136,6 @@
         if isfield(CellInfo{icell},'ProjModeRequest')
             switch CellInfo{icell}.ProjModeRequest
-%                 case 'interp_lin'
-%                     ProjMode{icell}='interp_lin';
+                case 'interp_lin'
+                    ProjMode{icell}='interp_lin';
                 case 'interp_tps'
                     ProjMode{icell}='interp_tps';
@@ -1236,4 +1242,8 @@
         continue % only cells represnting 2D or 3D fields are involved
     end
+%     if isfield(CellInfo{icell},'ProjModeRequest') && ~strcmp(CellInfo{icell}.ProjModeRequest,ProjMode{icell})
+%         msgbox_uvmat('ERROR',['ProjMode ' CellInfo{icell}.ProjModeRequest ' needed'])
+%         return
+%     end
     VarIndex= CellInfo{icell}.VarIndex;%  indices of the selected variables in the list FieldData.ListVarName
     %dimensions
@@ -1247,6 +1257,6 @@
     VarAttribute={};% initiate coresponding list of var attributes  for cell # icell
     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-    check3D=(numel(CellInfo{icell}.CoordIndex)==3);
-    switch CellInfo{icell}.CoordType   
+    check3D=(numel(CellInfo{icell}.CoordIndex)==3); 
+    switch CellInfo{icell}.CoordType 
         case 'scattered'
             %% case of input fields with unstructured coordinates (applies for projMode ='projection' or 'interp_lin')
Index: trunk/src/series.m
===================================================================
--- trunk/src/series.m	(revision 1099)
+++ trunk/src/series.m	(revision 1100)
@@ -1773,11 +1773,15 @@
         OutputDir=Param.ActionInput.LogPath;
     end
-    
+    if isfield(Param,'OutputSubDir') 
     set(handles.OutputSubDir,'String',Param.OutputSubDir)
     set(handles.OutputDirExt,'String',Param.OutputDirExt)
     drawnow
+    end
     if get(handles.Replicate,'Value')
         set(handles.InputTable,'Data',Param.InputTable)
-        check_input_file_series(handles)
+        set(handles.OutputPath,'String',Pathout)
+        set(handles.Experiment,'String',ListExp{iexp})
+        set(handles.Device,'String',ListDevices{iexp})
+        check_input_file_series(handles)      
     end
     DirXml=fullfile(OutputDir,'0_XML');
@@ -2477,5 +2481,8 @@
 
 %% Detect the types of input files and set menus and default options in 'VelType'
-iview_civ=find(strcmp('civx',SeriesData.FileType)|strcmp('civdata',SeriesData.FileType));
+if ~isfield(SeriesData,'FileType')
+    SeriesData.FileType={'none'};
+end
+iview_civ=find( strcmp('civx',SeriesData.FileType)|strcmp('civdata',SeriesData.FileType));
 iview_netcdf=find(strcmp('netcdf',SeriesData.FileType)|strcmp('civx',SeriesData.FileType)|strcmp('civdata',SeriesData.FileType)); % all nc files, icluding civ
 FieldList=get(handles.FieldName,'String'); % previous list as default
@@ -2652,5 +2659,5 @@
 %% enable or desable j index visibility
 status_j='on'; % default
-if isempty(find(~cellfun(@isempty,SeriesData.j1_series), 1)); % case of empty j indices
+if isfield(SeriesData,'j1_series') && isempty(find(~cellfun(@isempty,SeriesData.j1_series), 1)) % case of empty j indices
     status_j='off'; % no j index needed
 elseif strcmp(get(handles.PairString,'Visible'),'on')
Index: trunk/src/series/beam_forming.m
===================================================================
--- trunk/src/series/beam_forming.m	(revision 1099)
+++ trunk/src/series/beam_forming.m	(revision 1100)
@@ -75,5 +75,5 @@
 FileExt=Param.InputTable{1,5};
 [filecell,i1_series,i2_series,j1_series,j2_series]=get_file_series(Param);
-%%%%%%%%%%%%
+%%%%%%%%%%%%.sback.sback
 % The cell array filecell is the list of input file names, while
 % filecell{iview,fileindex}:
@@ -111,5 +111,5 @@
 
 % clear all
-% close all
+% close all.sback
 % read_data=1;
 affichage=0;
@@ -147,5 +147,5 @@
     time=(b/rsf+[0:A-1]/rsf); %b=250, rsf=10,
     freq1=0.5;freq2=1.5;
-    [BB AA]=butter(4,[freq1 freq2]/rsf*2);
+    [BB AA]=butter(4,[freq1 freq2]/rsf*2);.sback
 
     for ii=1:length(nbvoie_reception)%=64
Index: trunk/src/series/check_data_files.m
===================================================================
--- trunk/src/series/check_data_files.m	(revision 1099)
+++ trunk/src/series/check_data_files.m	(revision 1100)
@@ -123,5 +123,7 @@
         Tabchar{1}=filecell{iview,1};%info.Filename;
         Tabchar{2}='';
+        if isfield(FileInfo,'FrameRate')
         Tabchar{3}=[num2str(FileInfo.FrameRate) ' frames/s '];
+        end
         message='';
     else
Index: trunk/src/series/turb_stat.m
===================================================================
--- trunk/src/series/turb_stat.m	(revision 1099)
+++ trunk/src/series/turb_stat.m	(revision 1100)
@@ -202,104 +202,101 @@
 
 %%%%%%%%%%%%%%%% loop on field indices %%%%%%%%%%%%%%%%
-for index=1:NbField
-    update_waitbar(WaitbarHandle,index/NbField)
-    if ~isempty(RUNHandle)&& ~strcmp(get(RUNHandle,'BusyAction'),'queue')
-        disp('program stopped by user')
-        break
-    end
-    [Field,tild,errormsg] = read_field(filecell{1,index},FileType{iview},InputFields{iview},frame_index{iview}(index));
-
-    %%%%%%%%%%%% MAIN RUNNING OPERATIONS  %%%%%%%%%%%%
-    if index==1 %initiate the output data structure in the first field
-        [CellInfo,NbDim,errormsg]=find_field_cells(Field);
-        YName='coord_y';%default
-        XName='coord_x';%default
-        for icell=1:numel(NbDim)
-            if NbDim(icell)==2 && strcmp(CellInfo{icell}.CoordType,'grid')
-                  YName=CellInfo{icell}.YName;
-                  XName=CellInfo{icell}.XName;
-                  break
+% for i_slice=1:Param.IndexRange.NbSlice
+%     i_slice
+    ind_first=Param.IndexRange.first_i
+    for index_i=ind_first:Param.IndexRange.NbSlice:Param.IndexRange.last_i
+        if ~isempty(RUNHandle)&& ~strcmp(get(RUNHandle,'BusyAction'),'queue')
+            disp('program stopped by user')
+            break
+        end
+        for index_j=Param.IndexRange.first_j:Param.IndexRange.last_j
+            InputFile=fullfile_uvmat(RootPath{1},SubDir{1},RootFile{1},FileExt{1},NomType{1},index_i,index_i,index_j,index_j);
+            [Field,tild,errormsg] = read_field(InputFile,FileType{iview},InputFields{iview});
+            
+            %[Field,tild,errormsg] = read_field(filecell{1,index},FileType{iview},InputFields{iview},frame_index{iview}(index));
+            
+            %%%%%%%%%%%% MAIN RUNNING OPERATIONS  %%%%%%%%%%%%
+            if index_i==ind_first && index_j==Param.IndexRange.first_j %initiate the output data structure in the first field
+                [CellInfo,NbDim,errormsg]=find_field_cells(Field);
+                YName='coord_y';%default
+                XName='coord_x';%default
+                for icell=1:numel(NbDim)
+                    if NbDim(icell)==2 && strcmp(CellInfo{icell}.CoordType,'grid')
+                        YName=CellInfo{icell}.YName;
+                        XName=CellInfo{icell}.XName;
+                        break
+                    end
+                end
+                DataOut.ListVarName={YName, XName ,'UMean' , 'VMean','u2Mean','v2Mean','u2Mean_1','v2Mean_1','uvMean','CurlMean','DivMean','Curl2Mean','Div2Mean','Counter'};
+                DataOut.VarDimName={YName,XName,{YName,XName},{YName,XName},{YName,XName},{YName,XName},{YName,XName},{YName,XName},...
+                    {YName,XName},{YName,XName},{YName,XName},{YName,XName},{YName,XName},{YName,XName}};
+                DataOut.(YName)=Field.(YName);
+                DataOut.(XName)=Field.(XName);
+                Uprev=Field.U;% store the current field for next iteration
+                Vprev=Field.V;
+                if isfield(Field,'FF')
+                    FFprev=Field.FF;% possible flag for false data
+                else
+                    %FFprev=true(size(Field.U));
+                    FFprev=isnan(Field.U);
+                end
+            end
+            FF=isnan(Field.U);%|Field.U<-60|Field.U>30;% threshold on U
+            DataOut.Counter=DataOut.Counter+ (~FF);% add 1 to the couter for non NaN point
+            Counter_1=Counter_1+(~FF & ~FFprev);
+            Field.U(FF)=0;% set to 0 the nan values
+            Field.V(FF)=0;
+            DataOut.UMean=DataOut.UMean+Field.U; %increment the sum
+            DataOut.VMean=DataOut.VMean+Field.V; %increment the sum
+            
+            U2Mean=U2Mean+(Field.U).*(Field.U); %increment the U squared sum
+            V2Mean=V2Mean+(Field.V).*(Field.V); %increment the V squared sum
+            UVMean=UVMean+(Field.U).*(Field.V); %increment the sum
+            U2Mean_1=U2Mean_1+(Field.U).*Uprev; %increment the U squared sum
+            V2Mean_1=V2Mean_1+(Field.V).*Vprev; %increment the V squared sum
+            Uprev=Field.U; %store for next iteration
+            Vprev=Field.V;
+            FFprev=FF;
+            if isfield(Field,'curl') && isfield(Field,'div')
+                Field.curl(FF)=0;% set to 0 the nan values
+                Field.div(FF)=0;
+                DataOut.CurlMean=DataOut.CurlMean+Field.curl;
+                DataOut.DivMean=DataOut.DivMean+Field.div;
+                DataOut.Curl2Mean=DataOut.Curl2Mean+Field.curl.*Field.curl;
+                DataOut.Div2Mean=DataOut.Div2Mean+Field.div.*Field.div;
             end
         end
-        DataOut.ListVarName={YName, XName ,'UMean' , 'VMean','u2Mean','v2Mean','u2Mean_1','v2Mean_1','uvMean','CurlMean','DivMean','Curl2Mean','Div2Mean','Counter'};
-        DataOut.VarDimName={YName,XName,{YName,XName},{YName,XName},{YName,XName},{YName,XName},{YName,XName},{YName,XName},...
-    {YName,XName},{YName,XName},{YName,XName},{YName,XName},{YName,XName},{YName,XName}};
-        DataOut.(YName)=Field.(YName);
-        DataOut.(XName)=Field.(XName);
-        Uprev=Field.U;% store the current field for next iteration
-        Vprev=Field.V;
-        if isfield(Field,'FF')
-        FFprev=Field.FF;% possible flag for false data 
-        else
-            %FFprev=true(size(Field.U));
-            FFprev=isnan(Field.U);
-        end
     end
-    FF=isnan(Field.U);%|Field.U<-60|Field.U>30;% threshold on U
-    DataOut.Counter=DataOut.Counter+ (~FF);% add 1 to the couter for non NaN point
-    Counter_1=Counter_1+(~FF & ~FFprev);
-    Field.U(FF)=0;% set to 0 the nan values
-    Field.V(FF)=0;
-    DataOut.UMean=DataOut.UMean+Field.U; %increment the sum
-    DataOut.VMean=DataOut.VMean+Field.V; %increment the sum
+    %%%%%%%%%%%%%%%% end loop on field indices %%%%%%%%%%%%%%%%
     
-    U2Mean=U2Mean+(Field.U).*(Field.U); %increment the U squared sum
-    V2Mean=V2Mean+(Field.V).*(Field.V); %increment the V squared sum
-    UVMean=UVMean+(Field.U).*(Field.V); %increment the sum
-    U2Mean_1=U2Mean_1+(Field.U).*Uprev; %increment the U squared sum
-    V2Mean_1=V2Mean_1+(Field.V).*Vprev; %increment the V squared sum
-    Uprev=Field.U; %store for next iteration
-    Vprev=Field.V;
-    FFprev=FF;
-    if isfield(Field,'curl') && isfield(Field,'div')
-        Field.curl(FF)=0;% set to 0 the nan values
-        Field.div(FF)=0;
-        DataOut.CurlMean=DataOut.CurlMean+Field.curl;
-        DataOut.DivMean=DataOut.DivMean+Field.div;
-        DataOut.Curl2Mean=DataOut.Curl2Mean+Field.curl.*Field.curl;
-        DataOut.Div2Mean=DataOut.Div2Mean+Field.div.*Field.div;
+    DataOut.Counter(DataOut.Counter==0)=1;% put counter to 1 when it is zero
+    DataOut.UMean=DataOut.UMean./DataOut.Counter; % normalize the mean
+    DataOut.VMean=DataOut.VMean./DataOut.Counter; % normalize the mean
+    U2Mean=U2Mean./DataOut.Counter; % normalize the mean
+    V2Mean=V2Mean./DataOut.Counter; % normalize the mean
+    UVMean=UVMean./DataOut.Counter; % normalize the mean
+    U2Mean_1=U2Mean_1./Counter_1; % normalize the mean
+    V2Mean_1=V2Mean_1./Counter_1; % normalize the mean
+    DataOut.u2Mean=U2Mean-DataOut.UMean.*DataOut.UMean; % normalize the mean
+    DataOut.v2Mean=V2Mean-DataOut.VMean.*DataOut.VMean; % normalize the mean
+    DataOut.uvMean=UVMean-DataOut.UMean.*DataOut.VMean; % normalize the mean \
+    DataOut.u2Mean_1=U2Mean_1-DataOut.UMean.*DataOut.UMean; % normalize the mean
+    DataOut.v2Mean_1=V2Mean_1-DataOut.VMean.*DataOut.VMean; % normalize the mean
+    DataOut.CurlMean=DataOut.CurlMean./DataOut.Counter;
+    DataOut.DivMean=DataOut.DivMean./DataOut.Counter;
+    DataOut.Curl2Mean=DataOut.Curl2Mean./DataOut.Counter-DataOut.CurlMean.*DataOut.CurlMean;
+    DataOut.Div2Mean=DataOut.Div2Mean./DataOut.Counter-DataOut.DivMean.*DataOut.DivMean;    
+    
+    %% writing the result file as netcdf file
+    OutputFile=fullfile_uvmat(RootPath{1},OutputDir,RootFile{1},FileExtOut,NomTypeOut,ind_first,ind_first,first_j,last_j);
+    %case of netcdf input file , determine global attributes
+    errormsg=struct2nc(OutputFile,DataOut); %save result file
+    if isempty(errormsg)
+        disp([OutputFile ' written']);
+    else
+        disp(['error in writting result file: ' errormsg])
     end
-end
-%%%%%%%%%%%%%%%% end loop on field indices %%%%%%%%%%%%%%%%
-
-DataOut.Counter(DataOut.Counter==0)=1;% put counter to 1 when it is zero
-DataOut.UMean=DataOut.UMean./DataOut.Counter; % normalize the mean
-DataOut.VMean=DataOut.VMean./DataOut.Counter; % normalize the mean
-U2Mean=U2Mean./DataOut.Counter; % normalize the mean
-V2Mean=V2Mean./DataOut.Counter; % normalize the mean
-UVMean=UVMean./DataOut.Counter; % normalize the mean
-U2Mean_1=U2Mean_1./Counter_1; % normalize the mean
-V2Mean_1=V2Mean_1./Counter_1; % normalize the mean
-DataOut.u2Mean=U2Mean-DataOut.UMean.*DataOut.UMean; % normalize the mean
-DataOut.v2Mean=V2Mean-DataOut.VMean.*DataOut.VMean; % normalize the mean
-DataOut.uvMean=UVMean-DataOut.UMean.*DataOut.VMean; % normalize the mean \
-DataOut.u2Mean_1=U2Mean_1-DataOut.UMean.*DataOut.UMean; % normalize the mean
-DataOut.v2Mean_1=V2Mean_1-DataOut.VMean.*DataOut.VMean; % normalize the mean
-DataOut.CurlMean=DataOut.CurlMean./DataOut.Counter;
-DataOut.DivMean=DataOut.DivMean./DataOut.Counter;
-DataOut.Curl2Mean=DataOut.Curl2Mean./DataOut.Counter-DataOut.CurlMean.*DataOut.CurlMean;
-DataOut.Div2Mean=DataOut.Div2Mean./DataOut.Counter-DataOut.DivMean.*DataOut.DivMean;
-
-%% calculate the profiles
-% npx=numel(DataOut.coord_x);
-% band=ceil(npx/5) :floor(4*npx/5);% keep only the central band
-% for ivar=3:numel(DataOut.ListVarName)-1
-%     VarName=DataOut.ListVarName{ivar};% name of the variable
-%     DataOut.ListVarName=[DataOut.ListVarName {[VarName 'Profile']}];%append the name of the profile variable
-%     DataOut.VarDimName=[DataOut.VarDimName {'(YName)'}];
-%    DataOut.([VarName 'Profile'])=mean(DataOut.(VarName)(:,band),2); %take the mean profile of U, excluding the edges
+    
 % end
-
-%% writing the result file as netcdf file
-OutputFile=fullfile_uvmat(RootPath{1},OutputDir,RootFile{1},FileExtOut,NomTypeOut,first_i,last_i,first_j,last_j);
- %case of netcdf input file , determine global attributes
-errormsg=struct2nc(OutputFile,DataOut); %save result file
-if isempty(errormsg)
-     disp([OutputFile ' written']);
-else
-     disp(['error in writting result file: ' errormsg])
-end
-
-
 %% open the result file with uvmat (in RUN mode)
 if checkrun && isequal(Param.IndexRange.NbSlice,1)
Index: trunk/src/uvmat.m
===================================================================
--- trunk/src/uvmat.m	(revision 1099)
+++ trunk/src/uvmat.m	(revision 1100)
@@ -3988,4 +3988,7 @@
         PlotParam{1}.Vectors.ColorScalar={''};
         PlotParam{1}.Vectors.ColorCode= {'rgb'};
+        if isfield(ParamOut,'ColorVar')
+            PlotParam{1}.Vectors.ColorScalar=ParamOut.ColorVar;
+        end
     end
 
