Changeset 1136


Ignore:
Timestamp:
Apr 24, 2024, 11:35:22 AM (6 months ago)
Author:
augier3pi
Message:

Fix launching fluidimage

Location:
trunk/src
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/command_launch_python.m

    r1135 r1136  
    1 %'command_launch_python': creates the command strings for opening a programme in python with a Linux system('GLNX86','GLNXA64','MACI64')
     1%'command_launch_python': creates the command string for launching fluidimage
    22%------------------------------------------------------------------------
    3 % function cmd=command_launch_matlab(filelog,ActionPath,ActionName,inputxml)
     3% function cmd=command_launch_python(inputxml)
    44%
    55%OUTPUT
    6 % cmd=set of system commands (char string) to write
    7                            
     6% cmd=set of system commands (char string) to write
    87%
    98%INPUT:
    10 % filelog: name (char string)  of the file to collect the output in the Matlab command window
    11 % ActionPath:  path to the  programme to launch
    12 % ActionName: name of the programme to launch
    13 % inputxml: full name, including path, of the xml input parameter file for the programme ActionName
    14 % option: ='bacground' or 'cluster' depending on the launching option
     9% inputxml: path of the xml input parameter file for the program fluidimage
     10% option: = 'background' or 'cluster' depending on the launching option
    1511
    16 function cmd=command_launch_python(filelog,ActionPath,ActionName,inputxml)
    17  cmd = ['LD_LIBRARY_PATH=$(echo $LD_LIBRARY_PATH | pyp "l = x.split('':'');...' ...
    18      ' l = [s for s in l if ''matlab'' not in s]; print('':''.join(l))") ' ...
    19                 'python -m ' ActionName ' ' inputxml];
    20 
    21 % Matlab case:
    22  % ThreadOption='';
    23 % if strcmp(option,'cluster')
    24 %     ThreadOption='-singleCompThread';
    25 %     inputxml={inputxml};% single input parameter file
    26 % end
    27 % matlab_ver = ver('MATLAB');
    28 % matlab_version = matlab_ver.Version;
    29 % cmd=[...
    30 %     '#!/bin/bash\n'...
    31 %     'source /etc/profile\n'...
    32 %     'module purge\n'...
    33 %     'module load matlab/' matlab_version '\n'...% CHOICE OF THE SAME MATLAB VERSION AS THE CURRENT MATLAB SESSION (not mandatory)
    34 %     'time_start=$(date +%%s)\n'...
    35 %     'matlab -nodisplay -nosplash -nojvm ''' ThreadOption ''' -logfile ''' filelog ''' <<END_MATLAB\n'...%launch the new Matlab session  without display
    36 %     'addpath(''' path_uvmat ''');\n'...
    37 %     'addpath(''' ActionPath ''');\n'];
    38 % for iprocess=1:numel(inputxml)
    39 %     cmd=[cmd '' ActionName  '(''' inputxml{iprocess} ''');\n'];
    40 % end
    41 % cmd=[cmd  'exit\n' 'END_MATLAB\n'];
    42 %     if strcmp(option,'background')
    43 %     cmd=[cmd ...
    44 %     'time_end=$(date +%%s)\n'...
    45 %     'echo "global time = " $(($time_end - $time_start)) >> ''' filelog '''\n'];
    46 %     end
    47 %
    48 % %% case cluster:
    49 % % matlab_ver = ver('MATLAB');
    50 % %                     matlab_version = matlab_ver.Version;
    51 % %                     cmd=[...
    52 % %                         '#!/bin/bash\n'...
    53 % %                         'source /etc/profile\n'...
    54 % %                         'module purge\n'...
    55 % %                         'module load matlab/' matlab_version '\n'...% CHOICE OF CURRENT MATLAB VERSION
    56 % %                         'matlab -nodisplay -nosplash -nojvm -singleCompThread -logfile ''' filelog{iprocess} ''' <<END_MATLAB\n'...% open a new Matlab session without display
    57 % %                         'addpath(''' path_series ''');\n'...
    58 % %                         'addpath(''' ActionPath ''');\n'...
    59 % %                         '' ActionName  '(''' filexml{iprocess} ''');\n'...% launch the Matlab function selected by the GUI 'series'
    60 % %                         'exit\n'...
    61 % %                         'END_MATLAB\n'];
    62 % %                 end
    63 
    64 
     12function cmd=command_launch_python(inputxml)
     13    cmd = ['python -m fluidimage.run_from_xml ' inputxml];
     14end
  • trunk/src/series.m

    r1135 r1136  
    1 %'series': master function associated to the GUI series.m for analysis field series 
     1%'series': master function associated to the GUI series.m for analysis field series
    22%------------------------------------------------------------------------
    33% function varargout = series(varargin)
     
    3535%------------------------------------------------------------------------
    3636%------------------------------------------------------------------------
    37 %  I - MAIN FUNCTION series 
     37%  I - MAIN FUNCTION series
    3838%------------------------------------------------------------------------
    3939%------------------------------------------------------------------------
     
    130130if ~exist('Param','var')
    131131    Param=[]; % default
    132 end 
     132end
    133133
    134134%% Read the parameter file series.xml, or created from series.xml.default if it does not exist
     
    145145        delete(xmlfile);
    146146        [success,message]=copyfile(fullfile(path_series,'series.xml.default'),xmlfile);
    147     end 
     147    end
    148148    SeriesData.SeriesParam=xml2struct(xmlfile);
    149149end
     
    158158% % command = ['LD_LIBRARY_PATH=$(echo $LD_LIBRARY_PATH | pyp "l = x.split('':''); l = [s for s in l if ''matlab'' not in s]; print('':''.join(l))") ' ...
    159159% %             'python -c "import fluidimage"'];
    160 % % [code, ~] = system(command); 
     160% % [code, ~] = system(command);
    161161% % if code==0
    162162    ActionExtList={'.m';'.sh';'.py (in dev.)'}; % default choice of extensions (Matlab fct .m or compiled version .sh
     
    185185SeriesData.TransformPath=path_transform_fct;% store the standard path for trqnsform functions (needed for compilation)
    186186
    187 %% get the user defined functions stored in the personal file uvmat_perso.mat 
     187%% get the user defined functions stored in the personal file uvmat_perso.mat
    188188dir_perso=prefdir;
    189189profil_perso=fullfile(dir_perso,'uvmat_perso.mat');
     
    248248set(handles.TransformName,'Value',TransformIndex)
    249249set(handles.TransformPath,'String',TransformPathList{TransformIndex})
    250    
     250
    251251%% fields input initialisation
    252252if isfield(Param,'list_fields')&& isfield(Param,'index_fields') &&~isempty(Param.list_fields) &&~isempty(Param.index_fields)
     
    269269set(handles.series,'UserData',SeriesData)% initiate Userdata
    270270if isfield(Param,'InputFile')
    271    
     271
    272272    %% fill the list of input file series
    273273    InputTable=[{Param.InputFile.RootPath},{Param.InputFile.SubDir},{Param.InputFile.RootFile},{Param.InputFile.NomType},{Param.InputFile.FileExt}];
     
    282282    end
    283283    set(handles.InputTable,'Data',InputTable)
    284    
    285     %% define the default path for the output files 
     284
     285    %% define the default path for the output files
    286286    [InputPath,Device,DeviceExt]=fileparts(InputTable{1,1});
    287287    [InputPath,Experiment,ExperimentExt]=fileparts(InputPath);
     
    302302    end
    303303    end
    304    
     304
    305305    %% determine the selected reference field indices for pair display
    306    
     306
    307307    [tild,tild,tild,i1,i2,j1,j2]=fileparts_uvmat(Param.InputFile.FileIndex);
    308308    if isempty(i1)
     
    333333    %% enable field and veltype menus, in accordance with the current action
    334334    ActionName_Callback([],[], handles)
    335    
     335
    336336    %% set length of waitbar
    337337    displ_time(handles)
    338    
     338
    339339else
    340340    set(handles.REFRESH,'BackgroundColor',[1 0 1])% set REFRESH button to magenta color to indicate that input refresh is needed
     
    384384% automatically sets the global properties when the rootfile name is introduced
    385385% then activate the view-field actionname if selected
    386 % it is activated either by clicking on the RootPath window or by the 
    387 % browser 
     386% it is activated either by clicking on the RootPath window or by the
     387% browser
    388388%------------------------------------------------------------------------
    389389%------------------------------------------------------------------------
    390390% --- fct activated by the browser under 'Open'
    391 %------------------------------------------------------------------------ 
     391%------------------------------------------------------------------------
    392392function MenuBrowse_Callback(hObject, eventdata, handles)
    393393%% look for the previously opened file 'oldfile'
     
    481481%------------------------------------------------------------------------
    482482% --- fct activated by the browser under 'Open campaign/Browse...'
    483 %------------------------------------------------------------------------ 
     483%------------------------------------------------------------------------
    484484function MenuBrowseCampaign_Callback(hObject, eventdata, handles)
    485485
     
    539539% --------------------------------------------------------------------
    540540% function MenuCampaign_Callback(hObject, eventdata, handles)
    541 % % -------------------------------------------------------------------- 
    542 % 
     541% % --------------------------------------------------------------------
     542%
    543543% OutPut=browse_data(get(hObject,'Label'),'on','on'); % open the GUI browse_data to get select a campaign dir, experiment and device
    544544% if ~isfield(OutPut,'Campaign')
     
    704704%         'append': add a new line to the input table
    705705function errormsg=display_file_name(handles,Param,iview)
    706  
     706
    707707set(handles.REFRESH,'BackgroundColor',[1 1 0])% set REFRESH  button to yellow color (indicate activation)
    708708drawnow
    709709errormsg=''; % default
    710710if ischar(Param)
    711     fileinput=Param; 
     711    fileinput=Param;
    712712else% input set when series is opened (called by the GUI uvmat)
    713713    fileinput=Param.FileName;
    714714end
    715    
     715
    716716%% get the input root name, indices, file extension and nomenclature NomType
    717717if isempty(regexp(fileinput,'^http')) && ~exist(fileinput,'file')
     
    753753%% enable other menus and uicontrols
    754754set(handles.RUN, 'Enable','On')
    755 set(handles.RUN,'BackgroundColor',[1 0 0])% set RUN button to red 
     755set(handles.RUN,'BackgroundColor',[1 0 0])% set RUN button to red
    756756set(handles.InputTable,'BackgroundColor',[1 1 0]) % set RootPath edit box  to yellow
    757757drawnow
     
    863863SeriesData.Ref_j2=j2;
    864864
    865 %% define the path for the output files 
     865%% define the path for the output files
    866866[InputPath,Device,DeviceExt]=fileparts(InputTable{1,1});
    867867[InputPath,Experiment,ExperimentExt]=fileparts(InputPath);
     
    888888set(handles.InputTable,'BackgroundColor',[1 1 1])
    889889
    890 %% initiate input file series and refresh the current field view:     
     890%% initiate input file series and refresh the current field view:
    891891update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileInfo,MovieObject,iview);
    892892%% enable field and veltype menus, in accordance with the current action
     
    909909    MinIndex_j=1; % index j set to 1 by default
    910910    MaxIndex_j=1;
    911     MinIndex_i=find(i1_series(1,2,:), 1 )-1; % min ref index i detected in the series (corresponding to the first non-zero value of i1_series, except for zero index) 
    912     MaxIndex_i=find(i1_series(1,2,:),1,'last' )-1; % max ref index i detected in the series (corresponding to the last non-zero value of i1_series) 
     911    MinIndex_i=find(i1_series(1,2,:), 1 )-1; % min ref index i detected in the series (corresponding to the first non-zero value of i1_series, except for zero index)
     912    MaxIndex_i=find(i1_series(1,2,:),1,'last' )-1; % max ref index i detected in the series (corresponding to the last non-zero value of i1_series)
    913913else
    914914    ref_i=squeeze(max(i1_series(1,:,:),[],2)); % select ref_j index for each ref_i
     
    10721072    end
    10731073    TimeName='video';
    1074 end 
     1074end
    10751075
    10761076
     
    11831183%------------------------------------------------------------------------
    11841184function [ModeMenu,ModeValue]=update_mode(i1_series,i2_series,j2_series)
    1185 %------------------------------------------------------------------------   
     1185%------------------------------------------------------------------------
    11861186ModeMenu={''};
    11871187if isempty(j2_series)% no j pair
     
    13891389% --- Executes when selected cell(s) is changed in PairString.
    13901390function PairString_CellSelectionCallback(hObject, eventdata, handles)
    1391 %------------------------------------------------------------------------   
     1391%------------------------------------------------------------------------
    13921392if numel(eventdata.Indices)>=1
    13931393    PairString=get(hObject,'Data');
     
    14541454% RunMode='cluster': calculations dispatched in a cluster, using a managing system, 'oar, 'sge, or 'sgb'.
    14551455% In the latter case, the calculation is split in 'packets' of i index (all j indices are contained in a single packet).
    1456 % This splitting is possible only if the different calculations in the series are independent. Otherwise the action 
     1456% This splitting is possible only if the different calculations in the series are independent. Otherwise the action
    14571457% function imposes a number of processes NbSlice in input, for instance NbSlice=1 for a time series.
    14581458% If NbSlice is not imposed, the splitting in packets (jobs) is determined
     
    14601460% than MaxJobNumber (these parameters are defined in the file series.xml in
    14611461% accordance with the management strategy for the cluster). The jobs are
    1462 % dispatched in parallel into NbCore processors by the cluster managing system. 
     1462% dispatched in parallel into NbCore processors by the cluster managing system.
    14631463
    14641464function errormsg=launch_action(handles)
     
    15171517end
    15181518
    1519 %% Get  parameters from series.xml 
     1519%% Get  parameters from series.xml
    15201520errormsg=''; % default error message
    15211521ActionFullName=fullfile(get(handles.ActionPath,'String'),ActionName);
     
    15421542    set(handles.series,'Pointer','watch') % set the mouse pointer to 'watch'
    15431543    set(handles.ActionExt,'BackgroundColor',[1 1 0])
    1544     [mcrmajor, mcrminor] = mcrversion;   
     1544    [mcrmajor, mcrminor] = mcrversion;
    15451545    MCRROOT = ['MCRROOT',int2str(mcrmajor),int2str(mcrminor)];
    15461546    RunTime = getenv('MCRROOT'); % Just variable MCRROOT with no version in it's name
     
    15641564            errormsg='Action launch interrupted';
    15651565            return
    1566         end       
     1566        end
    15671567    else
    15681568        sh_file_info=dir(fullfile(get(handles.ActionPath,'String'),[ActionNameVersion '.sh']));
     
    15881588end
    15891589
    1590 %% set nbre of cluster cores and processes: 
    1591 % NbCore is the number of computer processors used 
    1592 % NbProcess is the number of independent processes in which the required calculation is split. 
     1590%% set nbre of cluster cores and processes:
     1591% NbCore is the number of computer processors used
     1592% NbProcess is the number of independent processes in which the required calculation is split.
    15931593% switch RunMode
    15941594%     case {'local','background'}
     
    17051705        OutputSubDir=unique(ListSubdir(:,iexp));
    17061706        Param.OutputSubDir=OutputSubDir{1};
    1707         if numel(OutputSubDir)>1% case 
     1707        if numel(OutputSubDir)>1% case
    17081708            for iout=2:numel(OutputSubDir)
    17091709                Param.OutputSubDir=[Param.OutputSubDir '-' OutputSubDir{iout}];
    1710             end               
    1711         end       
     1710            end
     1711        end
    17121712    end
    17131713    [xx,ExpName]=fileparts(Param.InputTable{1,1});
    17141714    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
    17151715    Param.IndexRange.last_i=str2num(get(handles.num_last_i,'String'));
    1716    
     1716
    17171717    %% create the output data directory if needed, after checking its existence
    17181718    OutputDir='';
     
    17901790            end
    17911791        end
    1792        
     1792
    17931793    elseif isfield(Param,'ActionInput')&&isfield(Param.ActionInput,'LogPath')% custom definition of the output dir
    17941794        OutputDir=Param.ActionInput.LogPath;
     
    18061806        Param.Experiment=ListExpOut{iexp};
    18071807        Param.Device=ListDeviceOut{iexp};
    1808         check_input_file_series(handles)     
     1808        check_input_file_series(handles)
    18091809    end
    18101810    DirXml=fullfile(OutputDir,'0_XML');
     
    18211821    end
    18221822    OutputNomType=nomtype2pair(Param.InputTable{1,4}); % nomenclature for output files
    1823    
     1823
    18241824    %% get the set of reference input field indices
    18251825    first_i=1; % first i index to process
     
    19491949        RunMode = 'python';
    19501950    end
    1951    
    1952    
     1951
     1952
    19531953    %% direct processing on the current Matlab session or creation of command files
    19541954    filexml=cell(1,NbProcess); % initialisation of the names of the files containing the processing parameters
     
    19771977            Param.InputTable{ilist,1}=regexprep(Param.InputTable{ilist,1},'\','/'); % correct path name for PCWIN system
    19781978        end
    1979        
     1979
    19801980        if isfield(Param,'OutputSubDir')
    19811981            t=struct2xml(Param);
     
    19971997                case '.m'
    19981998                    h_fun(Param); % direct launching
    1999                    
     1999
    20002000                case '.sh'
    20012001                    switch computer
     
    20092009        end
    20102010    end
    2011    
     2011
    20122012    if ~strcmp (RunMode,'local') && ~strcmp(RunMode,'python')
    20132013        %% processing on a different session of the same computer (background) or cluster, create executable files
     
    20452045            end
    20462046        end
    2047        
     2047
    20482048        %create the executable and log file names
    20492049        file_exe_global=fullfile_uvmat('','',Param.InputTable{1,3},ExeExt,OutputNomType,...
     
    20532053            first_i,last_i,first_j,last_j);
    20542054        filelog_global=fullfile(OutputDir,'0_LOG',filelog_global);
    2055        
     2055
    20562056        for iprocess=1:NbProcess
    20572057            batch_file_list{iprocess}=fullfile(OutputDir,'0_EXE',regexprep(extxml{iprocess},'.xml$',ExeExt)); % executable file names
     
    20592059        end
    20602060    end
    2061    
     2061
    20622062    %% launch the executable files for background or cluster processing
    2063    
     2063
    20642064    switch RunMode
    2065        
     2065
    20662066        case 'background'
    20672067            [fid,message]=fopen(file_exe_global,'w');
     
    21152115                    msgbox_uvmat('CONFIRMATION',[ActionFullName ' launched in background for ' ExpName ': press STATUS to see results'])
    21162116            end
    2117            
     2117
    21182118        case 'cluster' % option 'oar-parexec' used
    21192119            %create subdirectory for oar commands
     
    21742174            else
    21752175                errormsg=['error for writting the executable file:' errormsg];
    2176             end       
     2176            end
    21772177            CPUTimeProcess=CPUTime*BlockLength*nbfield_j; % estimated CPU time for one individual process (in minutes)
    21782178            LaunchCmdFcn=SeriesData.SeriesParam.ClusterParam.LaunchCmdFcn;
     
    21942194            end
    21952195            %     case 'cluster_pbs' % for LMFA Kepler machine:  trqnsferred to fct
    2196            
     2196
    21972197            %         %create subdirectory for pbs command and log files
    21982198            %         DirPBS=fullfile(OutputDir,'0_PBS'); % todo : common name OAR/PBS
     
    22342234            %         %system(pbs_command);
    22352235            %         msgbox_uvmat('CONFIRMATION',[ActionFullName ' command ready to be launched in cluster'])
    2236            
     2236
    22372237        case 'cluster_sge' % for PSMN % TODO: use the standard 'cluster' config with an external fct
    22382238            % Au PSMN, on ne cr??e pas 1 job avec plusieurs c??urs, mais N jobs de 1 c??urs
    22392239            % o?? N < 1000.
    22402240            %create subdirectory for pbs command and log files
    2241            
     2241
    22422242            DirSGE=fullfile(OutputDir,'0_SGE');
    22432243            if exist(DirSGE,'dir')% delete the content of the dir 0_LOG to allow new input
     
    22562256            disp(['Max number of jobs: ' num2str(NbCore)])
    22572257            disp(['Images per job: ' num2str(maxImgsPerJob)])
    2258            
     2258
    22592259            iprocess = 1;
    22602260            imgsInJob = [];
     
    22942294            msgbox_uvmat('CONFIRMATION',[num2str(currJobIndex-1) ' jobs launched on queue ' qstat_Queue '.'])
    22952295        case 'python'
    2296             ActionName='fluidimage.run_from_xml';% name of the function to launch
    2297              command = command_launch_python('','',ActionName,filexml{iprocess});
    2298             % ['LD_LIBRARY_PATH=$(echo $LD_LIBRARY_PATH | pyp "l = x.split('':''); l = [s for s in l if ''matlab'' not in s]; print('':''.join(l))") ' ...
    2299             %     'python -m fluidimage.run_from_xml ' filexml{iprocess}];
     2296            command = command_launch_python(filexml{iprocess});
    23002297            fprintf(['command:\n' command '\n\n'])
    2301             errorcheck=system(command, '-echo')
     2298            [status, result] = call_command_clean(command);
    23022299    end
    23032300    if exist(OutputDir,'dir')
     
    23962393    end
    23972394    [tild,ActionName,ActionExt]=fileparts(FileName);
    2398    
     2395
    23992396    % insert the choice in the menu ActionName
    24002397    ActionIndex=find(strcmp(ActionName,ActionList),1); % look for the selected function in the menu Action
     
    24082405         ActionPathList=[ActionPathList; PathName];
    24092406    end
    2410    
     2407
    24112408    % record the file extension and extend the path list if it is a new extension
    24122409    ActionExtList=get(handles.ActionExt,'String');
     
    24232420        ActionIndex=ActionIndex-nbremove;
    24242421    end
    2425    
     2422
    24262423    % record action menu, choice and path
    24272424    set(handles.ActionName,'Value',ActionIndex)
     
    24292426       set(handles.ActionName,'UserData',ActionPathList);
    24302427    set(handles.ActionExt,'Value',ActionExtIndex)
    2431        
     2428
    24322429    %record the user defined menu additions in personal file profil_perso
    24332430    dir_perso=prefdir;
     
    26082605                msgbox_uvmat('WARNING','coordinate names do not exist in the second netcdf input file')
    26092606            end
    2610            
     2607
    26112608            set(handles.FieldName_1,'Visible','on')
    26122609            set(handles.FieldName_1,'Value',1)
     
    27302727if isfield(ParamOut,'FieldTransform')
    27312728    if ~strcmp(ParamOut.FieldTransform,'off')
    2732     FieldTransformVisible='on'; 
     2729    FieldTransformVisible='on';
    27332730    end
    27342731    if iscell(ParamOut.FieldTransform)
     
    27692766end
    27702767
    2771 %% definition of the path for the output files 
     2768%% definition of the path for the output files
    27722769InputTable=get(handles.InputTable,'Data');
    27732770[OutputPath,Device,DeviceExt]=fileparts(InputTable{1,1});
     
    27822779set(handles.OutputPath,'Visible','on')
    27832780set(handles.OutputPathBrowse,'Visible','on')
    2784    
    2785 %% definition of the subdirectory containing the output files 
     2781
     2782%% definition of the subdirectory containing the output files
    27862783
    27872784if  ~(isfield(SeriesData,'ActionName') && strcmp(ActionName,SeriesData.ActionName))
     
    28122809        SubDirOut=InputTable{1,2}; % use the first subdir name (+OutputDirExt) as output  subdirectory
    28132810    case 'two'
    2814         OutputDirVisible='on';   
     2811        OutputDirVisible='on';
    28152812        SubDir=InputTable(1:2,2); % set of subdirectories
    28162813        SubDirOut=SubDir{1};
     
    28922889    % check the existence of the first file in the series
    28932890    first_j=[];last_j=[];MinIndex_j=1;MaxIndex_j=1; % default setting for index j
    2894     if isfield(Param.IndexRange,'first_j') % if index j is used     
     2891    if isfield(Param.IndexRange,'first_j') % if index j is used
    28952892        first_j=Param.IndexRange.first_j;
    28962893        last_j=Param.IndexRange.last_j;
     
    29022899    [i1,i2,j1,j2] = get_file_index(Param.IndexRange.first_i,first_j,PairString);
    29032900    LineIndex=iview(1);
    2904     if numel(iview)>1     
     2901    if numel(iview)>1
    29052902        answer=msgbox_uvmat('INPUT_TXT',['select the line of the input table:' num2str(iview)] ,num2str(iview(1)));
    29062903        LineIndex=str2num(answer);
     
    29482945            YName=GetFieldData.Coordinates.Coord_y;
    29492946            TimeNameStr=GetFieldData.Time.SwitchVarIndexTime;
    2950             % get the time info                     
     2947            % get the time info
    29512948            TimeTable=get(handles.TimeTable,'Data');
    29522949            switch TimeNameStr
     
    29562953                    TimeName=['att:' GetFieldData.Time.TimeName];
    29572954                    % update the time table
    2958                     TimeTable{LineIndex,2}=get_time(Param.IndexRange.MinIndex_i(LineIndex),MinIndex_j,PairString,InputTable,SeriesData.FileInfo{LineIndex},GetFieldData.Time.TimeName);  % Min time     
    2959                     TimeTable{LineIndex,3}=get_time(Param.IndexRange.first_i,first_j,PairString,InputTable,SeriesData.FileInfo{LineIndex},GetFieldData.Time.TimeName);  % first time             
    2960                     TimeTable{LineIndex,4}=get_time(Param.IndexRange.last_i,last_j,PairString,InputTable,SeriesData.FileInfo{LineIndex},GetFieldData.Time.TimeName);  % last time                     
     2955                    TimeTable{LineIndex,2}=get_time(Param.IndexRange.MinIndex_i(LineIndex),MinIndex_j,PairString,InputTable,SeriesData.FileInfo{LineIndex},GetFieldData.Time.TimeName);  % Min time
     2956                    TimeTable{LineIndex,3}=get_time(Param.IndexRange.first_i,first_j,PairString,InputTable,SeriesData.FileInfo{LineIndex},GetFieldData.Time.TimeName);  % first time
     2957                    TimeTable{LineIndex,4}=get_time(Param.IndexRange.last_i,last_j,PairString,InputTable,SeriesData.FileInfo{LineIndex},GetFieldData.Time.TimeName);  % last time
    29612958                    TimeTable{LineIndex,5}=get_time(Param.IndexRange.MaxIndex_i(LineIndex),MaxIndex_j,PairString,InputTable,SeriesData.FileInfo{LineIndex},GetFieldData.Time.TimeName);  % Max time
    29622959                case 'variable'
     
    30943091        set(handles.FieldName_1,'String',[FieldList; {'add_field...'}]);
    30953092    end
    3096 end   
     3093end
    30973094
    30983095
     
    31223119
    31233120%------------------------------------------------------------------------
    3124 % --- determine the list of index pairstring of processing file 
     3121% --- determine the list of index pairstring of processing file
    31253122function [num_i1,num_i2,num_j1,num_j2,num_i_out,num_j_out]=find_file_indices(num_i,num_j,ind_shift,NomType,mode)
    31263123%------------------------------------------------------------------------
     
    31523149        num_j2_col=num_j+ind_shift(2);
    31533150        % adjust the first field number
    3154         indsel=find((num_j1_col >= 1));   
     3151        indsel=find((num_j1_col >= 1));
    31553152        num_j_out=num_j(indsel);
    31563153        num_j1_col=num_j1_col(indsel);
     
    31583155        [num_i1,num_j1]=meshgrid(num_i,num_j1_col);
    31593156        [num_i2,num_j2]=meshgrid(num_i,num_j2_col);
    3160     end   
     3157    end
    31613158end
    31623159
     
    32483245    end
    32493246else
    3250     hset_object=findobj(allchild(0),'Tag','set_object'); 
     3247    hset_object=findobj(allchild(0),'Tag','set_object');
    32513248    if ~isempty(hset_object)
    32523249        set(get(hset_object,'Children'),'Enable','off')
    3253     end 
     3250    end
    32543251end
    32553252
     
    33853382
    33863383%% browse transform functions with the input menu option more...
    3387 if isequal(TransformName,'more...')% browse transform functions     
     3384if isequal(TransformName,'more...')% browse transform functions
    33883385    FileName=uigetfile_uvmat('Pick a transform function',get(handles.TransformPath,'String'),'.m');
    33893386    if isempty(FileName)
     
    34033400        TransformPathList=[TransformPathList;{TransformPath}];
    34043401    else% the input function already exist, we update its path (possibly new)
    3405         TransformPathList{TransformIndex}=TransformPath; % 
     3402        TransformPathList{TransformIndex}=TransformPath; %
    34063403        set(handles.TransformName,'Value',TransformIndex)
    34073404    end
    3408    % save the new menu in the personal file 'uvmat_perso.mat' 
     3405   % save the new menu in the personal file 'uvmat_perso.mat'
    34093406   dir_perso=prefdir; % personal Matalb directory
    34103407   profil_perso=fullfile(dir_perso,'uvmat_perso.mat');
     
    34133410           TransformListUser{ilist-nb_builtin_transform}=TransformList{ilist};
    34143411           TransformPathListUser{ilist-nb_builtin_transform}=TransformPathList{ilist};
    3415        end 
     3412       end
    34163413       TransformPathListUser=TransformPathListUser';
    34173414       TransformListUser=TransformListUser';
    34183415       save (profil_perso,'TransformPathListUser','TransformListUser','-append'); % store the root name for future opening of uvmat
    3419    end 
     3416   end
    34203417end
    34213418
     
    35073504     set(handles.FieldName,'Value',1:numel(ListField))
    35083505     set(handles.FieldName,'Visible','on')
    3509 end       
     3506end
    35103507if isfield(Param,'ActionInput')%  introduce  parameters specific to an Action fct, for instance PIV parameters
    35113508%     set(handles.ActionInput,'Visible','on')
     
    35263523    set(handles.EditObject,'Visible','on')
    35273524    set(handles.DeleteObject,'Visible','on')
    3528 else     
     3525else
    35293526    set(handles.ProjObjectName,'String','')
    35303527    set(handles.ProjObjectName,'Visible','off')
    35313528    set(handles.ViewObject,'Visible','off')
    35323529    set(handles.EditObject,'Visible','off')
    3533     set(handles.DeleteObject,'Visible','off')     
    3534 end     
     3530    set(handles.DeleteObject,'Visible','off')
     3531end
    35353532set(handles.REFRESH,'BackgroundColor',[1 0 1]); % paint REFRESH button in magenta to indicate that it should be activated
    35363533
     
    35903587    Param=read_GUI(handles.series);
    35913588    RootPath=fullfile(Param.OutputPath,Param.Experiment,Param.Device);
    3592     if ~isfield(Param,'OutputSubDir')   
     3589    if ~isfield(Param,'OutputSubDir')
    35933590        msgbox_uvmat('ERROR','no standard sub-directory definition for output files, use a browser to check the output')
    35943591        set(handles.status,'BackgroundColor',[0 1 0])
     
    36143611
    36153612
    3616 %------------------------------------------------------------------------   
     3613%------------------------------------------------------------------------
    36173614% launched by selecting a file on the list
    36183615%------------------------------------------------------------------------
     
    36413638    set(hObject,'UserData',FullSelectName)
    36423639    hfig=get(hObject,'parent');
    3643     htitlebox=findobj(hfig,'tag','titlebox');   
     3640    htitlebox=findobj(hfig,'tag','titlebox');
    36443641    set(htitlebox,'String',FullSelectName)
    36453642elseif exist(FullSelectName,'file')%visualise the vel field if it exists
    3646     FileInfo=get_file_info(FullSelectName);   
     3643    FileInfo=get_file_info(FullSelectName);
    36473644    if strcmp(FileInfo.FileType,'txt')
    36483645        edit(FullSelectName)
     
    36563653
    36573654
    3658 %------------------------------------------------------------------------   
     3655%------------------------------------------------------------------------
    36593656% launched by refreshing the status figure
    36603657%------------------------------------------------------------------------
     
    37113708%% update the waitbar
    37123709hwaitbar=findobj(hfig,'tag','waitbar');
    3713 if ~isempty(NbOutputFile) 
     3710if ~isempty(NbOutputFile)
    37143711    BarPosition=get(hwaitbar,'Position');
    37153712    BarPosition(3)=0.9*numel(datnum)/NbOutputFile;
     
    37173714end
    37183715
    3719 %------------------------------------------------------------------------ 
     3716%------------------------------------------------------------------------
    37203717% --- Executes on selection change in ActionExt.
    3721 %------------------------------------------------------------------------ 
     3718%------------------------------------------------------------------------
    37223719function ActionExt_Callback(hObject, eventdata, handles)
    37233720
     
    37333730
    37343731%------------------------------------------------------------------------
    3735 % --- set the visibility of relevant velocity type menus: 
     3732% --- set the visibility of relevant velocity type menus:
    37363733function menu=set_veltype_display(Civ,FileType)
    37373734%------------------------------------------------------------------------
     
    37923789Bottom=ScreenSize(4)-Height-40; % put fig at top right
    37933790hfig=findobj(allchild(0),'Tag','set_slice');
    3794 if ~isempty(hfig),delete(hfig), end; % delete existing version of the GUI 
     3791if ~isempty(hfig),delete(hfig), end; % delete existing version of the GUI
    37953792hfig=figure('name','set_pairs','tag','set_pairs','MenuBar','none','NumberTitle','off','Unit','points','Position',[Left,Bottom,Width,Height]);
    37963793BackgroundColor=get(hfig,'Color');
     
    38253822viewcell=viewcell';
    38263823ModeMenu={'bursts';'series(Dj)'};
    3827 ModeValue=1;                                               
    3828                    %i1_series,i2_series,j1_series,j2_series,mode,time,TimeUnit,ref_i,ref_j,TimeName,InputTable,FileInfo                             
     3824ModeValue=1;
     3825                   %i1_series,i2_series,j1_series,j2_series,mode,time,TimeUnit,ref_i,ref_j,TimeName,InputTable,FileInfo
    38293826% first raw of the GUI
    38303827uicontrol('Style','text','Units','normalized', 'Position', [0.05 0.88 0.5 0.1],'BackgroundColor',BackgroundColor,...
     
    38653862Mode_Callback(hObject,eventdata)
    38663863
    3867 %------------------------------------------------------------------------   
     3864%------------------------------------------------------------------------
    38683865function Mode_Callback(hObject,eventdata)
    38693866%% get input info
Note: See TracChangeset for help on using the changeset viewer.