Changeset 1068


Ignore:
Timestamp:
Jul 9, 2019, 10:10:18 AM (5 years ago)
Author:
sommeria
Message:

replicate updated

Location:
trunk/src
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/browse_data.m

    r1064 r1068  
    1 %'browse_data': function for scanning directories in a campaign
     1
     2%'browse_data': function for scanning directories in a campaign
    23%------------------------------------------------------------------------
    34% function varargout = series(varargin)
     
    2425function varargout = browse_data(varargin)
    2526
    26 % Last Modified by GUIDE v2.5 17-Apr-2019 18:15:24
     27% Last Modified by GUIDE v2.5 08-Jul-2019 23:32:39
    2728
    2829% Begin initialization code - DO NOT EDIT
    2930gui_Singleton = 1;
    3031gui_State = struct('gui_Name',       mfilename, ...
    31                    'gui_Singleton',  gui_Singleton, ...
    32                    'gui_OpeningFcn', @browse_data_OpeningFcn, ...
    33                    'gui_OutputFcn',  @browse_data_OutputFcn, ...
    34                    'gui_LayoutFcn',  [] , ...
    35                    'gui_Callback',   []);
    36 if nargin && ischar(varargin{1}) && ~isempty(regexp(varargin{1},'_Callback','once'))             
     32    'gui_Singleton',  gui_Singleton, ...
     33    'gui_OpeningFcn', @browse_data_OpeningFcn, ...
     34    'gui_OutputFcn',  @browse_data_OutputFcn, ...
     35    'gui_LayoutFcn',  [] , ...
     36    'gui_Callback',   []);
     37if nargin && ischar(varargin{1}) && ~isempty(regexp(varargin{1},'_Callback','once'))
    3738    gui_State.gui_Callback = str2func(varargin{1});
    3839end
     
    7475set(hObject, 'Position', FigPos);
    7576set(hObject, 'Units', OldUnits);
    76 if exist('MultiDevices','var') && strcmp(MultiDevices,'on')
    77     set(handles.DataSeries,'Max',2)
    78 else
    79     set(handles.DataSeries,'Max',1)
    80 end
     77% if exist('MultiDevices','var') && strcmp(MultiDevices,'on')
     78%     set(handles.DataSeries,'Max',2)
     79% else
     80%     set(handles.DataSeries,'Max',1)
     81% end
    8182if exist('EnableMirror','var') && strcmp(EnableMirror,'on')
    8283    set(handles.CreateMirror,'Visible','on')
     
    9192    InputDir=pwd;% current dir is the starting data series by default
    9293end
    93 % [Experiment,DataSeries,Ext]=fileparts(DataSeries);
    94 % DataSeries=[DataSeries Ext];
    95 % [Campaign,Experiment,Ext]=fileparts(Experiment);
    96 % Experiment=[Experiment Ext];
     94
    9795[ExpWithPath,DataSeries]=fileparts(InputDir);
    98 [Campaign,Experiment,Ext]=fileparts(ExpWithPath);
    99 [tild,CampaignName]=fileparts(Campaign);
    100 RootXml=fullfile(Campaign,[CampaignName '.xml']);
     96[Experiment,Device,Ext]=fileparts(ExpWithPath);
     97Device=[Device Ext];
     98[SourceDir,Experiment,Ext]=fileparts(Experiment);
     99Experiment=[Experiment Ext];
     100% [tild,CampaignName]=fileparts(Campaign);
     101% RootXml=fullfile(Campaign,[CampaignName '.xml']);
    101102s=[];
    102 if exist(RootXml,'file')
    103     [s,Heading]=xml2struct(RootXml);%read the xml file
    104     if isfield(s,'SourceDir')
    105         set(handles.SourceDir,'String',s.SourceDir);%display the source dir if a mirror has been opened
    106         set(handles.MirrorDir,'Visible','on');%  mirror dir display
    107         set(handles.MirrorDir,'String',Campaign);%display the opened mirror dir
    108         set(handles.CreateMirror,'String','update_mirror')
    109     end
    110 end
     103% if exist(RootXml,'file')
     104%     [s,Heading]=xml2struct(RootXml);%read the xml file
     105%     if isfield(s,'SourceDir')
     106%         set(handles.SourceDir,'String',s.SourceDir);%display the source dir if a mirror has been opened
     107%         set(handles.MirrorDir,'Visible','on');%  mirror dir display
     108%         set(handles.MirrorDir,'String',Campaign);%display the opened mirror dir
     109%         set(handles.CreateMirror,'String','update_mirror')
     110%     end
     111% end
    111112if isempty(s) %a source dir has been opened
    112     set(handles.SourceDir,'String',Campaign);
     113    set(handles.SourceDir,'String',SourceDir);
    113114    set(handles.MirrorDir,'Visible','off');% no mirror dir display
    114115    set(handles.CreateMirror,'String','create_mirror')
    115116end
    116 errormsg=scan_campaign(handles,Campaign,Experiment,ExpWithPath);
     117set(handles.DataSeries,'String',{['+/' DataSeries]});
     118set(handles.ListDevices,'String',{['+/' Device]});
     119errormsg=scan_campaign(handles,SourceDir,['+/' Experiment]);
    117120if ~isempty(errormsg)
    118121    msgbox_uvmat('ERROR',errormsg)
    119122    return
    120123end
    121 % set(handles.OK,'Visible','on')
    122 % set(handles.Cancel,'Visible','on')
    123 
    124 %set(handles.browse_data,'WindowStyle','modal')% Make the GUI
    125 %modal%%%%%%%%%%%%%%%%%%%%%%%
     124
    126125set(hObject,'Visible','on')
    127 drawnow
    128 % UIWAIT makes GUI wait for user response (see UIRESUME)%%%%%%%%%%%%%%%%TO
    129 % CHECK
    130 %uiwait(handles.browse_data);
    131 
    132 
    133 
     126drawnow     
     127       
    134128%------------------------------------------------------------------------
    135129% --- Outputs from this function are returned to the command line.
     
    149143[SourcePath,ProjectName]=fileparts(SourceDir);
    150144if strcmp(get(handles.MirrorDir,'Visible'),'on')
    151     MirrorDir=get(handles.MirrorDir,'String');% name of the mirror folder
     145MirrorDir=get(handles.MirrorDir,'String');% name of the mirror folder
    152146else% create the mirror folder if it does not exist
    153     MirrorRoot=uigetfile_uvmat('select the folder which must contain the mirror directory:',SourcePath,'uigetdir');
    154     if isempty(MirrorRoot)
    155         return
    156     elseif strcmp(MirrorRoot,SourcePath)
    157         msgbox_uvmat('ERROR','The mirror folder must be different from the source')
    158         return
    159     else
    160         MirrorDir=fullfile(MirrorRoot,ProjectName);
    161     end
    162     if exist(MirrorDir,'dir')
    163         msgbox_uvmat('ERROR',['The folder ' MirrorDir ' chosen as new mirror campaign already exists'])
    164         return
    165     else
    166         [s,errormsg]=mkdir(MirrorDir)% create the mirror dir
    167         if s~=1
    168             msgbox_uvmat('ERROR',['error in creating ' MirrorDir ': ' errormsg])
    169             return
    170         end
    171     end
    172     MirrorDoc.SourceDir=SourceDir;
    173     t=struct2xml(MirrorDoc);
    174     set(t,1,'name','DataTree');
    175     save(t,fullfile(MirrorDir,[ProjectName '.xml']))% create an xml file in the mirror folder to indicate its source folder
    176     set(handles.MirrorDir,'String',MirrorDir)
    177     set(handles.MirrorDir,'Visible','on')
    178     set(handles.CreateMirror,'String','update_mirror')
     147MirrorRoot=uigetfile_uvmat('select the folder which must contain the mirror directory:',SourcePath,'uigetdir');
     148if isempty(MirrorRoot)
     149return
     150elseif strcmp(MirrorRoot,SourcePath)
     151msgbox_uvmat('ERROR','The mirror folder must be different from the source')
     152return
     153else
     154MirrorDir=fullfile(MirrorRoot,ProjectName);
     155end
     156if exist(MirrorDir,'dir')
     157msgbox_uvmat('ERROR',['The folder ' MirrorDir ' chosen as new mirror campaign already exists'])
     158return
     159else
     160[s,errormsg]=mkdir(MirrorDir)% create the mirror dir
     161if s~=1
     162msgbox_uvmat('ERROR',['error in creating ' MirrorDir ': ' errormsg])
     163return
     164end
     165end
     166MirrorDoc.SourceDir=SourceDir;
     167t=struct2xml(MirrorDoc);
     168set(t,1,'name','DataTree');
     169save(t,fullfile(MirrorDir,[ProjectName '.xml']))% create an xml file in the mirror folder to indicate its source folder
     170set(handles.MirrorDir,'String',MirrorDir)
     171set(handles.MirrorDir,'Visible','on')
     172set(handles.CreateMirror,'String','update_mirror')
    179173end
    180174ExpName={''};
     
    182176%% update the mirror from the source dir
    183177if exist(SourceDir,'dir')
    184     hdir=dir(SourceDir); %list files and dirs
    185     idir=0;
    186     for ilist=1:length(hdir)
    187         if hdir(ilist).isdir% scan all subfolders
    188             dirname=hdir(ilist).name;%
    189             if ~isequal(dirname(1),'.')&&~isequal(dirname(1),'0')%skip subfolder beginning by '0'
    190                 idir=idir+1;
    191                 mirror=fullfile(MirrorDir,hdir(ilist).name);% corresponding name in the mirror
    192                 if ~exist(mirror,'dir')
    193                    mkdir(mirror)% create the mirror folder if it does not exist
    194                 end
    195                 ExpName{idir}=['+/' hdir(ilist).name];% insert '+/' in the list to show that it is a folder
    196             end
    197             % look for the list of 'devices'
    198         else
    199             %warning for isolated files
    200         end
    201     end
    202     set(handles.ListExperiments,'String',[{'*'};ExpName'])
    203     set(handles.ListExperiments,'Value',1)
    204      update_experiments(handles,[{'*'};ExpName'],SourceDir,MirrorDir)
    205    % ListExperiments_Callback(hObject, eventdata, handles) % list the content of the experiment
    206 else
    207     msgbox_uvmat('ERROR',['The input ' SourceDir ' is not a directory'])
     178hdir=dir(SourceDir); %list files and dirs
     179idir=0;
     180for ilist=1:length(hdir)
     181if hdir(ilist).isdir% scan all subfolders
     182dirname=hdir(ilist).name;%
     183if ~isequal(dirname(1),'.')&&~isequal(dirname(1),'0')%skip subfolder beginning by '0'
     184idir=idir+1;
     185mirror=fullfile(MirrorDir,hdir(ilist).name);% corresponding name in the mirror
     186if ~exist(mirror,'dir')
     187mkdir(mirror)% create the mirror folder if it does not exist
     188end
     189ExpName{idir}=['+/' hdir(ilist).name];% insert '+/' in the list to show that it is a folder
     190end
     191% look for the list of 'devices'
     192else
     193%warning for isolated files
     194end
     195end
     196set(handles.ListExperiments,'String',[{'*'};ExpName'])
     197set(handles.ListExperiments,'Value',1)
     198update_experiments(handles,[{'*'};ExpName'],SourceDir,MirrorDir)
     199% ListExperiments_Callback(hObject, eventdata, handles) % list the content of the experiment
     200else
     201msgbox_uvmat('ERROR',['The input ' SourceDir ' is not a directory'])
    208202end
    209203set(handles.SourceDir,'BackgroundColor',[1 1 1])
     
    212206% List the experiments in a campaign, filling the menu ListExperiments
    213207%------------------------------------------------------------------------
    214 function errormsg=scan_campaign(handles,Campaign,Experiment,DataInput)
     208function errormsg=scan_campaign(handles,SourceDir,Experiment)
    215209%------------------------------------------------------------------------
    216210errormsg='';
    217 if ~isempty(regexp(Campaign,'^http'))|| exist(Campaign,'dir')
    218     ListStruct=dir_uvmat(Campaign); %list files and dirs
     211if ~isempty(regexp(SourceDir,'^http'))|| exist(SourceDir,'dir')
     212    ListStruct=dir_uvmat(SourceDir); %list files and dirs, extende to OpenDAP case
    219213    if numel(ListStruct)>1000% A campaign folder must contain maily a list of 'experiment' sub-folders
    220         errormsg=[Campaign ' contains too many items (>1000) to be a Project folder'];
     214        errormsg=[SourceDir ' contains too many items (>1000) to be a Project folder'];
    221215        return
    222216    end
     217    [ListFiles,index]=list_dir_1(SourceDir,Experiment);
     218    set(handles.ListExperiments,'String',ListFiles)
     219    set(handles.ListExperiments,'Value',index)% initialise the menu selection with the folder defined by the input
     220    ListExperiments_Callback([],[], handles)
     221else
     222    msgbox_uvmat('ERROR',['The input ' Campaign ' is not a directory'])
     223end
     224
     225%------------------------------------------------------------------------
     226% --- Executes on selection change in ListExperiments.
     227%------------------------------------------------------------------------
     228function ListExperiments_Callback(hObject, eventdata, handles)
     229
     230if strcmp(get(handles.MirrorDir,'Visible'),'on')
     231    SourceDir=get(handles.MirrorDir,'String');
     232else
     233    SourceDir=get(handles.SourceDir,'String');
     234end
     235ListExperiments=get(handles.ListExperiments,'String');
     236list_val=get(handles.ListExperiments,'Value');
     237ListExperiments=ListExperiments(list_val);%choose the selected experiments
     238ListDevices=get(handles.ListDevices,'String');% list of devices
     239list_val=get(handles.ListDevices,'Value');% currently selected devices
     240Device='';
     241if numel(ListDevices)>=list_val
     242Device=ListDevices(list_val);%choose selected devices
     243end
     244[ListFiles,indices]=list_dir_2(SourceDir,ListExperiments,Device);
     245set(handles.ListDevices,'String',ListFiles)
     246set(handles.ListDevices,'Value',indices)% initialise the menu selection with the folder defined by the input
     247ListDevices_Callback([],[], handles)
     248
     249%------------------------------------------------------------------------
     250% --- Executes on selection change in ListExperiments.
     251%------------------------------------------------------------------------
     252function ListDevices_Callback(hObject, eventdata, handles)
     253
     254ListDevices=get(handles.ListDevices,'String');% list of devices
     255list_val=get(handles.ListDevices,'Value');% currently selected devices
     256ListDevices=ListDevices(list_val);%choose selected devices
     257if strcmp(get(handles.MirrorDir,'Visible'),'on')
     258    SourceDir=get(handles.MirrorDir,'String');
     259else
     260    SourceDir=get(handles.SourceDir,'String');
     261end
     262ListExperiments=get(handles.ListExperiments,'String');
     263list_val=get(handles.ListExperiments,'Value');
     264ListExperiments=ListExperiments(list_val);%choose the selected experiments
     265
     266DataSeries=get(handles.DataSeries,'String');
     267list_val=get(handles.DataSeries,'Value');
     268if numel(DataSeries)>=list_val
     269    DataSeries=DataSeries(list_val);
     270else
     271    DataSeries=[];
     272end
     273[ListFiles,indices]=list_dir_3(SourceDir,ListExperiments,ListDevices,DataSeries);
     274set(handles.DataSeries,'String',ListFiles)
     275set(handles.DataSeries,'Value',indices)% initialise the menu selection with the folder defined by the input
     276
     277%------------------------------------------------------------------------
     278% --- List the DataSeries when a set of experiments is selected
     279%------------------------------------------------------------------------
     280% function list_dataseries(handles,ListExperiments,MirrorPath)
     281%
     282% DataSeries={};
     283% for iexp=1:numel(ListExperiments)
     284% if strcmp(ListExperiments{iexp}(1),'+')% if the item is a directory
     285% ListExperiments{iexp}(1)=[];%remove the first char '+' used to mark folders
     286% ListStruct=dir(fullfile(MirrorPath,ListExperiments{iexp})); %list files and dir in the source experiment directory
     287% ListCells=struct2cell(ListStruct);%transform dir struct to a cell arrray
     288% ListFiles=ListCells(1,:);%list of dir and file  names
     289% cell_remove=regexp(ListFiles,'^(-|\.|\+/\.)');% detect strings beginning by '-' ,'.' or '+/.'(dir beginning by . )
     290% cell_remove_tild=regexp(ListFiles,'~$');% detect tild the end of file nqme (do not list)
     291% check_keep=cellfun('isempty', cell_remove) & cellfun('isempty', cell_remove_tild);
     292% check_dir=cell2mat(ListCells(4,:));% =1 for directories, =0 for files
     293% for ilist=1:numel(ListFiles)
     294%     if check_keep(ilist)% loop on eligible DataSeries folders
     295%         mirror=fullfile(MirrorPath,ListExperiments{iexp},ListFiles{ilist});%source folder
     296%         if ~exist(mirror,'file') && ~exist(mirror,'dir')% if the name is a broken link
     297%             delete(mirror)% delete broken link
     298%         else %update the list of dataSeries
     299%             [tild,msg]=fileattrib(mirror);
     300%             if check_dir(ilist)
     301%                 ListFiles{ilist}=['+/' ListFiles{ilist}];%mark dir by '+' in the list
     302%             end
     303%             if isempty(find(strcmp(ListFiles{ilist},DataSeries), 1))% if the item is not already in DataSeries
     304%                 DataSeries=[DataSeries;ListFiles{ilist}]; %append the item to the list
     305%             end
     306%         end
     307%     end
     308% end
     309% end
     310% end
     311% if get(handles.CheckDevices,'Value')
     312% set(handles.ListDevices,'Value',1)
     313% set(handles.ListDevices,'String',sort(DataSeries))
     314% CheckDevices_Callback([],[], handles)
     315% else
     316% set(handles.DataSeries,'Value',1)
     317% set(handles.DataSeries,'String',sort(DataSeries))
     318% end
     319
     320%------------------------------------------------------------------------
     321% Provide a list to display
     322%------------------------------------------------------------------------
     323function [ListFiles,indices]=list_dir_1(SourceDir,ListSub)
     324
     325    ListStruct=dir_uvmat(SourceDir); %list files and dirs, extende to OpenDAP case
    223326    ListCells=struct2cell(ListStruct);% transform dir struct to a cell arrray
    224     ListFiles=ListCells(1,:);%list of dir and file  names
     327    ListFiles=ListCells(1,:);
    225328    check_dir=cell2mat(ListCells(4,:));% =1 for directories, =0 for files
    226329    ListFiles(check_dir)=regexprep(ListFiles(check_dir),'^.+','+/$0');% put '+/' in front of dir name display
     
    228331    check_keep=cellfun('isempty', cell_remove);
    229332    ListFiles=sort((ListFiles(check_keep))');
    230     index=find(strcmp(['+/' Experiment],ListFiles));
    231     if isempty(index), index=1; end
    232     set(handles.ListExperiments,'String',ListFiles)
    233     set(handles.ListExperiments,'Value',index)% initialise the menu selection with the folder defined by the input
    234     ListExperiments_Callback([],[], handles)
    235     DataSeries=get(handles.DataSeries,'String');
    236     index=find(strcmp(['+/' DataInput],DataSeries));
    237     if isempty(index)
    238         index=find(strcmp(['~/' DataInput],DataSeries));
     333
     334if ischar(ListSub)
     335    indices=find(strcmp(ListSub,ListFiles));
     336else
     337    indices=[];
     338    for ilist=1:numel(ListSub)
     339        index=find(strcmp(ListSub{ilist},ListFiles));
     340        indices=[indices index];
    239341    end
    240     if ~isempty(index)
    241           set(handles.DataSeries,'Value',index)
     342end
     343if isempty(indices), indices=1; end
     344
     345%------------------------------------------------------------------------
     346% Provide a list to display
     347%------------------------------------------------------------------------
     348function [ListFilesTot,indices]=list_dir_2(SourceDir,ListDir,ListSub)
     349ListFilesTot={};
     350for ilist=1:numel(ListDir)
     351    if ~isempty(regexp(ListDir{ilist},'^\+/'))
     352    ListDir{ilist}=regexprep(ListDir{ilist},'^\+/','');
     353    ListStruct=dir_uvmat(fullfile(SourceDir,ListDir{ilist})); %list files and dirs, extende to OpenDAP case
     354    ListCells=struct2cell(ListStruct);% transform dir struct to a cell arrray
     355    ListFiles=ListCells(1,:);
     356    check_dir=cell2mat(ListCells(4,:));% =1 for directories, =0 for files
     357    ListFiles(check_dir)=regexprep(ListFiles(check_dir),'^.+','+/$0');% put '+/' in front of dir name display
     358    cell_remove=regexp(ListFiles,'^(-|\.|\+/\.)');% detect strings beginning by '-' ,'.' or '+/.'(dir beginning by . )
     359    check_keep=cellfun('isempty', cell_remove);
     360    ListFilesTot=[ListFilesTot;(ListFiles(check_keep))'];
    242361    end
    243 else
    244     msgbox_uvmat('ERROR',['The input ' Campaign ' is not a directory'])
    245 end
    246 
    247 %------------------------------------------------------------------------
    248 % --- Executes on selection change in ListExperiments.
    249 %------------------------------------------------------------------------
    250  function ListExperiments_Callback(hObject, eventdata, handles)
    251 
    252 if strcmp(get(handles.MirrorDir,'Visible'),'on')
    253     MirrorPath=get(handles.MirrorDir,'String');
    254 else
    255     MirrorPath=get(handles.SourceDir,'String');
    256 end
    257 ListExperiments=get(handles.ListExperiments,'String');
    258 list_val=get(handles.ListExperiments,'Value');
    259 ListExperiments=ListExperiments(list_val);%choose selected experiments
    260 list_dataseries(handles,ListExperiments,MirrorPath)
    261 
    262 %------------------------------------------------------------------------
    263 % --- List the DataSeries when a set of experiments is selected
    264 %------------------------------------------------------------------------
    265  function list_dataseries(handles,ListExperiments,MirrorPath)
    266 
    267 DataSeries={};
    268 for iexp=1:numel(ListExperiments)
    269     if strcmp(ListExperiments{iexp}(1),'+')% if the item is a directory
    270         ListExperiments{iexp}(1)=[];%remove the first char '+' used to mark folders
    271         ListStruct=dir(fullfile(MirrorPath,ListExperiments{iexp})); %list files and dir in the source experiment directory
    272         ListCells=struct2cell(ListStruct);%transform dir struct to a cell arrray
    273         ListFiles=ListCells(1,:);%list of dir and file  names
    274         cell_remove=regexp(ListFiles,'^(-|\.|\+/\.)');% detect strings beginning by '-' ,'.' or '+/.'(dir beginning by . )
    275         cell_remove_tild=regexp(ListFiles,'~$');% detect tild the end of file nqme (do not list)
    276         check_keep=cellfun('isempty', cell_remove) & cellfun('isempty', cell_remove_tild);
    277         check_dir=cell2mat(ListCells(4,:));% =1 for directories, =0 for files
    278         for ilist=1:numel(ListFiles)
    279             if check_keep(ilist)% loop on eligible DataSeries folders
    280                 mirror=fullfile(MirrorPath,ListExperiments{iexp},ListFiles{ilist});%source folder
    281                 if ~exist(mirror,'file') && ~exist(mirror,'dir')% if the name is a broken link
    282                     delete(mirror)% delete broken link
    283                 else %update the list of dataSeries
    284                     [tild,msg]=fileattrib(mirror);
    285 %                     msg.Name=regexprep(msg.Name,'^/.','/');%remove the dot in /. at the beginning of the name
    286 %                     if ~strcmp(msg.Name,mirror)% if it is a link
    287 %                         ListFiles{ilist}=['~' ListFiles{ilist}];%mark link by '@' in the list
    288 %                     end
    289                     if check_dir(ilist)
    290                         ListFiles{ilist}=['+/' ListFiles{ilist}];%mark dir by '+' in the list
    291                     end
    292                     if isempty(find(strcmp(ListFiles{ilist},DataSeries), 1))% if the item is not already in DataSeries
    293                         DataSeries=[DataSeries;ListFiles{ilist}]; %append the item to the list
    294                     end                   
    295                 end
     362end
     363ListFilesTot=unique(ListFilesTot);
     364if ischar(ListSub)
     365    indices=find(strcmp(ListSub,ListFilesTot));
     366else
     367    indices=[];
     368    for ilist=1:numel(ListSub)
     369        index=find(strcmp(ListSub{ilist},ListFilesTot));
     370        indices=[indices index];
     371    end
     372end
     373if isempty(indices), indices=1; end
     374
     375
     376%------------------------------------------------------------------------
     377% Provide a list to display
     378%------------------------------------------------------------------------
     379function [ListFilesTot,indices]=list_dir_3(SourceDir,ListDir,ListSub,ListSubSub)
     380ListFilesTot={};
     381for ilist=1:numel(ListDir)
     382    if ~isempty(regexp(ListDir{ilist},'^\+/'))
     383        ListDir{ilist}=regexprep(ListDir{ilist},'^\+/','');
     384        for isub=1:numel(ListSub)
     385            if ~isempty(regexp(ListSub{isub},'^\+/'))
     386                ListSub{isub}=regexprep(ListSub{isub},'^\+/','');
     387                ListStruct=dir_uvmat(fullfile(SourceDir,ListDir{ilist},ListSub{isub})); %list files and dirs, extende to OpenDAP case
     388                ListCells=struct2cell(ListStruct);% transform dir struct to a cell arrray
     389                ListFiles=ListCells(1,:);
     390                check_dir=cell2mat(ListCells(4,:));% =1 for directories, =0 for files
     391                ListFiles(check_dir)=regexprep(ListFiles(check_dir),'^.+','+/$0');% put '+/' in front of dir name display
     392                cell_remove=regexp(ListFiles,'^(-|\.|\+/\.)');% detect strings beginning by '-' ,'.' or '+/.'(dir beginning by . )
     393                check_keep=cellfun('isempty', cell_remove);
     394                ListFilesTot=[ListFilesTot;(ListFiles(check_keep))'];
    296395            end
    297396        end
    298397    end
    299398end
    300 if get(handles.CheckDevices,'Value')
    301     set(handles.ListDevices,'Value',1)
    302 set(handles.ListDevices,'String',sort(DataSeries))
    303 CheckDevices_Callback([],[], handles)
    304 else
    305 set(handles.DataSeries,'Value',1)
    306 set(handles.DataSeries,'String',sort(DataSeries))
    307 end
     399ListFilesTot=unique(ListFilesTot);
     400if ischar(ListSubSub)
     401    indices=find(strcmp(ListSubSub,ListFilesTot));
     402else
     403    indices=[];
     404    for ilist=1:numel(ListSubSub)
     405        index=find(strcmp(ListSubSub{ilist},ListFilesTot));
     406        indices=[indices index];
     407    end
     408end
     409if isempty(indices), indices=1; end
     410
    308411
    309412%------------------------------------------------------------------------
    310413% --- Executes when the mirror is created or updated
    311414%------------------------------------------------------------------------
    312  function update_experiments(handles,ListExperiments,CampaignPath,MirrorPath)
     415function update_experiments(handles,ListExperiments,CampaignPath,MirrorPath)
    313416
    314417DataSeries={};
     
    344447                                if strcmp(answer,'Yes')
    345448                                    delete(mirror);
    346                                     system(['ln -s ' DataSeries ' ' mirror]); % create the link to the source folder                                 
     449                                    system(['ln -s ' DataSeries ' ' mirror]); % create the link to the source folder
    347450                                end
    348451                            end
    349452                        end
    350453                    else% create mirror to the data series if needed
    351                         system(['ln -s ' DataSeries ' ' mirror]); % create the link to the source folder                     
     454                        system(['ln -s ' DataSeries ' ' mirror]); % create the link to the source folder
    352455                    end
    353456                    if isempty(find(strcmp(ListFiles{ilist},DataSeries), 1))% if the item is not already in DataSeries
     
    367470% --- Executes on button press in CampaignDoc.
    368471function CampaignDoc_Callback(hObject, eventdata, handles)
    369 %------------------------------------------------------------------------   
     472%------------------------------------------------------------------------
    370473answer=msgbox_uvmat('INPUT_Y-N','This function will update the global xml rpresentation of the data set and the Heading of each xml file');
    371474if ~isequal(answer{1},'OK')
     
    397500    ExpName=List.Experiment{iexp}.name;
    398501    t = attributes(t,'add',uid_exp,'DirName',List.Experiment{iexp}.name);
    399    
     502
    400503    if isfield(List.Experiment{iexp},'Device')
    401504        for idevice=1:length(List.Experiment{iexp}.Device)
    402505            [t,uid_device]=add(t,uid_exp,'element','Device');
    403506            DeviceName=List.Experiment{iexp}.Device{idevice}.name;
    404             t = attributes(t,'add',uid_device,'DirName',List.Experiment{iexp}.Device{idevice}.name);       
     507            t = attributes(t,'add',uid_device,'DirName',List.Experiment{iexp}.Device{idevice}.name);
    405508            if isfield(List.Experiment{iexp}.Device{idevice},'xmlfile')
    406509                for ixml=1:length(List.Experiment{iexp}.Device{idevice}.xmlfile)
     
    413516                        [t,uid_xml]=add(t,uid_device,'element','ImaDoc');
    414517                        t = attributes(t,'add',uid_xml,'source','file');
    415                         [t]=add(t,uid_xml,'chardata',List.Experiment{iexp}.Device{idevice}.xmlfile{ixml});                   
     518                        [t]=add(t,uid_xml,'chardata',List.Experiment{iexp}.Device{idevice}.xmlfile{ixml});
    416519                    end
    417520                end
    418              elseif isfield(List.Experiment{iexp}.Device{idevice},'Record')
     521            elseif isfield(List.Experiment{iexp}.Device{idevice},'Record')
    419522                for irecord=1:length(List.Experiment{iexp}.Device{idevice}.Record)
    420523                    RecordName=List.Experiment{iexp}.Device{idevice}.Record{irecord}.name;
     
    447550
    448551
    449 %------------------------------------------------------------------------
    450 % --- Executes on button press in OK.
    451 %------------------------------------------------------------------------
    452 function OK_Callback(hObject, eventdata, handles)
    453 
    454 if strcmp(get(handles.MirrorDir,'Visible'),'on')
    455     Campaign=get(handles.MirrorDir,'String');
    456 else
    457     Campaign=get(handles.SourceDir,'String');
    458 end
    459 handles.output=[];
    460 handles.output.Campaign=Campaign;
    461 Experiment=get(handles.ListExperiments,'String');
    462 IndicesExp=get(handles.ListExperiments,'Value');
    463 if ~isequal(IndicesExp,1)% if first element ('*') selected all the experiments are selected
    464     Experiment=Experiment(IndicesExp);% use the selection of the list of experiments
    465 end
    466 Experiment=regexprep(Experiment,'^\+/','');% remove the +/ used to mark dir
    467 Device=get(handles.DataSeries,'String');
    468 Value=get(handles.DataSeries,'Value');
    469 Device=Device(Value);
    470 Device=regexprep(Device,'^\+/','');% remove the +/ used to mark dir
    471 Device=regexprep(Device,'^~','');% remove the ~ used to mark symbolic link
    472 handles.output.Experiment=Experiment;
    473 handles.output.DataSeries=Device;
    474 guidata(hObject, handles);% Update handles structure
    475 uiresume(handles.browse_data);
    476 drawnow
     552% %------------------------------------------------------------------------
     553% % --- Executes on button press in OK.
     554% %------------------------------------------------------------------------
     555% function OK_Callback(hObject, eventdata, handles)
     556%
     557% if strcmp(get(handles.MirrorDir,'Visible'),'on')
     558%     Campaign=get(handles.MirrorDir,'String');
     559% else
     560%     Campaign=get(handles.SourceDir,'String');
     561% end
     562% handles.output=[];
     563% handles.output.Campaign=Campaign;
     564% Experiment=get(handles.ListExperiments,'String');
     565% IndicesExp=get(handles.ListExperiments,'Value');
     566% if ~isequal(IndicesExp,1)% if first element ('*') selected all the experiments are selected
     567%     Experiment=Experiment(IndicesExp);% use the selection of the list of experiments
     568% end
     569% Experiment=regexprep(Experiment,'^\+/','');% remove the +/ used to mark dir
     570% Device=get(handles.DataSeries,'String');
     571% Value=get(handles.DataSeries,'Value');
     572% Device=Device(Value);
     573% Device=regexprep(Device,'^\+/','');% remove the +/ used to mark dir
     574% Device=regexprep(Device,'^~','');% remove the ~ used to mark symbolic link
     575% handles.output.Experiment=Experiment;
     576% handles.output.DataSeries=Device;
     577% guidata(hObject, handles);% Update handles structure
     578% uiresume(handles.browse_data);
     579% drawnow
    477580
    478581%------------------------------------------------------------------------
     
    491594%------------------------------------------------------------------------
    492595function closefcn(gcbo, eventdata)
    493 % if isequal(get(handles.browse_data, 'waitstatus'), 'waiting')
    494 %     % The GUI is still in UIWAIT, us UIRESUME
    495 %     handles.output = get(hObject,'String');
    496 %     guidata(hObject, handles); % Update handles structure
    497 %     uiresume(handles.browse_data);
    498 % else
    499 %     % The GUI is no longer waiting, just close it
    500 %     delete(handles.browse_data);
    501 % end
     596
    502597hseries=findobj(allchild(0),'Tag','series');
    503598if ~isempty(hseries)
     
    511606end
    512607
    513 %------------------------------------------------------------------------
    514 % --- Executes on key press over figure1 with no controls selected.
    515 %------------------------------------------------------------------------
    516 function browse_data_KeyPressFcn(hObject, eventdata, handles)
     608% %------------------------------------------------------------------------
     609% % --- Executes on key press over figure1 with no controls selected.
     610% %------------------------------------------------------------------------
     611% function browse_data_KeyPressFcn(hObject, eventdata, handles)
    517612   
    518 % Check for "enter" or "escape"
    519 if isequal(get(hObject,'CurrentKey'),'escape')
    520     % User said no by hitting escape
    521     handles.output = 'Cancel';
    522    
    523     % Update handles structure
    524     guidata(hObject, handles);
    525    
    526     uiresume(handles.browse_data);
    527 end
    528 if isequal(get(hObject,'CurrentKey'),'return')
    529     uiresume(handles.browse_data);
    530 end
     613% % Check for "enter" or "escape"
     614% if isequal(get(hObject,'CurrentKey'),'escape')
     615%     % User said no by hitting escape
     616%     handles.output = 'Cancel';
     617%    
     618%     % Update handles structure
     619%     guidata(hObject, handles);
     620%    
     621%     uiresume(handles.browse_data);
     622% end
     623% if isequal(get(hObject,'CurrentKey'),'return')
     624%     uiresume(handles.browse_data);
     625% end
    531626
    532627
    533628% --- Executes on button press in Up.
    534 function Up_Callback(hObject, eventdata, handles)
    535 SourceDir=get(handles.SourceDir,'String');
    536 browse_data(SourceDir)
    537 
    538 
    539 % --- Executes on button press in Down.
    540629function Down_Callback(hObject, eventdata, handles)
    541630SourceDir=get(handles.SourceDir,'String');
    542631ListExperiments=get(handles.ListExperiments,'String');
    543632list_val=get(handles.ListExperiments,'Value');
    544 SourceFolder=regexprep(ListExperiments{list_val(1)},'+','');
    545 set(handles.SourceDir,'String',fullfile(SourceDir,SourceFolder))
     633if ischar(ListExperiments)
     634    Exp=ListExperiments;
     635else
     636    Exp=ListExperiments{list_val(1)};
     637end
     638Exp=regexprep(Exp,'^\+/','');
     639SourceDirNew=fullfile(SourceDir,Exp);
     640set(handles.SourceDir,'String',SourceDirNew);% New SourceDir
     641ListDevices=get(handles.ListDevices,'String');
     642DeviceIndices=get(handles.ListDevices,'Value');
     643set(handles.ListExperiments,'String',ListDevices);%replace Experiments by Devices
     644set(handles.ListExperiments,'Value',DeviceIndices);%replace Experiments by Devices
    546645DataSeries=get(handles.DataSeries,'String');
    547 ValueDevice=get(handles.DataSeries,'Value');
    548 set(handles.ListExperiments,'String',DataSeries)
    549 set(handles.ListExperiments,'Value',ValueDevice)
    550 ListExperiments_Callback(hObject, [], handles)
    551 
    552 
    553 % --- Executes on selection change in DataSeries.
    554 function DataSeries_Callback(hObject, eventdata, handles)
    555 
    556 
    557 % --- Executes on button press in CheckDevices.
    558 function CheckDevices_Callback(hObject, eventdata, handles)
    559 if get(handles.CheckDevices,'Value')
    560     set(handles.ListDevices,'Visible','on')
    561     ListDevices=get(handles.DataSeries,'String');
    562     Index=get(handles.DataSeries,'Value');
    563     set(handles.ListDevices,'String',ListDevices)
    564     set(handles.ListDevices,'Value',Index)
    565     set(handles.DataSeries,'Value',1)
    566     if strcmp(get(handles.MirrorDir,'Visible'),'on')
    567     MirrorPath=get(handles.MirrorDir,'String');
    568     else
    569     MirrorPath=get(handles.SourceDir,'String');
    570     end
    571     IndexExperiment=get(handles.ListExperiments,'Value');
    572     ListExperiment=get(handles.ListExperiments,'String');
    573     Experiment=ListExperiment{get(handles.ListExperiments,'Value')};
    574     Experiment=regexprep(Experiment,'^\+/','');% remove the +/ used to mark dir
    575     Experiment=regexprep(Experiment,'^~','');% remove the ~ used to mark symbolic link
    576     Device=regexprep(ListDevices{Index},'^\+/','');% remove the +/ used to mark dir
    577     Device=regexprep(Device,'^~','');% remove the ~ used to mark symbolic link
    578     DataSeries=dir(fullfile(MirrorPath,Experiment,Device));
    579     DataSeriesCell=struct2cell(DataSeries);
    580     set(handles.DataSeries,'String',DataSeriesCell(1,:)')
    581 else
    582     ListDevices=get(handles.ListDevices,'String');
    583     Index=get(handles.ListDevices,'Value');
    584     set(handles.ListDevices,'Visible','off')
    585     set(handles.DataSeries,'String',ListDevices)
    586     set(handles.DataSeries,'Value',Index)
    587 end
     646list_val=get(handles.DataSeries,'Value');
     647set(handles.ListDevices,'String',DataSeries);%replace Devices by DataSeries
     648set(handles.ListDevices,'Value',list_val);%replace Devices by DataSeries
     649
     650[ListFiles,indices]=list_dir_3(SourceDirNew,ListDevices(DeviceIndices),DataSeries(list_val),[]);
     651set(handles.DataSeries,'String',ListFiles)
     652set(handles.DataSeries,'Value',indices)% initialise the menu selection with the folder defined by the input
     653
     654
     655% --- Executes on button press in Down.
     656function Up_Callback(hObject, eventdata, handles)
     657SourceDir=get(handles.SourceDir,'String');
     658[SourceDir,Exp]=fileparts(SourceDir);
     659set(handles.SourceDir,'String',SourceDir)
     660
     661% set(handles.ListExperiments,'Value',indices)
     662%[ListFiles,indices]=list_dir_1(SourceDir,Exp);
     663% set(handles.ListExperiments,'String',ListFiles)
     664% set(handles.ListExperiments,'Value',indices)
     665ListDevices=get(handles.ListDevices,'String');
     666DeviceIndices=get(handles.ListDevices,'Value');
     667set(handles.DataSeries,'String',ListDevices);
     668set(handles.DataSeries,'Value',DeviceIndices);
     669
     670ListExperiments=get(handles.ListExperiments,'String');
     671ExpIndices=get(handles.ListExperiments,'Value');
     672set(handles.ListDevices,'String',ListExperiments);
     673set(handles.ListDevices,'Value',ExpIndices);
     674
     675set(handles.ListExperiments,'String',{['+/' Exp]})
     676set(handles.ListExperiments,'Value',1)
     677
     678% ListExperiments=get(handles.ListExperiments,'String');
     679% list_val=get(handles.ListExperiments,'Value');
     680% SourceFolder=regexprep(ListExperiments{list_val(1)},'+','');
     681% set(handles.SourceDir,'String',fullfile(SourceDir,SourceFolder))
     682% DataSeries=get(handles.DataSeries,'String');
     683% ValueDevice=get(handles.DataSeries,'Value');
     684% set(handles.ListExperiments,'String',DataSeries)
     685% set(handles.ListExperiments,'Value',ValueDevice)
     686% ListExperiments_Callback(hObject, [], handles)
     687
     688
     689% % --- Executes on selection change in DataSeries.
     690% function DataSeries_Callback(hObject, eventdata, handles)
     691% SourceDir=get(handles.SourceDir,'String');
     692% ListData=get(handles.DataSeries,'String');
     693% Folder=ListData{get(handles.DataSeries,'Value')};
     694% if ~isempty(regexp(Folder,'^\+/'))% if a folder is selected
     695%     Folder=regexprep(Folder,'\+/','');
     696%     ListExperiments=get(handles.ListExperiments,'String');
     697%     list_val=get(handles.ListExperiments,'Value');
     698%     for iexp=1:numel(list_val)
     699%         ExpName=regexprep(ListExperiments{list_val(iexp)},'\+/','');
     700%         FullName=fullfile(SourceDir,ExpName,Folder);
     701%         dd=dir(FullName);
     702%         check_sub=1;
     703%         for idir=1:numel(dd)
     704%             ListData{ilist}=dd(ilist).name;
     705%             if dd(ilist).isdir && ~strcmp(dd(ilist).name,'.')&& ~strcmp(dd(ilist).name,'..')&& isempty(regexp(dd(ilist).name,'^_LOG'))...
     706%                     && isempty(regexp(dd(ilist).name,'^_LOG'))&& isempty(regexp(dd(ilist).name,'^_XML'))
     707%                check_sub=1;
     708%                ListData{ilist}=['+/' dd(ilist).name];
     709%             end
     710%         end
     711%         if check_sub
     712%         set(handles.ListDevices,'String',ListData);
     713%                 set(handles.ListDevices,'Visible','on');
     714%                 set(handles.DataSeries,'String',ListData)
     715%                 break
     716%         end
     717%     end
     718% end
     719
     720% % --- Executes on button press in CheckDevices.
     721% function CheckDevices_Callback(hObject, eventdata, handles)
     722% if get(handles.CheckDevices,'Value')
     723%     set(handles.ListDevices,'Visible','on')
     724%     ListDevices=get(handles.DataSeries,'String');
     725%     Index=get(handles.DataSeries,'Value');
     726%     set(handles.ListDevices,'String',ListDevices)
     727%     set(handles.ListDevices,'Value',Index)
     728%     set(handles.DataSeries,'Value',1)
     729%     if strcmp(get(handles.MirrorDir,'Visible'),'on')
     730%     MirrorPath=get(handles.MirrorDir,'String');
     731%     else
     732%     MirrorPath=get(handles.SourceDir,'String');
     733%     end
     734%     IndexExperiment=get(handles.ListExperiments,'Value');
     735%     ListExperiment=get(handles.ListExperiments,'String');
     736%     Experiment=ListExperiment{get(handles.ListExperiments,'Value')};
     737%     Experiment=regexprep(Experiment,'^\+/','');% remove the +/ used to mark dir
     738%     Experiment=regexprep(Experiment,'^~','');% remove the ~ used to mark symbolic link
     739%     Device=regexprep(ListDevices{Index},'^\+/','');% remove the +/ used to mark dir
     740%     Device=regexprep(Device,'^~','');% remove the ~ used to mark symbolic link
     741%     DataSeries=dir(fullfile(MirrorPath,Experiment,Device));
     742%     DataSeriesCell=struct2cell(DataSeries);
     743%     set(handles.DataSeries,'String',DataSeriesCell(1,:)')
     744% else
     745%     ListDevices=get(handles.ListDevices,'String');
     746%     Index=get(handles.ListDevices,'Value');
     747%     set(handles.ListDevices,'Visible','off')
     748%     set(handles.DataSeries,'String',ListDevices)
     749%     set(handles.DataSeries,'Value',Index)
     750% end
  • trunk/src/geometry_calib.m

    r1063 r1068  
    273273        hbrowse=findobj(allchild(0),'Tag','browse_data');
    274274        if ~isempty(hbrowse)% look for the GUI 'replicate'
    275             BrowseHandles=guidata(hbrowse);
    276             SourceDir=get(BrowseHandles.SourceDir,'String');
    277             ListExperiments=get(BrowseHandles.ListExperiments,'String');
    278             ListValues=get(BrowseHandles.ListExperiments,'Value');
    279             ListExperiments=ListExperiments(ListValues);
    280             DataSeries=get(BrowseHandles.DataSeries,'String');
    281             Val=get(BrowseHandles.DataSeries,'Value');
    282             DataFolder=DataSeries{Val};
    283             for ilist=1:numel(ListExperiments)
    284                 SubDirBase=regexprep(DataFolder,'+/','');
    285                 ListExperiments{ilist}=regexprep(ListExperiments{ilist},'+/','');
    286                 XmlName=fullfile(SourceDir,ListExperiments{ilist},[SubDirBase '.xml']);
     275            BrowseData=guidata(hbrowse);
     276            SourceDir=get(BrowseData.SourceDir,'String');
     277            ListExp=get(BrowseData.ListExperiments,'String');
     278            ExpIndices=get(BrowseData.ListExperiments,'Value');
     279            ListExp=ListExp(ExpIndices);
     280            ListDevices=get(BrowseData.ListDevices,'String');
     281            DeviceIndices=get(BrowseData.ListDevices,'Value');
     282            ListDevices=ListDevices(DeviceIndices);
     283            ListDataSeries=get(BrowseData.DataSeries,'String');
     284            DataSeriesIndices=get(BrowseData.DataSeries,'Value');
     285            ListDataSeries=ListDataSeries(DataSeriesIndices);
     286            NbExp=0; % counter of the number of experiments set by the GUI browse_data
     287            for iexp=1:numel(ListExp)
     288                if ~isempty(regexp(ListExp{iexp},'^\+/'))% if it is a folder
     289                    for idevice=1:numel(ListDevices)
     290                        if ~isempty(regexp(ListDevices{idevice},'^\+/'))% if it is a folder
     291                            for isubdir=1:numel(ListDataSeries)
     292                                if ~isempty(regexp(ListDataSeries{isubdir},'^\+/'))% if it is a folder
     293                                    lpath= fullfile(SourceDir,regexprep(ListExp{iexp},'^\+/',''),...
     294                                        regexprep(ListDevices{idevice},'^\+/',''));
     295                                    ldir= regexprep(ListDataSeries{isubdir},'^\+/','');
     296                                    if exist(fullfile(lpath,ldir),'dir')
     297                                        NbExp=NbExp+1;
     298                                        ListPath{NbExp}=lpath;
     299                                        ListSubdir{NbExp}=ldir;
     300                                        ExpIndex{NbExp}=iexp;
     301                                    end
     302                                end
     303                            end
     304                        end
     305                    end
     306                end
     307            end
     308            for iexp=1:NbExp
     309                XmlName=fullfile(ListPath{iexp},[ListSubdir{iexp} '.xml']);
     310                if exist(XmlName,'file')
     311                    check_update=1;
     312                else
     313                    check_update=0;
     314                end
    287315                errormsg=update_imadoc(GeometryCalib,XmlName,'GeometryCalib');% introduce the calibration data in the xml file
    288316                if ~strcmp(errormsg,'')
    289317                    msgbox_uvmat('ERROR',errormsg);
    290318                else
    291                     display([XmlName ' updated with calibration parameters'])
     319                    if check_update
     320                        display([XmlName ' updated with calibration parameters'])
     321                    else
     322                        display([XmlName ' created with calibration parameters'])
     323                    end
    292324                    nbcalib=nbcalib+1;
    293325                end
    294326            end
    295327        end
    296         msgbox_uvmat('CONFIMATION',[SubDirBase ' calibrated for ' num2str(nbcalib) ' experiments']); 
     328        msgbox_uvmat('CONFIMATION',['calibration replicated for ' num2str(NbExp) ' experiments']);
    297329    else
    298330        %% copy the xml file from the old location if appropriate, then update with the calibration parameters
  • trunk/src/plot_field.m

    r1061 r1068  
    14081408    yi=rangy(1):dxy(1):rangy(2);
    14091409    A=griddata(vec_X,vec_Y,vec_A,xi,yi');
    1410     A=reshape(A,length(yi),length(xi));
     1410    A=reshape(A,length(yi),length(xi));total
    14111411else
    14121412    x=vec_X(1:index(1));% the set of abscissa (obtained on the first line)
  • trunk/src/series.m

    r1067 r1068  
    15941594end
    15951595
    1596 %% Look for prcessing on multiple experiments set by the GUI browse_data
    1597 NbExp=1;
    1598 ListExp=Param.InputTable(1,1);
    1599 
     1596%% Look for processing on multiple experiments set by the GUI browse_data
     1597NbExp=1;% initiate the number of experiments set by the GUI browse_data, =1 otherwise
    16001598if get(handles.Replicate,'Value')
     1599    set(handles.Replicate,'BackgroundColor',[1 1 0])%paint Relicate button in yellow
    16011600    hh=findobj(allchild(0),'Tag','browse_data');
    16021601    BrowseData=guidata(hh);
    16031602    SourceDir=get(BrowseData.SourceDir,'String');
    16041603    ListExp=get(BrowseData.ListExperiments,'String');
    1605     ListExp=ListExp(get(BrowseData.ListExperiments,'Value'));
    1606     NbExp=numel(ListExp) % number of experiments set possibly by the GUI browse_data, =1 otherwise
    1607     for ilist=1:NbExp
    1608         ListExp{ilist}=regexprep(ListExp{ilist},'+','');
    1609         ListExp{ilist}= [SourceDir ListExp{ilist}];
    1610     end
    1611 end
    1612 
     1604    ExpIndices=get(BrowseData.ListExperiments,'Value');
     1605    ListExp=ListExp(ExpIndices);
     1606    ListDevices=get(BrowseData.ListDevices,'String');
     1607    DeviceIndices=get(BrowseData.ListDevices,'Value');
     1608    ListDevices=ListDevices(DeviceIndices);
     1609    ListDataSeries=get(BrowseData.DataSeries,'String');
     1610    DataSeriesIndices=get(BrowseData.DataSeries,'Value');
     1611    ListDataSeries=ListDataSeries(DataSeriesIndices);
     1612    NbExp=0; % counter of the number of experiments set by the GUI browse_data
     1613    for iexp=1:numel(ListExp)
     1614        if ~isempty(regexp(ListExp{iexp},'^\+/'))% if it is a folder
     1615            for idevice=1:numel(ListDevices)
     1616                if ~isempty(regexp(ListDevices{idevice},'^\+/'))% if it is a folder
     1617                    for isubdir=1:numel(ListDataSeries)
     1618                        if ~isempty(regexp(ListDataSeries{isubdir},'^\+/'))% if it is a folder
     1619                            lpath= fullfile(SourceDir,regexprep(ListExp{iexp},'^\+/',''),...
     1620                                regexprep(ListDevices{idevice},'^\+/',''));
     1621                            ldir= regexprep(ListDataSeries{isubdir},'^\+/','');
     1622                            if exist(fullfile(lpath,ldir),'dir')
     1623                                NbExp=NbExp+1;
     1624                                ListPath{NbExp}=lpath;
     1625                                ListSubdir{NbExp}=ldir;
     1626                                ExpIndex{NbExp}=iexp;
     1627                            end
     1628                        end
     1629                    end
     1630                end
     1631            end
     1632        end
     1633    end
     1634    answer=msgbox_uvmat('INPUT_Y-N-Cancel',['replicate the processing on ' num2str(NbExp) ' data series']);
     1635    if strcmp(answer,'Cancel')||strcmp(answer,'No')
     1636        return
     1637    end
     1638end
     1639%      set(handles.OutputSubDir,'String',SubDir)
     1640%      Param.OutputSubDir=SubDir;
    16131641%%%%%%%%%%%%%%%%%%% LOOP ON EXPERIMENTS POSSIBLY SET BY THE GUI browse_data, NbExp=1 otherwise %%%%%%%%%
    16141642for iexp=1:NbExp
    1615     Param.InputTable{1,1}=ListExp{iexp};
    1616     set(handles.InputTable,'Data',Param.InputTable)
    1617     [xx,ExpName]=fileparts(ListExp{iexp});
     1643    if get(handles.Replicate,'Value')
     1644        if ~strcmp(get(handles.RUN,'BusyAction'),'queue')% allow for STOP action
     1645            disp('program stopped by user')
     1646            return
     1647        end
     1648        set(BrowseData.ListExperiments,'Value',ExpIndex{iexp})
     1649        Param.InputTable{1,1}=ListPath{iexp};
     1650        Param.InputTable{1,2}=ListSubdir{iexp};
     1651        Param.OutputSubDir=ListSubdir{iexp};
     1652        set(handles.InputTable,'Data',Param.InputTable)
     1653%         set(handles.OutputSubDir,'String',ListSubdir{iexp})
     1654    end
     1655    [xx,ExpName]=fileparts(Param.InputTable{1,1});
    16181656    Param.IndexRange.first_i=str2num(get(handles.num_first_i,'String'));%reset the firrst_i and last_i for multiple experiments, modified by the splitting into NbProcess
    16191657    Param.IndexRange.last_i=str2num(get(handles.num_last_i,'String'));
     
    16211659    OutputDir='';
    16221660    answer='';
    1623     if isfield(Param,'OutputSubDir')
     1661    if isfield(Param,'OutputSubDir')% possibly update the output dir if it already exists
    16241662        SubDirOut=[get(handles.OutputSubDir,'String') Param.OutputDirExt];
    16251663        SubDirOutNew=SubDirOut;
     
    16591697        Param.OutputRootFile=Param.InputTable{1,3}; % the first sorted RootFile taken for output
    16601698        set(handles.OutputDirExt,'String',Param.OutputDirExt)
    1661         OutputDir=fullfile(Param.InputTable{1,1},[Param.OutputSubDir Param.OutputDirExt]); % full name (with path) of output directory
     1699        OutputDir=fullfile(Param.InputTable{1,1},[Param.OutputSubDir Param.OutputDirExt]) % full name (with path) of output directory
    16621700        if check_create    % create output directory if it does not exist
    16631701            [tild,msg1]=mkdir(OutputDir);
     
    16771715            errormsg=['cannot create ' DirXml ': ' msg1]; % error message for directory creation
    16781716            return
     1717        end
     1718        [success,msg] = fileattrib(DirXml,'+w','g','s'); % allow writing access for the group of users, recursively in the folder
     1719        if success==0
     1720            msgbox_uvmat('WARNING',{['unable to set group write access to ' DirXml ':']; msg}); % error message for directory creation
    16791721        end
    16801722    end
     
    18611903                return
    18621904            end
     1905            [success,msg] = fileattrib(DirExe,'+w','g','s'); % allow writing access for the group of users, recursively in the folder
     1906            if success==0
     1907                msgbox_uvmat('WARNING',{['unable to set group write access to ' DirExe ':']; msg}); % error message for directory creation
     1908            end
    18631909        end
    18641910        %create subdirectory for log files
     
    18691915                errormsg=['cannot create ' DirLog ': ' msg1]; % error message for directory creation
    18701916                return
     1917            end
     1918            [success,msg] = fileattrib(DirLog,'+w','g','s'); % allow writing access for the group of users, recursively in the folder
     1919            if success==0
     1920                msgbox_uvmat('WARNING',{['unable to set group write access to ' DirLog ':']; msg}); % error message for directory creation
    18711921            end
    18721922        end
     
    20242074            fclose(fid);
    20252075            if status==0
    2026             msgbox_uvmat('CONFIRMATION',[ActionFullName ' launched for ' ExpName ' as ' num2str(NbProcess) ' processes in cluster: press STATUS to see results'])
     2076                msgbox_uvmat('CONFIRMATION',[ActionFullName ' launched for ' ExpName ' as ' num2str(NbProcess) ' processes in cluster: press STATUS to see results'])
    20272077            else
    2028                msgbox_uvmat('ERROR',result)
     2078                msgbox_uvmat('ERROR',result)
    20292079            end
    20302080            %     case 'cluster_pbs' % for LMFA Kepler machine:  trqnsferred to fct
     
    21442194    end
    21452195end
     2196set(handles.Replicate,'BackgroundColor',[0 1 0])
     2197if NbExp>1
     2198    set(handles.REFRESH,'BackgroundColor',[1 0 1])% set REFRESH button to magenta (input file features need to be updated)
     2199end
    21462200%------------------------------------------------------------------------
    21472201function STOP_Callback(hObject, eventdata, handles)
     
    21602214Param=read_GUI(handles.series);
    21612215
    2162 %% clean the output structure by removing unused information 
     2216%% clean the output structure by removing unused information
    21632217if isfield(Param,'Pairs')
    21642218    Param=rmfield(Param,'Pairs'); % info Pairs not needed for output
     
    22032257ActionList=get(handles.ActionName,'String'); % list menu fields
    22042258ActionIndex=get(handles.ActionName,'Value');
    2205 if ~isequal(ActionIndex,1)% if we are not just opening series 
     2259if ~isequal(ActionIndex,1)% if we are not just opening series
    22062260    InputTable=get(handles.InputTable,'Data');
    22072261    if isempty(InputTable{1,4})
     
    23012355
    23022356set(handles.ActionInput,'BackgroundColor',[1 1 0])
     2357SeriesData=get(handles.series,'UserData'); % info on the input file series
    23032358
    23042359%% create the function handle for Action
     
    23082363if ~exist(ActionPath,'dir')
    23092364    ActionName_Callback(handles.ActionName, ActionPath, handles)% update the function
    2310 %     msgbox_uvmat('ERROR',['The prescribed function path ' ActionPath ' does not exist']);
    23112365    return
    23122366end
     
    23192373Param=read_GUI_series(handles); % read the parameters from the GUI series
    23202374Param.Action.RUN=0;
     2375Param.SeriesData=SeriesData;
    23212376ParamOut=h_fun(Param); % run the selected Action function to get the relevant input
    23222377
     
    23372392
    23382393%% Detect the types of input files and set menus and default options in 'VelType'
    2339 SeriesData=get(handles.series,'UserData'); % info on the input file series
    23402394iview_civ=find(strcmp('civx',SeriesData.FileType)|strcmp('civdata',SeriesData.FileType));
    23412395iview_netcdf=find(strcmp('netcdf',SeriesData.FileType)|strcmp('civx',SeriesData.FileType)|strcmp('civdata',SeriesData.FileType)); % all nc files, icluding civ
     
    24692523    set(handles.MinIndex_j,'Data',MinIndex_j(iview,:));
    24702524    set(handles.MaxIndex_i,'Data',MaxIndex_i(iview,:));
    2471     set(handles.MaxIndex_j,'Data',MaxIndex_j(iview,:));
     2525    set(handles.MaxIndex_j,'Data',MaxIndex_j(iview,:));;
    24722526    TimeTable=get(handles.TimeTable,'Data');
    2473     set(handles.TimeTable,'Data',TimeTable(iview,:));
     2527    if size(TimeTable,1)<size(Param.InputTable,1)%if the time table is not complete, copy the missing lines from the previous ones
     2528        for iline=size(TimeTable,1)+1:size(Param.InputTable,1)
     2529            TimeTable(iline,:)=TimeTable(iline-1,:);
     2530        end
     2531    end
     2532    set(handles.TimeTable,'Data',TimeTable(iview,:));% sort the time tables
    24742533    PairString=get(handles.PairString,'Data');
    24752534    set(handles.PairString,'Data',PairString(iview,:));
  • trunk/src/series/civ_series.m

    r1065 r1068  
    8989    end
    9090    % estimated CPUTime
    91 Data.CPUTime=1; % 1 minute per field pair
     91    CPUtime_unit=0.01;%estimated time for a multiplication (in microsecond)
     92    if isfield(Param.SeriesData,'FileInfo')&&isfield(Param.SeriesData.FileInfo{1},'Height')&&isfield(Param.SeriesData.FileInfo{1},'Width')
     93        pixnbre=Param.SeriesData.FileInfo{1}.Height*Param.SeriesData.FileInfo{1}.Width; % total number of pxels for input images 
     94        CPUtime=0;
     95        if isfield(Data.ActionInput,'Civ1')
     96            %BoxSize=Data.ActionInput.Civ1.CorrBoxSize(1)*Data.ActionInput.Civ1.CorrBoxSize(2);
     97            tic
     98            testboxa=rand(Data.ActionInput.Civ1.CorrBoxSize(1),Data.ActionInput.Civ1.CorrBoxSize(2));
     99            testboxb=rand(Data.ActionInput.Civ1.SearchBoxSize(1),Data.ActionInput.Civ1.SearchBoxSize(2));
     100            anss=conv2(testboxa,testboxb);
     101            CPUtime_unit=toc;
     102            nb_box=pixnbre/(Data.ActionInput.Civ1.Dx*Data.ActionInput.Civ1.Dy);   
     103            %nbpos=Data.ActionInput.Civ1.SearchBoxSize-Data.ActionInput.Civ1.CorrBoxSize;
     104            CPUtime=2*CPUtime_unit*nb_box%*BoxSize*nbpos(1)*nbpos(2);% adjustement factor 2 used
     105        end
     106        if isfield(Data.ActionInput,'Patch1')
     107            CPUtime=2*CPUtime;
     108        end
     109        if isfield(Data.ActionInput,'Civ2')
     110            tic
     111            testboxa=rand(Data.ActionInput.Civ2.CorrBoxSize(1),Data.ActionInput.Civ2.CorrBoxSize(2));
     112            testboxb=rand(Data.ActionInput.Civ2.SearchBoxSize(1),Data.ActionInput.Civ2.SearchBoxSize(2));
     113            anss=conv2(testboxa,testboxb);
     114            CPUtime_unit=toc;
     115            nb_box=pixnbre/(Data.ActionInput.Civ2.Dx*Data.ActionInput.Civ2.Dy);
     116            %BoxSize=Data.ActionInput.Civ2.CorrBoxSize(1)*Data.ActionInput.Civ2.CorrBoxSize(2);
     117            %nbpos=Data.ActionInput.Civ2.SearchBoxSize-Data.ActionInput.Civ2.CorrBoxSize;
     118            CPUtime=CPUtime+2*CPUtime_unit*nb_box;%*BoxSize*nbpos(1)*nbpos(2);
     119        end
     120        if isfield(Data.ActionInput,'Patch2')
     121            CPUtime=(4/3)*CPUtime;
     122        end
     123        Data.CPUTime=ceil(CPUtime/6); % estimated CPU time per field pair in minute
     124        Data.CPUTime=Data.CPUTime/10; % displqy CPU time with 1 digit beyond dot
     125    end
    92126    return
    93127end
  • trunk/src/series/extract_multitif.m

    r1061 r1068  
    7373    ParamOut.OutputDirExt='.png';%set the output dir extension
    7474    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
    75       ParamOut.CheckOverwriteVisible='on'; % manage the overwrite of existing files (default=1)
     75    ParamOut.CheckOverwriteVisible='on'; % manage the overwrite of existing files (default=1)
     76    ParamOut.CPUTime=7;% expected time for writting one image ( in minute)
    7677    %% root input file(s) and type
    7778    % check the existence of the first file in the series
     
    113114end
    114115
    115 %% list of input images
    116 % DirImages=fullfile(Param.InputTable{1,1},Param.InputTable{1,2});
    117 % ListStruct=dir(DirImages);
    118 % ListCells=struct2cell(ListStruct);% transform dir struct to a cell arrray
    119 % check_bad=strcmp('.',ListCells(1,:))|strcmp('..',ListCells(1,:));%detect the dir '.' to exclude it
    120 % check_dir=cell2mat(ListCells(4,:));% =1 for directories, =0 for files
    121 % ListFile=ListCells(1,find(~check_dir & ~check_bad));
    122 
    123 %% check file names
    124 % RootName=regexprep(ListFile{1},'.tif$','')
    125 % rank(1)=1;
    126 % for ilist=2:numel(ListFile)
    127 %     rank_str=regexprep(ListFile{ilist},'.tif$','');
    128 %     rank(ilist)=regexprep(rank_str,['^' RootName '@'],'');
    129 % %     if ~isequal(str2num(rank),ilist-1)
    130 % %         disp(['error in the list of input file # ' num2str(ilist-1)])
    131 % %         return
    132 % %     end
    133 % end
    134 
    135116%% output directory
    136117OutputDir=fullfile(Param.InputTable{1,1},[Param.OutputSubDir Param.OutputDirExt]);
     
    156137end
    157138
    158 %% Main loop
    159 
    160 
    161 % count=0;
    162 %count=316;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%CORRECTION EXP08: 4684 images -> start at 316 start 67->_11_1
    163 %count=1934%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%CORRECTION EXP07: 3066 images
    164139%% loop on the files
    165140% include the first tiff file with no index in the first iteration
     
    174149end
    175150for ifile=firstindex:Param.IndexRange.last_i
     151    tic
    176152    if firstindex==0 && ifile==0% first slice of processing
    177153        ImageName=fullfile(Param.InputTable{1,1},Param.InputTable{1,2},'im.tif')
     
    181157    NbFrames=numel(imfinfo(ImageName));
    182158    for iframe=1:NbFrames
    183         iframe
    184159        if isequal(ImagesPerLevel,1)% mode series
    185160            OutputFile=fullfile(OutputDir,['img_' num2str(count+1) '.png']);
     
    198173        count=count+1;
    199174    end
     175    tt=toc;
     176    disp(['elapsed time (in min.) for the file im@' num2str(ifile,'%04d')])
     177    disp(num2str(tt/60))
    200178end
    201179
  • trunk/src/series/extract_rdvision.m

    r1066 r1068  
    489489
    490490%% correct NbDtj and NbDti (error from RDvision)
    491 if NbDtj==numel(Dtj)% case of bursts
    492     NbDtj=1;
    493     uid_motor_nbslice=find(t,'ImaDoc/TranslationMotor/Nbslice');
    494     if ~isempty(uid_motor_nbslice)&& ~isempty(uid_Dtk)% case of multilevel
    495         NbSlice=str2num(get(t,get(t,uid_motor_nbslice,'contents'),'value'));
    496         NbDti=NbSlice-1;
    497     end
    498 end
     491% if NbDtj==numel(Dtj)% case of bursts
     492%     NbDtj=1;
     493%     uid_motor_nbslice=find(t,'ImaDoc/TranslationMotor/Nbslice');
     494%     if ~isempty(uid_motor_nbslice)&& ~isempty(uid_Dtk)% case of multilevel
     495%         NbSlice=str2num(get(t,get(t,uid_motor_nbslice,'contents'),'value'));
     496%         NbDti=NbSlice-1;
     497%     end
     498% end
    499499
    500500if isempty(Dtj)% case of simple series
     
    509509    nbfield2=NbDtj*numel(Dtj)+1;
    510510    NbFrames_xml=nbfield1*nbfield2;
    511    if NbFrames_xml<numel(timestamp)
    512        disp(['ERROR: size from xml ' num2str(NbFrame_xml) ' smaller than timestamp size ' num2str(numel(timestamp))])
    513        return
    514    end
    515    if NbFrames_xml>numel(timestamp)
    516        nbfield1=floor(numel(timestamp)/nbfield2);
    517        nbfieldk=floor(nbfield1/nbfieldi);
    518        nbfield1=nbfieldi*nbfieldk;
    519        NbDtk=nbfieldk-1;
    520        t=set(t,uid_content_NbDtk,'value',num2str(NbDtk));% correct NbDtk in the xml file (in practice numel(Dtk)=1;
    521        timestamp=timestamp(1:nbfield1*nbfield2);
    522        disp(['image record stopped before end: max index i= ' num2str(nbfield1)]);
    523        timestamp=reshape(timestamp,nbfield2,nbfield1);
    524    end
    525    % check Dtj with respect to timestamp
    526     timestamp=(reshape(timestamp,nbfield2,[]))';
    527     diff_Dtj=diff(timestamp(1,:))-Dtj;
    528     if max(abs(diff_Dtj))>min(Dtj)/1000
    529         disp(['Dtj from xml file differs from time stamp by ' num2str(max(abs(diff_Dtj))) ', '])%'
    530     else
    531         disp('Dtj OK');
    532     end
     511%    if NbFrames_xml<numel(timestamp)
     512%        disp(['ERROR: size from xml ' num2str(NbFrame_xml) ' smaller than timestamp size ' num2str(numel(timestamp))])
     513%        return
     514%    end
     515%    if NbFrames_xml>numel(timestamp)
     516%        nbfield1=floor(numel(timestamp)/nbfield2);
     517%        nbfieldk=floor(nbfield1/nbfieldi);
     518%        nbfield1=nbfieldi*nbfieldk;
     519%        NbDtk=nbfieldk-1;
     520%        t=set(t,uid_content_NbDtk,'value',num2str(NbDtk));% correct NbDtk in the xml file (in practice numel(Dtk)=1;
     521%        timestamp=timestamp(1:nbfield1*nbfield2);
     522%        disp(['image record stopped before end: max index i= ' num2str(nbfield1)]);
     523%        timestamp=reshape(timestamp,nbfield2,nbfield1);
     524%    end
     525%    % check Dtj with respect to timestamp
     526%     timestamp=(reshape(timestamp,nbfield2,[]))';
     527%     diff_Dtj=diff(timestamp(1,:))-Dtj;
     528%     if max(abs(diff_Dtj))>min(Dtj)/1000
     529%         disp(['Dtj from xml file differs from time stamp by ' num2str(max(abs(diff_Dtj))) ', '])%'
     530%     else
     531%         disp('Dtj OK');
     532%     end
    533533end
    534534
    535535%% adjust Dti
    536 if NbDti+1>size(timestamp,1)
    537     NbDti=size(timestamp,1)-1;
    538 end
    539 Dti_stamp=(timestamp(1+NbDti,1)-timestamp(1,1))/NbDti;
    540 Dti_stamp=(timestamp(1+NbDti,1)-timestamp(2,1))/(NbDti-1);
    541 t=set(t,uid_content_Dti,'value',num2str(Dti_stamp));%corret Dti
    542 if abs(Dti_stamp-Dti)>Dti/1000
    543     disp([msg 'Dti from xml file corrected by ' num2str(Dti_stamp-Dti) ', ']);%'
    544 else
    545     disp('Dti OK')
    546 end
     536% if NbDti+1>size(timestamp,1)
     537%     NbDti=size(timestamp,1)-1;
     538% end
     539% Dti_stamp=(timestamp(1+NbDti,1)-timestamp(1,1))/NbDti;
     540% Dti_stamp=(timestamp(1+NbDti,1)-timestamp(2,1))/(NbDti-1);
     541% t=set(t,uid_content_Dti,'value',num2str(Dti_stamp));%corret Dti
     542% if abs(Dti_stamp-Dti)>Dti/1000
     543%     disp([msg 'Dti from xml file corrected by ' num2str(Dti_stamp-Dti) ', ']);%'
     544% else
     545%     disp('Dti OK')
     546% end
    547547
    548548%% adjust Dtk
  • trunk/src/series/merge_proj_polar.m

    r1061 r1068  
    6363    ParamOut.AllowInputSort='on';% allow alphabetic sorting of the list of input file SubDir (options 'off'/'on', 'off' by default)
    6464    ParamOut.WholeIndexRange='off';% prescribes the file index ranges from min to max (options 'off'/'on', 'off' by default)
    65     ParamOut.NbSlice='on'; %nbre of slices ('off' by default)
     65    ParamOut.NbSlice='off'; %nbre of slices ('off' by default)
    6666    ParamOut.VelType='one';% menu for selecting the velocity type (options 'off'/'one'/'two',  'off' by default)
    6767    ParamOut.FieldName='off';% menu for selecting the field (s) in the input file(options 'off'/'one'/'two', 'off' by default)
     
    268268    CheckOverwrite=Param.CheckOverwrite;
    269269end
    270 
     270NbField
    271271for index=1:NbField
    272     disp(['index=' num2str(index)])
    273     disp(['ellapsed time ' num2str(toc(tstart)/60,4) ' minutes'])
    274272    update_waitbar(WaitbarHandle,index/NbField)
    275273    if ~isempty(RUNHandle) && ~strcmp(get(RUNHandle,'BusyAction'),'queue')
     
    352350        %% calculate tps coefficients
    353351        Data{iview}=tps_coeff_field(Data{iview},1);
    354        
     352        'tps_coeff done'
    355353        %% projection on the polar grid
    356354        [DataOut,VarAttribute,errormsg]=calc_field_tps(Data{iview}.Coord_tps,Data{iview}.NbCentre,Data{iview}.SubRange,...
    357355            cat(3,Data{iview}.U_tps,Data{iview}.V_tps),FieldNames,cat(3,XI,YI));
     356        if ~isempty(errormsg)
     357            disp(errormsg)
     358        end
     359       
    358360        % set to NaN interpolation points which are too far from any initial data (more than 2 CoordMesh)
    359361        Coord=permute(Data{iview}.Coord_tps,[1 3 2]);
     
    366368            G=TriScatteredInterp(Coord,Coord(:,2),'nearest');
    367369        end
     370        'Interp done'
    368371        Distx=F(XI,YI)-XI;% diff of x coordinates with the nearest measurement point
    369372        Disty=G(XI,YI)-YI;% diff of y coordinates with the nearest measurement point
     
    390393   
    391394    %% merge the NbView fields
     395    ProjData
    392396    [MergeData,errormsg]=merge_field(ProjData);
    393397    if ~isempty(errormsg)
     
    446450       TimeData.div=MergeData.div;
    447451
    448             [error,ncid]=struct2nc(OutputFile,TimeData);%save result file
     452            error=struct2nc(OutputFile,TimeData);%save result file
    449453        if isempty(error)
    450454            disp(['output file ' OutputFile ' written'])
     
    453457        end
    454458            ellapsed_time=toc(tstart);
    455     disp(['total ellapsed time ' num2str(ellapsed_time/60,2) ' minutes'])
    456 end
    457 
    458 ellapsed_time=toc(tstart);
    459 disp(['total ellapsed time ' num2str(ellapsed_time/60,2) ' minutes'])
     459    disp(['ellapsed time since start ' num2str(ellapsed_time/60,2) ' minutes'])
     460end
     461
    460462disp([ num2str(ellapsed_time/(60*NbField),3) ' minutes per iteration'])
    461463
  • trunk/src/uvmat.m

    r1065 r1068  
    254254
    255255%% case of an input argument for uvmat
    256 testinputfield=0;
     256%testinputfield=0;
    257257inputfile=[];
    258 Field=[];
     258%Field=[];
    259259if exist('input','var')
    260260    if ishandle(handles.UVMAT_title)
     
    790790%aviobj=avifile(MovieName,'Compression','None','fps',fps);
    791791
    792 aviobj = VideoWriter(MovieName,'Uncompressed AVI');
     792aviobj = VideoWriter(MovieName,'Motion JPEG AVI');
    793793open(aviobj)
    794794%% get info from uvmat and adjust it
     
    812812            set(htitle,'String',regexprep(Title,'t=\d+.\d*',['t=' time_str]))
    813813            mov=getframe(figure_movie);
    814            % aviobj=addframe(aviobj,mov);
    815814            writeVideo(aviobj,mov);
    816815    end
Note: See TracChangeset for help on using the changeset viewer.