Index: /trunk/src/find_field_cells.m
===================================================================
--- /trunk/src/find_field_cells.m	(revision 1040)
+++ /trunk/src/find_field_cells.m	(revision 1041)
@@ -137,6 +137,10 @@
                 CellInfo{icell}.CoordSize=prod(CellInfo{icell}.CoordSize);
             end
+            ind_scalar=find(strcmp('scalar',Role(VarIndex)));
+            ind_vector_x=find(strcmp('vector_x',Role(VarIndex)));
+            ind_vector_y=find(strcmp('vector_y',Role(VarIndex)));
             ind_y=find(strcmp('coord_y',Role(VarIndex)));
-            if numel(VarIndex)==2||isempty(ind_y)% no variable, except possibly y
+            if numel([ind_scalar ind_vector_x ind_vector_y])==0           
+%             if numel(VarIndex)==2||isempty(ind_y)% no variable, except possibly y
                 NbDim(icell)=1;
             else
Index: /trunk/src/get_file_info.m
===================================================================
--- /trunk/src/get_file_info.m	(revision 1040)
+++ /trunk/src/get_file_info.m	(revision 1041)
@@ -55,10 +55,12 @@
 function [FileInfo,VideoObject]=get_file_info(fileinput)
 VideoObject=[];
+FileInfo.FileType='';% input file does not exist
+FileInfo.FieldType=''; %default output
+% check the existence (not possible for OpenDAP data)
 if ~isempty(regexp(fileinput,'^http://'))|| exist(fileinput,'file')
     FileInfo.FileName=fileinput;
     FileInfo.FileType='txt'; %default
 else
-    FileInfo.FileType='';% input file does not exist
-    return
+    return %input file does not exist.
 end
 [tild,tild,FileExt]=fileparts(fileinput);%get the file extension FileExt
@@ -186,6 +188,9 @@
         end
 end
+
 if ismember (FileInfo.FileType,{'image','image_DaVis','multimage','mmreader','cine_phantom','video','netcdf','civdata'})
         FileInfo.FileIndexing='on'; % allow to detect file index for scanning series
+else
+    FileInfo.FileIndexing='off';
 end
 FileInfo.FieldType=FileInfo.FileType;%default
@@ -193,4 +198,6 @@
     case {'image','multimage','video','mmreader','rdvision','image_DaVis','cine_phantom'}
     FileInfo.FieldType='image';
-end
-
+    case {'civx','civdata','pivdata_fluidimage'}
+        FileInfo.FieldType='civdata';
+end
+
Index: /trunk/src/read_field.m
===================================================================
--- /trunk/src/read_field.m	(revision 1040)
+++ /trunk/src/read_field.m	(revision 1041)
@@ -101,9 +101,10 @@
         checkU=0;
         checkV=0;
+        % scan the list InputField
         for ilist=1:numel(InputField)
             % look for input variables to read
             r=regexp(InputField{ilist},'(?<Operator>(^vec|^norm))\((?<UName>.+),(?<VName>.+)\)$','names');
             if isempty(r)%  no operator used
-                if isempty(find(strcmp(InputField{ilist},ListVar)))
+                if isempty(find(strcmp(InputField{ilist},ListVar),1))
                     ListVar=[ListVar InputField(ilist)];%append the variable name if not already in the list
                     ListInputField=[ListInputField InputField(ilist)];
@@ -111,5 +112,5 @@
                 end
                 if check_colorvar(ilist)
-                    if isempty(find(strcmp(InputField{ilist},ListVar)))
+                    if isempty(find(strcmp(InputField{ilist},ListVar),1))
                     Role{numel(ListVar)}='ancillary';% not projected with interpolation
                     ProjModeRequest{numel(ListVar)}='';
@@ -118,4 +119,9 @@
                     Role{numel(ListVar)}='scalar';
                     ProjModeRequest{numel(ListVar)}='interp_lin';%scalar field (requires interpolation for plot)
+                end
+                if isfield(ParamIn,'Coord_y')
+                    if ~isempty(strcmp(InputField{ilist},ParamIn.Coord_y))
+                        Role{numel(ListVar)}='coord_y';
+                    end
                 end
             else  % an operator 'vec' or 'norm' is used
@@ -139,6 +145,5 @@
                     Role=[Role {'vector_y'}];
                     ProjModeRequest=[ProjModeRequest {ProjModeRequestVar}];
-                    ListInputField=[ListInputField InputField(ilist)];
-                    
+                    ListInputField=[ListInputField InputField(ilist)];                
                 else
                     checkV=1;
@@ -301,6 +306,4 @@
     Npz=1;%default
     npxy=size(A);
-    %     Rangx=[0.5 npxy(2)-0.5]; % coordinates of the first and last pixel centers
-    %     Rangy=[npxy(1)-0.5 0.5]; %
     Field.NbDim=2;%default
     Field.AName='image';
@@ -318,5 +321,4 @@
                 ParamOut.Npy=npxy(1);
             end
-%             Field.VarAttribute{3}.Mesh=1;
         else
             Field.NbDim=3;
@@ -330,5 +332,4 @@
                 ParamOut.Npy=npxy(2);
             end
-%             Field.VarAttribute{4}.Mesh=1;
         end
     else
@@ -336,13 +337,9 @@
         Field.Coord_y=[npxy(1)-0.5 0.5];
         Field.Coord_x=[0.5 npxy(2)-0.5]; % coordinates of the first and last pixel centers
-%        ParamOut.Npx=npxy(2);% display image size on the interface
- %       ParamOut.Npy=npxy(1);
-%         Field.VarAttribute{3}.Mesh=1;
     end
     Field.A=A;
     Field.CoordUnit='pixel'; %used for mouse_motion
-        
-end
-
-
-
+end
+
+
+
Index: /trunk/src/series/civ_series.m
===================================================================
--- /trunk/src/series/civ_series.m	(revision 1040)
+++ /trunk/src/series/civ_series.m	(revision 1041)
@@ -176,5 +176,9 @@
                 end
             case 'displacement'
+                if isfield(Param.ActionInput,'OriginIndex')
                 i1_series_Civ1=Param.ActionInput.OriginIndex*ones(size(i1_series{1}));
+                else
+                    i1_series_Civ1=ones(size(i1_series{1}));
+                end
                 i1_series_Civ2=i1_series_Civ1;
                 i2_series_Civ1=i1_series{1};
Index: /trunk/src/uvmat.m
===================================================================
--- /trunk/src/uvmat.m	(revision 1040)
+++ /trunk/src/uvmat.m	(revision 1041)
@@ -1846,40 +1846,16 @@
 % detect the file type, get the movie object if relevant, and look for the corresponding file series:
 % the root name and indices may be corrected by including the first index i1 if a corresponding xml file exists
-% if isempty(regexp(fileinput,'^http://'))
-[RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,NomType,FileInfo,MovieObject,i1,i2,j1,j2]=find_file_series(FilePath,[FileName FileExt]);
-% else
-%     FileInfo.FileType='netcdf';
-%     [RootPath,SubDir,RootFile,i1,i2,j1,j2,Ext,NomType]=fileparts_uvmat(fileinput);
-%     i1_series=[0 i1 i2];
-%     i2_series=[];
-%     j1_series=[0 j1 j1];
-%     j2_series=[0 j1 j1];
-%     MovieObject=[];
-% %     [RootPath,RootFile]=fileparts(fileinput);
-% %     [RootPath,SubDir]=fileparts(RootPath);
-% %     NomType='*';
-% end
-FileType=FileInfo.FileType;
-if strcmp(FileType,'txt')
-    try
-        edit(fileinput)
-    catch ME
-        msgbox_uvmat('ERROR','invalid intput file')
-    end
-    return
-elseif strcmp(FileType,'xml')
-    editxml(fileinput)
-     return
-elseif strcmp(FileType,'figure')
-    open(fileinput)
-     return
-end
+[RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,NomType,FileInfo,MovieObject,i1,i2,j1,j2]=...
+    find_file_series(FilePath,[FileName FileExt]);
 
 %% open the file or fill the GUI uvmat according to the detected file type
-switch FileType
+FieldType=FileInfo.FieldType;
+switch FieldType
     case ''
         msgbox_uvmat('ERROR','invalid input file type')
+        return
     case 'txt'
         edit(fileinput)
+        return
     case 'figure'                           %display matlab figure
         hfig=open(fileinput);
@@ -1887,4 +1863,5 @@
         set(hfig,'WindowButtonUpFcn','mouse_up')%set mouse click action function
         set(hfig,'WindowButtonUpFcn','mouse_down')%set mouse click action function
+        return
     case 'xml'                % edit xml files
         t=xmltree(fileinput);
@@ -1895,26 +1872,20 @@
             editxml(fileinput);
         end
+        return
     case 'xls'% Excel file opended by editxml
         editxml(fileinput);
+        return
     otherwise
         set(handles_RootPath,'String',RootPath);
         set(handles_SubDir,'String',['/' SubDir]);
         set(handles_RootFile,'String',['/' RootFile]); %display the separator
-%         if strcmp(NomType,'level')
-%             rootname=fullfile(RootPath,SubDir,'level');
-%             rr=regexp(fileinput,['^' rootname '(?<j>\d+)/' RootFile '(?<i>\d+)' FileExt '$'],'names');
-%             if ~isempty(rr)
-%                 set(handles_FileIndex,'String',rr.i);
-%             end
-%         else
-            if isempty(regexp(RootPath,'^http://'))
+        if isempty(regexp(RootPath,'^http://'))
             rootname=fullfile(RootPath,SubDir,RootFile);
-            else
-                rootname=[RootPath '/' SubDir '/' RootFile];
-            end
-            indices=fileinput(length(rootname)+1:end);
-            indices(end-length(FileExt)+1:end)=[]; %remove extension
-            set(handles_FileIndex,'String',indices);
-%         end
+        else
+            rootname=[RootPath '/' SubDir '/' RootFile];
+        end
+        indices=fileinput(length(rootname)+1:end);
+        indices(end-length(FileExt)+1:end)=[]; %remove extension
+        set(handles_FileIndex,'String',indices);
         set(handles_NomType,'String',NomType);
         set(handles_FileExt,'String',FileExt);
@@ -1931,5 +1902,5 @@
                 i2_s=i2_0;
             else
-               i2_s=i2;
+                i2_s=i2;
             end
             j1_0=stra2num(get(handles.j1,'String'));
@@ -1946,5 +1917,5 @@
             end
         end
-
+        
         % synchronise indices of the second  input file if it exists
         if get(handles.SubField,'Value')==1% if the subfield button is activated, update the field numbers
@@ -1975,5 +1946,5 @@
             set(handles.FileIndex_1,'String',FileIndex_1)
         end
-
+        
         %enable other menus
         set(handles.MenuOpenCampaign,'Enable','on')
@@ -1982,8 +1953,7 @@
         set(handles.MenuExportMovie,'Enable','on')
         set(handles.MenuTools,'Enable','on')
-
+        
         % initiate input file series and inputfilerefresh the current field view:
         update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileInfo,MovieObject,index);
-
 end
 
@@ -1997,5 +1967,4 @@
 for ifile=1:min(length(MenuFile),5)
     set(handles.(['MenuFile_' num2str(ifile)]),'Label',MenuFile{ifile});
-    %set(handles.(['MenuFile_' num2str(ifile) '_1']),'Label',MenuFile{ifile});
 end
 dir_perso=prefdir;
@@ -2062,9 +2031,4 @@
         XmlData.Time=[0;ones(size(i1_series,3)-1,1)]*(0:1/FileInfo.FrameRate:(FileInfo.NumberOfFrames)/FileInfo.FrameRate);
     end
-%     if strcmp(FileInfo.FileType,'rdvision')
-%         TimeName='timestamp';
-%     else
-%     TimeName='video';
-%     end
 end
 if isfield(FileInfo,'TimeName')
@@ -2111,23 +2075,4 @@
                 ind_start=0;
             end
-            % complement the input if the whole time series is not defined
-            %             if size(i1_series,3)>size(XmlDataRead.Time,1)-ind_start %only the first time interval is defined, extrapolate to the whole series
-            %                 Dti_total=XmlDataRead.Time(end)-XmlDataRead.Time(1);%total time interval covered by the time vector
-            %                 missing_indices=sizDti+1+ind_start:size(i1_series,3)+1;% remaining set of frame indices for which time needs to be found
-            %                 repeat_nbre=1+floor((missing_indices-sizDti-ind_start)/(sizDti-1));% number of repetitions of Dti
-            %                 time_indices=1+mod(missing_indices-sizDti-1,sizDti-1);
-            %                 for j=1:size(XmlDataRead.Time,2)
-            %                     XmlData.Time(missing_indices,j)=XmlDataRead.Time(time_indices,j)+repeat_nbre'*Dti_total;
-            %                 end
-            %                 % update the xml file with NbDti
-            %                 t=xmltree(XmlFileName);
-            %                 uid_NbDti=find(t,'ImaDoc/Camera/BurstTiming/NbDti')
-            %                 if isempty(uid_NbDti)
-            %                     uid_BurstTiming=find(t,'ImaDoc/Camera/BurstTiming')
-            %                     [t,uid_NbDti]=add(t,uid_BurstTiming,'element','NbDti');
-            %                 end
-            %                 [t,uid_NbDti]=add(t,uid_NbDti,'chardata',num2str(repeat_nbre(end)-1));
-            %                 save(t,XmlFileName)
-            %             end
         end
         set(handles.view_xml,'BackgroundColor',[1 1 1])% paint back to white
@@ -2160,12 +2105,10 @@
 %% Define timing
 % time not set by the input file: images or civ data: indicate that time is read from the xml file
-FileType=FileInfo.FileType;
+%FileType=FileInfo.FileType;
 if isfield(XmlData,'Time')&& ~isempty(XmlData.Time) && ...
-        (strcmp(FileType,'image')|| strcmp(FileType,'multimage'))%||strcmp(FileType,'civdata')||strcmp(FileType,'civx'))
+        (strcmp(FileInfo.FileType,'image')|| strcmp(FileInfo.FileType,'multimage'))%||strcmp(FileType,'civdata')||strcmp(FileType,'civx'))
     TimeName='xml';
-elseif strcmp(FileType,'civdata')% ajouter pivdata_fluidimage
+elseif strcmp(FileInfo.FieldType,'civdata')% ajouter pivdata_fluidimage
     TimeName='civdata';
-elseif strcmp(FileType,'civx')
-    TimeName='civx';
 end
 if index==1
@@ -2260,6 +2203,6 @@
 
 %% set default options in menu 'FieldName'
-switch FileType
-    case {'civx','civdata','pivdata_fluidimage'}
+switch FileInfo.FieldType
+    case 'civdata'
         [FieldList,ColorList]=set_field_list('U','V','C');
         set(handles_Fields,'String',[{'image'};FieldList;{'get_field...'}]);%standard menu for civx data
@@ -3318,5 +3261,5 @@
 FieldName='';%default
 VelType='';%default
-if strcmp(UvData.FileInfo{1}.FieldType,'image')
+if isfield(UvData.FileInfo{1},'FieldType') && strcmp(UvData.FileInfo{1}.FieldType,'image')
     FieldName='image';
     frame_index=1;%default
@@ -3376,4 +3319,7 @@
     ParamIn.Coord_x=get(handles.Coord_x,'String');
     ParamIn.Coord_y=get(handles.Coord_y,'String');
+    if iscell(ParamIn.Coord_y)
+        ParamIn.Coord_y=ParamIn.Coord_y';
+    end
     ParamIn.Coord_z=get(handles.Coord_z,'String');
     %ParamIn.CheckCoordIndex=strcmp(get(handles.SwitchCoordIndex,'String'),'dim');
@@ -3555,6 +3501,5 @@
 %% update the display menu for the first velocity type (first menuline)
 test_veltype=0;
-if (strcmp(UvData.FileInfo{1}.FileType,'civx')||strcmp(UvData.FileInfo{1}.FileType,'civdata')||strcmp(UvData.FileInfo{1}.FileType,'pivdata_fluidimage'))...
-        && ~strcmp(FieldName,'get_field...')
+if isfield(UvData.FileInfo{1},'FieldType') && strcmp(UvData.FileInfo{1}.FieldType,'civdata')&& ~strcmp(FieldName,'get_field...')
     test_veltype=1;
     set(handles.VelType,'Visible','on')
@@ -3581,6 +3526,5 @@
 if isempty(FileName_1)
 elseif ~test_keepdata_1
-    if (strcmp(UvData.FileType{2},'civx')||strcmp(UvData.FileType{2},'civdata')||strcmp(UvData.FileInfo{1}.FileType,'pivdata_fluidimage'))...
-            && ~strcmp(FieldName_1,'get_field...')
+    if strcmp(UvData.FileInfo{2}.FieldType,'civdata')&& ~strcmp(FieldName_1,'get_field...')
         test_veltype_1=1;
         set(handles.VelType_1,'Visible','on')
@@ -4504,5 +4448,8 @@
             case '1D plot'
                 YName=GetFieldData.PanelOrdinate.ordinate;
-                FieldList={''};          
+                FieldList={''};  
+                set(handles.uvmat,'ToolBar','figure')
+                set(handles.Coord_y,'Max',2)
+                %set(huvmat,
             case 'civdata...'%reinitiate input, return to automatic civ data reading
                 display_file_name(handles,FileName,1)
