Changeset 1068 for trunk/src/series.m
- Timestamp:
- Jul 9, 2019, 10:10:18 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series.m
r1067 r1068 1594 1594 end 1595 1595 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 1597 NbExp=1;% initiate the number of experiments set by the GUI browse_data, =1 otherwise 1600 1598 if get(handles.Replicate,'Value') 1599 set(handles.Replicate,'BackgroundColor',[1 1 0])%paint Relicate button in yellow 1601 1600 hh=findobj(allchild(0),'Tag','browse_data'); 1602 1601 BrowseData=guidata(hh); 1603 1602 SourceDir=get(BrowseData.SourceDir,'String'); 1604 1603 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 1638 end 1639 % set(handles.OutputSubDir,'String',SubDir) 1640 % Param.OutputSubDir=SubDir; 1613 1641 %%%%%%%%%%%%%%%%%%% LOOP ON EXPERIMENTS POSSIBLY SET BY THE GUI browse_data, NbExp=1 otherwise %%%%%%%%% 1614 1642 for 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}); 1618 1656 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 1619 1657 Param.IndexRange.last_i=str2num(get(handles.num_last_i,'String')); … … 1621 1659 OutputDir=''; 1622 1660 answer=''; 1623 if isfield(Param,'OutputSubDir') 1661 if isfield(Param,'OutputSubDir')% possibly update the output dir if it already exists 1624 1662 SubDirOut=[get(handles.OutputSubDir,'String') Param.OutputDirExt]; 1625 1663 SubDirOutNew=SubDirOut; … … 1659 1697 Param.OutputRootFile=Param.InputTable{1,3}; % the first sorted RootFile taken for output 1660 1698 set(handles.OutputDirExt,'String',Param.OutputDirExt) 1661 OutputDir=fullfile(Param.InputTable{1,1},[Param.OutputSubDir Param.OutputDirExt]) ;% full name (with path) of output directory1699 OutputDir=fullfile(Param.InputTable{1,1},[Param.OutputSubDir Param.OutputDirExt]) % full name (with path) of output directory 1662 1700 if check_create % create output directory if it does not exist 1663 1701 [tild,msg1]=mkdir(OutputDir); … … 1677 1715 errormsg=['cannot create ' DirXml ': ' msg1]; % error message for directory creation 1678 1716 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 1679 1721 end 1680 1722 end … … 1861 1903 return 1862 1904 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 1863 1909 end 1864 1910 %create subdirectory for log files … … 1869 1915 errormsg=['cannot create ' DirLog ': ' msg1]; % error message for directory creation 1870 1916 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 1871 1921 end 1872 1922 end … … 2024 2074 fclose(fid); 2025 2075 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']) 2027 2077 else 2028 msgbox_uvmat('ERROR',result)2078 msgbox_uvmat('ERROR',result) 2029 2079 end 2030 2080 % case 'cluster_pbs' % for LMFA Kepler machine: trqnsferred to fct … … 2144 2194 end 2145 2195 end 2196 set(handles.Replicate,'BackgroundColor',[0 1 0]) 2197 if NbExp>1 2198 set(handles.REFRESH,'BackgroundColor',[1 0 1])% set REFRESH button to magenta (input file features need to be updated) 2199 end 2146 2200 %------------------------------------------------------------------------ 2147 2201 function STOP_Callback(hObject, eventdata, handles) … … 2160 2214 Param=read_GUI(handles.series); 2161 2215 2162 %% clean the output structure by removing unused information 2216 %% clean the output structure by removing unused information 2163 2217 if isfield(Param,'Pairs') 2164 2218 Param=rmfield(Param,'Pairs'); % info Pairs not needed for output … … 2203 2257 ActionList=get(handles.ActionName,'String'); % list menu fields 2204 2258 ActionIndex=get(handles.ActionName,'Value'); 2205 if ~isequal(ActionIndex,1)% if we are not just opening series 2259 if ~isequal(ActionIndex,1)% if we are not just opening series 2206 2260 InputTable=get(handles.InputTable,'Data'); 2207 2261 if isempty(InputTable{1,4}) … … 2301 2355 2302 2356 set(handles.ActionInput,'BackgroundColor',[1 1 0]) 2357 SeriesData=get(handles.series,'UserData'); % info on the input file series 2303 2358 2304 2359 %% create the function handle for Action … … 2308 2363 if ~exist(ActionPath,'dir') 2309 2364 ActionName_Callback(handles.ActionName, ActionPath, handles)% update the function 2310 % msgbox_uvmat('ERROR',['The prescribed function path ' ActionPath ' does not exist']);2311 2365 return 2312 2366 end … … 2319 2373 Param=read_GUI_series(handles); % read the parameters from the GUI series 2320 2374 Param.Action.RUN=0; 2375 Param.SeriesData=SeriesData; 2321 2376 ParamOut=h_fun(Param); % run the selected Action function to get the relevant input 2322 2377 … … 2337 2392 2338 2393 %% 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 series2340 2394 iview_civ=find(strcmp('civx',SeriesData.FileType)|strcmp('civdata',SeriesData.FileType)); 2341 2395 iview_netcdf=find(strcmp('netcdf',SeriesData.FileType)|strcmp('civx',SeriesData.FileType)|strcmp('civdata',SeriesData.FileType)); % all nc files, icluding civ … … 2469 2523 set(handles.MinIndex_j,'Data',MinIndex_j(iview,:)); 2470 2524 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,:));; 2472 2526 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 2474 2533 PairString=get(handles.PairString,'Data'); 2475 2534 set(handles.PairString,'Data',PairString(iview,:));
Note: See TracChangeset
for help on using the changeset viewer.