- Timestamp:
- Apr 24, 2024, 11:35:22 AM (8 months ago)
- 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 string s for opening a programme in python with a Linux system('GLNX86','GLNXA64','MACI64')1 %'command_launch_python': creates the command string for launching fluidimage 2 2 %------------------------------------------------------------------------ 3 % function cmd=command_launch_ matlab(filelog,ActionPath,ActionName,inputxml)3 % function cmd=command_launch_python(inputxml) 4 4 % 5 5 %OUTPUT 6 % cmd=set of system commands (char string) to write 7 6 % cmd=set of system commands (char string) to write 8 7 % 9 8 %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 15 11 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 12 function cmd=command_launch_python(inputxml) 13 cmd = ['python -m fluidimage.run_from_xml ' inputxml]; 14 end -
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 2 2 %------------------------------------------------------------------------ 3 3 % function varargout = series(varargin) … … 35 35 %------------------------------------------------------------------------ 36 36 %------------------------------------------------------------------------ 37 % I - MAIN FUNCTION series 37 % I - MAIN FUNCTION series 38 38 %------------------------------------------------------------------------ 39 39 %------------------------------------------------------------------------ … … 130 130 if ~exist('Param','var') 131 131 Param=[]; % default 132 end 132 end 133 133 134 134 %% Read the parameter file series.xml, or created from series.xml.default if it does not exist … … 145 145 delete(xmlfile); 146 146 [success,message]=copyfile(fullfile(path_series,'series.xml.default'),xmlfile); 147 end 147 end 148 148 SeriesData.SeriesParam=xml2struct(xmlfile); 149 149 end … … 158 158 % % 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))") ' ... 159 159 % % 'python -c "import fluidimage"']; 160 % % [code, ~] = system(command); 160 % % [code, ~] = system(command); 161 161 % % if code==0 162 162 ActionExtList={'.m';'.sh';'.py (in dev.)'}; % default choice of extensions (Matlab fct .m or compiled version .sh … … 185 185 SeriesData.TransformPath=path_transform_fct;% store the standard path for trqnsform functions (needed for compilation) 186 186 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 188 188 dir_perso=prefdir; 189 189 profil_perso=fullfile(dir_perso,'uvmat_perso.mat'); … … 248 248 set(handles.TransformName,'Value',TransformIndex) 249 249 set(handles.TransformPath,'String',TransformPathList{TransformIndex}) 250 250 251 251 %% fields input initialisation 252 252 if isfield(Param,'list_fields')&& isfield(Param,'index_fields') &&~isempty(Param.list_fields) &&~isempty(Param.index_fields) … … 269 269 set(handles.series,'UserData',SeriesData)% initiate Userdata 270 270 if isfield(Param,'InputFile') 271 271 272 272 %% fill the list of input file series 273 273 InputTable=[{Param.InputFile.RootPath},{Param.InputFile.SubDir},{Param.InputFile.RootFile},{Param.InputFile.NomType},{Param.InputFile.FileExt}]; … … 282 282 end 283 283 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 286 286 [InputPath,Device,DeviceExt]=fileparts(InputTable{1,1}); 287 287 [InputPath,Experiment,ExperimentExt]=fileparts(InputPath); … … 302 302 end 303 303 end 304 304 305 305 %% determine the selected reference field indices for pair display 306 306 307 307 [tild,tild,tild,i1,i2,j1,j2]=fileparts_uvmat(Param.InputFile.FileIndex); 308 308 if isempty(i1) … … 333 333 %% enable field and veltype menus, in accordance with the current action 334 334 ActionName_Callback([],[], handles) 335 335 336 336 %% set length of waitbar 337 337 displ_time(handles) 338 338 339 339 else 340 340 set(handles.REFRESH,'BackgroundColor',[1 0 1])% set REFRESH button to magenta color to indicate that input refresh is needed … … 384 384 % automatically sets the global properties when the rootfile name is introduced 385 385 % 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 388 388 %------------------------------------------------------------------------ 389 389 %------------------------------------------------------------------------ 390 390 % --- fct activated by the browser under 'Open' 391 %------------------------------------------------------------------------ 391 %------------------------------------------------------------------------ 392 392 function MenuBrowse_Callback(hObject, eventdata, handles) 393 393 %% look for the previously opened file 'oldfile' … … 481 481 %------------------------------------------------------------------------ 482 482 % --- fct activated by the browser under 'Open campaign/Browse...' 483 %------------------------------------------------------------------------ 483 %------------------------------------------------------------------------ 484 484 function MenuBrowseCampaign_Callback(hObject, eventdata, handles) 485 485 … … 539 539 % -------------------------------------------------------------------- 540 540 % function MenuCampaign_Callback(hObject, eventdata, handles) 541 % % -------------------------------------------------------------------- 542 % 541 % % -------------------------------------------------------------------- 542 % 543 543 % OutPut=browse_data(get(hObject,'Label'),'on','on'); % open the GUI browse_data to get select a campaign dir, experiment and device 544 544 % if ~isfield(OutPut,'Campaign') … … 704 704 % 'append': add a new line to the input table 705 705 function errormsg=display_file_name(handles,Param,iview) 706 706 707 707 set(handles.REFRESH,'BackgroundColor',[1 1 0])% set REFRESH button to yellow color (indicate activation) 708 708 drawnow 709 709 errormsg=''; % default 710 710 if ischar(Param) 711 fileinput=Param; 711 fileinput=Param; 712 712 else% input set when series is opened (called by the GUI uvmat) 713 713 fileinput=Param.FileName; 714 714 end 715 715 716 716 %% get the input root name, indices, file extension and nomenclature NomType 717 717 if isempty(regexp(fileinput,'^http')) && ~exist(fileinput,'file') … … 753 753 %% enable other menus and uicontrols 754 754 set(handles.RUN, 'Enable','On') 755 set(handles.RUN,'BackgroundColor',[1 0 0])% set RUN button to red 755 set(handles.RUN,'BackgroundColor',[1 0 0])% set RUN button to red 756 756 set(handles.InputTable,'BackgroundColor',[1 1 0]) % set RootPath edit box to yellow 757 757 drawnow … … 863 863 SeriesData.Ref_j2=j2; 864 864 865 %% define the path for the output files 865 %% define the path for the output files 866 866 [InputPath,Device,DeviceExt]=fileparts(InputTable{1,1}); 867 867 [InputPath,Experiment,ExperimentExt]=fileparts(InputPath); … … 888 888 set(handles.InputTable,'BackgroundColor',[1 1 1]) 889 889 890 %% initiate input file series and refresh the current field view: 890 %% initiate input file series and refresh the current field view: 891 891 update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileInfo,MovieObject,iview); 892 892 %% enable field and veltype menus, in accordance with the current action … … 909 909 MinIndex_j=1; % index j set to 1 by default 910 910 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) 913 913 else 914 914 ref_i=squeeze(max(i1_series(1,:,:),[],2)); % select ref_j index for each ref_i … … 1072 1072 end 1073 1073 TimeName='video'; 1074 end 1074 end 1075 1075 1076 1076 … … 1183 1183 %------------------------------------------------------------------------ 1184 1184 function [ModeMenu,ModeValue]=update_mode(i1_series,i2_series,j2_series) 1185 %------------------------------------------------------------------------ 1185 %------------------------------------------------------------------------ 1186 1186 ModeMenu={''}; 1187 1187 if isempty(j2_series)% no j pair … … 1389 1389 % --- Executes when selected cell(s) is changed in PairString. 1390 1390 function PairString_CellSelectionCallback(hObject, eventdata, handles) 1391 %------------------------------------------------------------------------ 1391 %------------------------------------------------------------------------ 1392 1392 if numel(eventdata.Indices)>=1 1393 1393 PairString=get(hObject,'Data'); … … 1454 1454 % RunMode='cluster': calculations dispatched in a cluster, using a managing system, 'oar, 'sge, or 'sgb'. 1455 1455 % 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 1457 1457 % function imposes a number of processes NbSlice in input, for instance NbSlice=1 for a time series. 1458 1458 % If NbSlice is not imposed, the splitting in packets (jobs) is determined … … 1460 1460 % than MaxJobNumber (these parameters are defined in the file series.xml in 1461 1461 % 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. 1463 1463 1464 1464 function errormsg=launch_action(handles) … … 1517 1517 end 1518 1518 1519 %% Get parameters from series.xml 1519 %% Get parameters from series.xml 1520 1520 errormsg=''; % default error message 1521 1521 ActionFullName=fullfile(get(handles.ActionPath,'String'),ActionName); … … 1542 1542 set(handles.series,'Pointer','watch') % set the mouse pointer to 'watch' 1543 1543 set(handles.ActionExt,'BackgroundColor',[1 1 0]) 1544 [mcrmajor, mcrminor] = mcrversion; 1544 [mcrmajor, mcrminor] = mcrversion; 1545 1545 MCRROOT = ['MCRROOT',int2str(mcrmajor),int2str(mcrminor)]; 1546 1546 RunTime = getenv('MCRROOT'); % Just variable MCRROOT with no version in it's name … … 1564 1564 errormsg='Action launch interrupted'; 1565 1565 return 1566 end 1566 end 1567 1567 else 1568 1568 sh_file_info=dir(fullfile(get(handles.ActionPath,'String'),[ActionNameVersion '.sh'])); … … 1588 1588 end 1589 1589 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. 1593 1593 % switch RunMode 1594 1594 % case {'local','background'} … … 1705 1705 OutputSubDir=unique(ListSubdir(:,iexp)); 1706 1706 Param.OutputSubDir=OutputSubDir{1}; 1707 if numel(OutputSubDir)>1% case 1707 if numel(OutputSubDir)>1% case 1708 1708 for iout=2:numel(OutputSubDir) 1709 1709 Param.OutputSubDir=[Param.OutputSubDir '-' OutputSubDir{iout}]; 1710 end 1711 end 1710 end 1711 end 1712 1712 end 1713 1713 [xx,ExpName]=fileparts(Param.InputTable{1,1}); 1714 1714 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 1715 1715 Param.IndexRange.last_i=str2num(get(handles.num_last_i,'String')); 1716 1716 1717 1717 %% create the output data directory if needed, after checking its existence 1718 1718 OutputDir=''; … … 1790 1790 end 1791 1791 end 1792 1792 1793 1793 elseif isfield(Param,'ActionInput')&&isfield(Param.ActionInput,'LogPath')% custom definition of the output dir 1794 1794 OutputDir=Param.ActionInput.LogPath; … … 1806 1806 Param.Experiment=ListExpOut{iexp}; 1807 1807 Param.Device=ListDeviceOut{iexp}; 1808 check_input_file_series(handles) 1808 check_input_file_series(handles) 1809 1809 end 1810 1810 DirXml=fullfile(OutputDir,'0_XML'); … … 1821 1821 end 1822 1822 OutputNomType=nomtype2pair(Param.InputTable{1,4}); % nomenclature for output files 1823 1823 1824 1824 %% get the set of reference input field indices 1825 1825 first_i=1; % first i index to process … … 1949 1949 RunMode = 'python'; 1950 1950 end 1951 1952 1951 1952 1953 1953 %% direct processing on the current Matlab session or creation of command files 1954 1954 filexml=cell(1,NbProcess); % initialisation of the names of the files containing the processing parameters … … 1977 1977 Param.InputTable{ilist,1}=regexprep(Param.InputTable{ilist,1},'\','/'); % correct path name for PCWIN system 1978 1978 end 1979 1979 1980 1980 if isfield(Param,'OutputSubDir') 1981 1981 t=struct2xml(Param); … … 1997 1997 case '.m' 1998 1998 h_fun(Param); % direct launching 1999 1999 2000 2000 case '.sh' 2001 2001 switch computer … … 2009 2009 end 2010 2010 end 2011 2011 2012 2012 if ~strcmp (RunMode,'local') && ~strcmp(RunMode,'python') 2013 2013 %% processing on a different session of the same computer (background) or cluster, create executable files … … 2045 2045 end 2046 2046 end 2047 2047 2048 2048 %create the executable and log file names 2049 2049 file_exe_global=fullfile_uvmat('','',Param.InputTable{1,3},ExeExt,OutputNomType,... … … 2053 2053 first_i,last_i,first_j,last_j); 2054 2054 filelog_global=fullfile(OutputDir,'0_LOG',filelog_global); 2055 2055 2056 2056 for iprocess=1:NbProcess 2057 2057 batch_file_list{iprocess}=fullfile(OutputDir,'0_EXE',regexprep(extxml{iprocess},'.xml$',ExeExt)); % executable file names … … 2059 2059 end 2060 2060 end 2061 2061 2062 2062 %% launch the executable files for background or cluster processing 2063 2063 2064 2064 switch RunMode 2065 2065 2066 2066 case 'background' 2067 2067 [fid,message]=fopen(file_exe_global,'w'); … … 2115 2115 msgbox_uvmat('CONFIRMATION',[ActionFullName ' launched in background for ' ExpName ': press STATUS to see results']) 2116 2116 end 2117 2117 2118 2118 case 'cluster' % option 'oar-parexec' used 2119 2119 %create subdirectory for oar commands … … 2174 2174 else 2175 2175 errormsg=['error for writting the executable file:' errormsg]; 2176 end 2176 end 2177 2177 CPUTimeProcess=CPUTime*BlockLength*nbfield_j; % estimated CPU time for one individual process (in minutes) 2178 2178 LaunchCmdFcn=SeriesData.SeriesParam.ClusterParam.LaunchCmdFcn; … … 2194 2194 end 2195 2195 % case 'cluster_pbs' % for LMFA Kepler machine: trqnsferred to fct 2196 2196 2197 2197 % %create subdirectory for pbs command and log files 2198 2198 % DirPBS=fullfile(OutputDir,'0_PBS'); % todo : common name OAR/PBS … … 2234 2234 % %system(pbs_command); 2235 2235 % msgbox_uvmat('CONFIRMATION',[ActionFullName ' command ready to be launched in cluster']) 2236 2236 2237 2237 case 'cluster_sge' % for PSMN % TODO: use the standard 'cluster' config with an external fct 2238 2238 % Au PSMN, on ne cr??e pas 1 job avec plusieurs c??urs, mais N jobs de 1 c??urs 2239 2239 % o?? N < 1000. 2240 2240 %create subdirectory for pbs command and log files 2241 2241 2242 2242 DirSGE=fullfile(OutputDir,'0_SGE'); 2243 2243 if exist(DirSGE,'dir')% delete the content of the dir 0_LOG to allow new input … … 2256 2256 disp(['Max number of jobs: ' num2str(NbCore)]) 2257 2257 disp(['Images per job: ' num2str(maxImgsPerJob)]) 2258 2258 2259 2259 iprocess = 1; 2260 2260 imgsInJob = []; … … 2294 2294 msgbox_uvmat('CONFIRMATION',[num2str(currJobIndex-1) ' jobs launched on queue ' qstat_Queue '.']) 2295 2295 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}); 2300 2297 fprintf(['command:\n' command '\n\n']) 2301 errorcheck=system(command, '-echo')2298 [status, result] = call_command_clean(command); 2302 2299 end 2303 2300 if exist(OutputDir,'dir') … … 2396 2393 end 2397 2394 [tild,ActionName,ActionExt]=fileparts(FileName); 2398 2395 2399 2396 % insert the choice in the menu ActionName 2400 2397 ActionIndex=find(strcmp(ActionName,ActionList),1); % look for the selected function in the menu Action … … 2408 2405 ActionPathList=[ActionPathList; PathName]; 2409 2406 end 2410 2407 2411 2408 % record the file extension and extend the path list if it is a new extension 2412 2409 ActionExtList=get(handles.ActionExt,'String'); … … 2423 2420 ActionIndex=ActionIndex-nbremove; 2424 2421 end 2425 2422 2426 2423 % record action menu, choice and path 2427 2424 set(handles.ActionName,'Value',ActionIndex) … … 2429 2426 set(handles.ActionName,'UserData',ActionPathList); 2430 2427 set(handles.ActionExt,'Value',ActionExtIndex) 2431 2428 2432 2429 %record the user defined menu additions in personal file profil_perso 2433 2430 dir_perso=prefdir; … … 2608 2605 msgbox_uvmat('WARNING','coordinate names do not exist in the second netcdf input file') 2609 2606 end 2610 2607 2611 2608 set(handles.FieldName_1,'Visible','on') 2612 2609 set(handles.FieldName_1,'Value',1) … … 2730 2727 if isfield(ParamOut,'FieldTransform') 2731 2728 if ~strcmp(ParamOut.FieldTransform,'off') 2732 FieldTransformVisible='on'; 2729 FieldTransformVisible='on'; 2733 2730 end 2734 2731 if iscell(ParamOut.FieldTransform) … … 2769 2766 end 2770 2767 2771 %% definition of the path for the output files 2768 %% definition of the path for the output files 2772 2769 InputTable=get(handles.InputTable,'Data'); 2773 2770 [OutputPath,Device,DeviceExt]=fileparts(InputTable{1,1}); … … 2782 2779 set(handles.OutputPath,'Visible','on') 2783 2780 set(handles.OutputPathBrowse,'Visible','on') 2784 2785 %% definition of the subdirectory containing the output files 2781 2782 %% definition of the subdirectory containing the output files 2786 2783 2787 2784 if ~(isfield(SeriesData,'ActionName') && strcmp(ActionName,SeriesData.ActionName)) … … 2812 2809 SubDirOut=InputTable{1,2}; % use the first subdir name (+OutputDirExt) as output subdirectory 2813 2810 case 'two' 2814 OutputDirVisible='on'; 2811 OutputDirVisible='on'; 2815 2812 SubDir=InputTable(1:2,2); % set of subdirectories 2816 2813 SubDirOut=SubDir{1}; … … 2892 2889 % check the existence of the first file in the series 2893 2890 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 2895 2892 first_j=Param.IndexRange.first_j; 2896 2893 last_j=Param.IndexRange.last_j; … … 2902 2899 [i1,i2,j1,j2] = get_file_index(Param.IndexRange.first_i,first_j,PairString); 2903 2900 LineIndex=iview(1); 2904 if numel(iview)>1 2901 if numel(iview)>1 2905 2902 answer=msgbox_uvmat('INPUT_TXT',['select the line of the input table:' num2str(iview)] ,num2str(iview(1))); 2906 2903 LineIndex=str2num(answer); … … 2948 2945 YName=GetFieldData.Coordinates.Coord_y; 2949 2946 TimeNameStr=GetFieldData.Time.SwitchVarIndexTime; 2950 % get the time info 2947 % get the time info 2951 2948 TimeTable=get(handles.TimeTable,'Data'); 2952 2949 switch TimeNameStr … … 2956 2953 TimeName=['att:' GetFieldData.Time.TimeName]; 2957 2954 % 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 2961 2958 TimeTable{LineIndex,5}=get_time(Param.IndexRange.MaxIndex_i(LineIndex),MaxIndex_j,PairString,InputTable,SeriesData.FileInfo{LineIndex},GetFieldData.Time.TimeName); % Max time 2962 2959 case 'variable' … … 3094 3091 set(handles.FieldName_1,'String',[FieldList; {'add_field...'}]); 3095 3092 end 3096 end 3093 end 3097 3094 3098 3095 … … 3122 3119 3123 3120 %------------------------------------------------------------------------ 3124 % --- determine the list of index pairstring of processing file 3121 % --- determine the list of index pairstring of processing file 3125 3122 function [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) 3126 3123 %------------------------------------------------------------------------ … … 3152 3149 num_j2_col=num_j+ind_shift(2); 3153 3150 % adjust the first field number 3154 indsel=find((num_j1_col >= 1)); 3151 indsel=find((num_j1_col >= 1)); 3155 3152 num_j_out=num_j(indsel); 3156 3153 num_j1_col=num_j1_col(indsel); … … 3158 3155 [num_i1,num_j1]=meshgrid(num_i,num_j1_col); 3159 3156 [num_i2,num_j2]=meshgrid(num_i,num_j2_col); 3160 end 3157 end 3161 3158 end 3162 3159 … … 3248 3245 end 3249 3246 else 3250 hset_object=findobj(allchild(0),'Tag','set_object'); 3247 hset_object=findobj(allchild(0),'Tag','set_object'); 3251 3248 if ~isempty(hset_object) 3252 3249 set(get(hset_object,'Children'),'Enable','off') 3253 end 3250 end 3254 3251 end 3255 3252 … … 3385 3382 3386 3383 %% browse transform functions with the input menu option more... 3387 if isequal(TransformName,'more...')% browse transform functions 3384 if isequal(TransformName,'more...')% browse transform functions 3388 3385 FileName=uigetfile_uvmat('Pick a transform function',get(handles.TransformPath,'String'),'.m'); 3389 3386 if isempty(FileName) … … 3403 3400 TransformPathList=[TransformPathList;{TransformPath}]; 3404 3401 else% the input function already exist, we update its path (possibly new) 3405 TransformPathList{TransformIndex}=TransformPath; % 3402 TransformPathList{TransformIndex}=TransformPath; % 3406 3403 set(handles.TransformName,'Value',TransformIndex) 3407 3404 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' 3409 3406 dir_perso=prefdir; % personal Matalb directory 3410 3407 profil_perso=fullfile(dir_perso,'uvmat_perso.mat'); … … 3413 3410 TransformListUser{ilist-nb_builtin_transform}=TransformList{ilist}; 3414 3411 TransformPathListUser{ilist-nb_builtin_transform}=TransformPathList{ilist}; 3415 end 3412 end 3416 3413 TransformPathListUser=TransformPathListUser'; 3417 3414 TransformListUser=TransformListUser'; 3418 3415 save (profil_perso,'TransformPathListUser','TransformListUser','-append'); % store the root name for future opening of uvmat 3419 end 3416 end 3420 3417 end 3421 3418 … … 3507 3504 set(handles.FieldName,'Value',1:numel(ListField)) 3508 3505 set(handles.FieldName,'Visible','on') 3509 end 3506 end 3510 3507 if isfield(Param,'ActionInput')% introduce parameters specific to an Action fct, for instance PIV parameters 3511 3508 % set(handles.ActionInput,'Visible','on') … … 3526 3523 set(handles.EditObject,'Visible','on') 3527 3524 set(handles.DeleteObject,'Visible','on') 3528 else 3525 else 3529 3526 set(handles.ProjObjectName,'String','') 3530 3527 set(handles.ProjObjectName,'Visible','off') 3531 3528 set(handles.ViewObject,'Visible','off') 3532 3529 set(handles.EditObject,'Visible','off') 3533 set(handles.DeleteObject,'Visible','off') 3534 end 3530 set(handles.DeleteObject,'Visible','off') 3531 end 3535 3532 set(handles.REFRESH,'BackgroundColor',[1 0 1]); % paint REFRESH button in magenta to indicate that it should be activated 3536 3533 … … 3590 3587 Param=read_GUI(handles.series); 3591 3588 RootPath=fullfile(Param.OutputPath,Param.Experiment,Param.Device); 3592 if ~isfield(Param,'OutputSubDir') 3589 if ~isfield(Param,'OutputSubDir') 3593 3590 msgbox_uvmat('ERROR','no standard sub-directory definition for output files, use a browser to check the output') 3594 3591 set(handles.status,'BackgroundColor',[0 1 0]) … … 3614 3611 3615 3612 3616 %------------------------------------------------------------------------ 3613 %------------------------------------------------------------------------ 3617 3614 % launched by selecting a file on the list 3618 3615 %------------------------------------------------------------------------ … … 3641 3638 set(hObject,'UserData',FullSelectName) 3642 3639 hfig=get(hObject,'parent'); 3643 htitlebox=findobj(hfig,'tag','titlebox'); 3640 htitlebox=findobj(hfig,'tag','titlebox'); 3644 3641 set(htitlebox,'String',FullSelectName) 3645 3642 elseif exist(FullSelectName,'file')%visualise the vel field if it exists 3646 FileInfo=get_file_info(FullSelectName); 3643 FileInfo=get_file_info(FullSelectName); 3647 3644 if strcmp(FileInfo.FileType,'txt') 3648 3645 edit(FullSelectName) … … 3656 3653 3657 3654 3658 %------------------------------------------------------------------------ 3655 %------------------------------------------------------------------------ 3659 3656 % launched by refreshing the status figure 3660 3657 %------------------------------------------------------------------------ … … 3711 3708 %% update the waitbar 3712 3709 hwaitbar=findobj(hfig,'tag','waitbar'); 3713 if ~isempty(NbOutputFile) 3710 if ~isempty(NbOutputFile) 3714 3711 BarPosition=get(hwaitbar,'Position'); 3715 3712 BarPosition(3)=0.9*numel(datnum)/NbOutputFile; … … 3717 3714 end 3718 3715 3719 %------------------------------------------------------------------------ 3716 %------------------------------------------------------------------------ 3720 3717 % --- Executes on selection change in ActionExt. 3721 %------------------------------------------------------------------------ 3718 %------------------------------------------------------------------------ 3722 3719 function ActionExt_Callback(hObject, eventdata, handles) 3723 3720 … … 3733 3730 3734 3731 %------------------------------------------------------------------------ 3735 % --- set the visibility of relevant velocity type menus: 3732 % --- set the visibility of relevant velocity type menus: 3736 3733 function menu=set_veltype_display(Civ,FileType) 3737 3734 %------------------------------------------------------------------------ … … 3792 3789 Bottom=ScreenSize(4)-Height-40; % put fig at top right 3793 3790 hfig=findobj(allchild(0),'Tag','set_slice'); 3794 if ~isempty(hfig),delete(hfig), end; % delete existing version of the GUI 3791 if ~isempty(hfig),delete(hfig), end; % delete existing version of the GUI 3795 3792 hfig=figure('name','set_pairs','tag','set_pairs','MenuBar','none','NumberTitle','off','Unit','points','Position',[Left,Bottom,Width,Height]); 3796 3793 BackgroundColor=get(hfig,'Color'); … … 3825 3822 viewcell=viewcell'; 3826 3823 ModeMenu={'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 3824 ModeValue=1; 3825 %i1_series,i2_series,j1_series,j2_series,mode,time,TimeUnit,ref_i,ref_j,TimeName,InputTable,FileInfo 3829 3826 % first raw of the GUI 3830 3827 uicontrol('Style','text','Units','normalized', 'Position', [0.05 0.88 0.5 0.1],'BackgroundColor',BackgroundColor,... … … 3865 3862 Mode_Callback(hObject,eventdata) 3866 3863 3867 %------------------------------------------------------------------------ 3864 %------------------------------------------------------------------------ 3868 3865 function Mode_Callback(hObject,eventdata) 3869 3866 %% get input info
Note: See TracChangeset
for help on using the changeset viewer.