Index: /trunk/src/plot_field.m
===================================================================
--- /trunk/src/plot_field.m	(revision 880)
+++ /trunk/src/plot_field.m	(revision 881)
@@ -299,21 +299,21 @@
 
 % data need to be displayed in a table
-if strcmp(get(htext,'Type'),'uitable')% display data in a table
-    VarNameCell=cell(1,numel(VarIndex));% prepare list of variable names to display (titles of columns)
-    VarLength=zeros(1,numel(VarIndex));  % default number of values for each variable
-    for ivar=1:numel(VarIndex)
-        VarNameCell{ivar}=FieldData.ListVarName{VarIndex(ivar)};
-        VarLength(ivar)=numel(FieldData.(VarNameCell{ivar}));
-    end
-    set(htext,'ColumnName',VarNameCell)
-    Data=cell(max(VarLength),numel(VarIndex));% prepare the table of data display
-    
-    for ivar=1:numel(VarIndex)
-        VarValue=FieldData.(VarNameCell{ivar});
-        VarValue=reshape(VarValue,[],1);% reshape values array in a column
-        Data(1:numel(VarValue),ivar)=num2cell(VarValue);
-    end
-    set(htext,'Data',Data)
-end
+% if strcmp(get(htext,'Type'),'uitable')% display data in a table
+%     VarNameCell=cell(1,numel(VarIndex));% prepare list of variable names to display (titles of columns)
+%     VarLength=zeros(1,numel(VarIndex));  % default number of values for each variable
+%     for ivar=1:numel(VarIndex)
+%         VarNameCell{ivar}=FieldData.ListVarName{VarIndex(ivar)};
+%         VarLength(ivar)=numel(FieldData.(VarNameCell{ivar}));
+%     end
+%     set(htext,'ColumnName',VarNameCell)
+%     Data=cell(max(VarLength),numel(VarIndex));% prepare the table of data display
+%     
+%     for ivar=1:numel(VarIndex)
+%         VarValue=FieldData.(VarNameCell{ivar});
+%         VarValue=reshape(VarValue,[],1);% reshape values array in a column
+%         Data(1:numel(VarValue),ivar)=num2cell(VarValue);
+%     end
+%     set(htext,'Data',Data)
+% end
 %         if numel(VarValue)>1 && numel(VarValue)<10 % case of a variable with several values 
 %             for ind=1:numel(VarValue)
@@ -577,5 +577,5 @@
 %% give statistics for pdf
 %ind_var=find(testplot);
-TableData={'Variable';'SampleNbr';'bin size';'Mean';'RMS';'Skewness';'Kurtosis';'    centered ';...
+TableData={'Variable';'SampleNbr';'bin size';'Mean';'RMS';'Skewness';'Kurtosis';...
     'Min';'FirstCentile';'FirstDecile';'Median';'LastDecile';'LastCentile';'Max'};
 
@@ -587,9 +587,21 @@
         pdf_val=data.(data.ListVarName{CellInfo{icell}.VarIndex_histo});
         x=coord_x{icell};
-        
-        Val=pdf2stat(x',pdf_val');
-
-        Column=mat2cell(Val,ones(13,1),1);
-        Column=[{VarName};Column(1:6);{'stat: --'};Column(7:13)];
+        if isrow(x)
+            x=x';
+        end
+        if ~isequal(size(x,1),size(pdf_val,1))
+            pdf_val=pdf_val';
+        end
+        Val=pdf2stat(x,pdf_val);
+        Column=mat2cell(Val,ones(13,1),ones(1,size(Val,2)));
+        if size(Val,2)==1%single component
+            TitleBar={VarName};
+        else
+            TitleBar=cell(1,size(Val,2));
+            for icomp=1:size(Val,2)
+                TitleBar{icomp}=[VarName '_' num2str(icomp)];
+            end
+        end
+        Column=[TitleBar;Column];
         TableData=[TableData Column];
     end
Index: /trunk/src/series/aver_stat.m
===================================================================
--- /trunk/src/series/aver_stat.m	(revision 880)
+++ /trunk/src/series/aver_stat.m	(revision 881)
@@ -88,5 +88,5 @@
         if ismember(SeriesData.ProjObject.ProjMode,{'inside','outside'})
             answer=msgbox_uvmat('INPUT_TXT','set bin size for histograms (or keep ''auto'' by default)?','auto');
-            ParamOut.ActionInput.VarMesh=str2double(answer);
+            ParamOut.ActionInput.VarMesh=str2num(answer);
         end
     end
Index: /trunk/src/series/civ_input.m
===================================================================
--- /trunk/src/series/civ_input.m	(revision 880)
+++ /trunk/src/series/civ_input.m	(revision 881)
@@ -332,5 +332,5 @@
 %% list the possible index pairs, depending on the option set in ListPairMode
 ListPairMode_Callback([], [], handles)
-ListPairCiv1_Callback(hObject, eventdata, handles)
+%ListPairCiv1_Callback(hObject, eventdata, handles)
 
 %% set the GUI to modal: wait for OK to close
@@ -875,7 +875,8 @@
 end
 nom_type_ima=CivInputData.NomTypeIma;
-initial=get(handles.ListPairCiv1,'Value');%previous choice of pair
-menu_pair=get(handles.ListPairCiv1,'String');%previous choice of pair.ListPairCiv1
-init_choice=menu_pair{initial};
+menu_pair=get(handles.ListPairCiv1,'String');%previous menu of ListPairCiv1
+PairCiv1Init=menu_pair{get(handles.ListPairCiv1,'Value')};%previous choice of pair
+menu_pair=get(handles.ListPairCiv2,'String');%previous menu of ListPairCiv1
+PairCiv2Init=menu_pair{get(handles.ListPairCiv2,'Value')};%previous choice of pair
 
 %% determine nom_type_nc, nomenclature type of the .nc files:
@@ -973,7 +974,7 @@
 
 %% determine the default selection in the pair menu for Civ1
-ichoice=find(select,1);% index of first selected pair
-if (isempty(ichoice) || ichoice < 1); ichoice=1; end;
-ichoice=find(strcmp(init_choice,displ_pair'),1);
+%ichoice=find(select,1);% index of first selected pair
+%if (isempty(ichoice) || ichoice < 1); ichoice=1; end;
+ichoice=find(strcmp(PairCiv1Init,displ_pair'),1);
 if ~isempty(ichoice)
     set(handles.ListPairCiv1,'Value',ichoice);% first valid pair proposed by default in the menu
@@ -987,12 +988,22 @@
 %% determine the default selection in the pair menu for Civ2
 if strcmp(get(handles.ListPairCiv2,'Visible'),'on')
-    initial=get(handles.ListPairCiv2,'Value');
-    if initial>length(displ_pair')%|~isequal(select(initial),1)
-        if ichoice <= length(displ_pair')
-            set(handles.ListPairCiv2,'Value',ichoice);% same pair proposed by default for civ2
-        else
-            set(handles.ListPairCiv2,'Value',1);% same pair proposed by default for civ2
-        end
-    end
+    ichoice=find(strcmp(PairCiv2Init,displ_pair'),1);
+    if ~isempty(ichoice)
+        set(handles.ListPairCiv2,'Value',ichoice);% first valid pair proposed by default in the menu
+    else
+        set(handles.ListPairCiv2,'Value',1)
+    end
+    
+    %
+    %     initial=get(handles.ListPairCiv2,'Value');
+    %
+    %
+    %     if initial>length(displ_pair')%|~isequal(select(initial),1)
+    %         if ichoice <= length(displ_pair')
+    %             set(handles.ListPairCiv2,'Value',ichoice);% same pair proposed by default for civ2
+    %         else
+    %             set(handles.ListPairCiv2,'Value',1);% same pair proposed by default for civ2
+    %         end
+    %     end
 else
     set(handles.ListPairCiv2,'Value',get(handles.ListPairCiv1,'Value'))% initiate the choice of Civ2 as a reproduction of if civ1
Index: /trunk/src/series/time_series.m
===================================================================
--- /trunk/src/series/time_series.m	(revision 880)
+++ /trunk/src/series/time_series.m	(revision 881)
@@ -471,5 +471,5 @@
                 DataOut.([VarName 'Histo'])(index,ind_start:ind_start+MaxIndex_new-MinIndex_new)=...
                     DataOut.([VarName 'Histo'])(index,ind_start:ind_start+MaxIndex_new-MinIndex_new)+Field.([VarName 'Histo']);
-                VarVal=pdf2stat(Field.(VarName),Field.([VarName 'Histo']));% max of the current field
+                VarVal=pdf2stat((Field.(VarName))',(Field.([VarName 'Histo']))');% max of the current field
                 for istat=1:numel(VarVal)
                     DataOut.([VarName StatName{istat}])(index)=VarVal(istat);
@@ -506,5 +506,5 @@
         DataOut.Time(index,1)=time(index);%
     end
-    
+    index
     % record the number of missing input fields
     if ~isempty(errormsg)
Index: /trunk/src/transform_field/signal_bandpass_filter.m
===================================================================
--- /trunk/src/transform_field/signal_bandpass_filter.m	(revision 880)
+++ /trunk/src/transform_field/signal_bandpass_filter.m	(revision 881)
@@ -26,5 +26,49 @@
 %=======================================================================
 
-function DataOut=signal_bandpass_filter(DataIn)
+function DataOut=signal_bandpass_filter(DataIn,Param)
+
+%% request input parameters
+if isfield(DataIn,'Action') && isfield(DataIn.Action,'RUN') && isequal(DataIn.Action.RUN,0)
+    VarNbDim=cellfun('length',DataIn.VarDimName);
+    [tild,rank]=sort(VarNbDim,2,'descend');% sort the list of input variables, putting the ones with higher dimensionality first
+    ListVarName=DataIn.ListVarName(rank);
+    VarDimName=DataIn.VarDimName(rank);
+    InitialValue=1;%default choice
+    if isfield(Param,'TransformInput') && isfield(Param.TransformInput,'VariableName')
+        val=find(strcmp(Param.TransformInput.VariableName,ListVarName));
+        if ~isempty(val);
+            InitialValue=val;
+        end
+    end
+    [s,OK] = listdlg('PromptString','Select the variable to process:',...
+        'SelectionMode','single','InitialValue',InitialValue,...
+        'ListString',ListVarName);
+    if OK==1
+        VarName=ListVarName{s};
+        DataOut.TransformInput.VariableName=VarName;
+        dlg_title = [mfilename ' filter signal along first dim ' VarDimName{s}{1}];% title of the input dialog fig
+        prompt = {'central filtering frequency';'bandwith (relative to the central frequency) '};% titles of the edit boxes
+        %default input:
+        def={'';'0.1'};% filtering frequency and relative bandwidth
+
+        if isfield(Param,'TransformInput')% if parameters have been memorised
+            if isfield(Param.TransformInput,'CentralFrequency')
+                def{1}=num2str(Param.TransformInput.CentralFrequency);
+            end
+            if isfield(Param.TransformInput,'BandWidth')
+                 def{2}=num2str(Param.TransformInput.BandWidth);
+            end
+        end
+        num_lines= 1;%numel(prompt);
+        % open the dialog fig
+        answer = inputdlg(prompt,dlg_title,num_lines,def);
+        DataOut.TransformInput.CentralFrequency=str2num(answer{1});
+        DataOut.TransformInput.BandWidth=str2num(answer{2});
+    end
+    return
+end
+
+
+
 %% set GUI config
 DataOut=[];
@@ -34,9 +78,11 @@
 end
 %%%%%%%%%%%%%%%%%%%%%%%%%
-frequency=2*5/54.5;% frequency at which the signal needs to be filetered
+frequency=Param.TransformInput.CentralFrequency;% frequency at which the signal needs to be filetered
+Bw=Param.TransformInput.BandWidth;
+ DataOut=DataIn;
  %d=fdesign.bandpass(0.8*frequency, 0.95*frequency, 1.05*frequency, 1.2*frequency, 60, 1, 60);
- d=fdesign.bandpass(0.7*frequency, 0.9*frequency, 1.1*frequency, 1.3*frequency, 60, 1, 60);
+ d=fdesign.bandpass((1-2*Bw)*frequency, (1-Bw)*frequency, (1+Bw)*frequency, (1+2*Bw)*frequency, 60, 1, 60);
  Hd=design(d);% command  fvtool(Hd) to visualize the filter frequency response
- DataOut=DataIn;
+
  if isfield(DataIn,'U')
  DataOut.U = filter(Hd,DataIn.U);
Index: /trunk/src/view_field.m
===================================================================
--- /trunk/src/view_field.m	(revision 880)
+++ /trunk/src/view_field.m	(revision 881)
@@ -80,5 +80,5 @@
 set(handles.PlotAxes,'UserData',AxeData)
 if exist('Field','var')
-    [PlotType,PlotParamOut]= plot_field(Field,handles.PlotAxes);%,PlotParam,KeepLim,PosColorbar)
+    [PlotType,PlotParamOut]= plot_field(Field,handles.PlotAxes);
     set(handles.Axes,'Visible','on')
     if isfield(PlotParamOut,'Vectors')
@@ -91,6 +91,5 @@
     else
         set(handles.Scalar,'Visible','off')
-    end
-    
+    end   
     errormsg=fill_GUI(PlotParamOut,hObject);
     if ~isempty(errormsg)
@@ -98,5 +97,4 @@
         return
     end
-    %write_plot_param(handles,PlotParamOut);% update the display of the plotting parameters
 end
 
