Changeset 934


Ignore:
Timestamp:
Mar 25, 2016, 8:38:32 PM (8 years ago)
Author:
sommeria
Message:

browse data corrected

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/browse_data.m

    r931 r934  
    8787
    8888%% initialize the GUI
    89 if ~(exist('DataSeries','var') && exist(DataSeries,'dir'))
     89if ~(exist('DataSeries','var') && ischar(DataSeries) && exist(DataSeries,'dir'))
    9090    DataSeries=pwd;% current dir is the starting data series by default
    9191end
     
    273273        ListFiles=ListCells(1,:);%list of dir and file  names
    274274        cell_remove=regexp(ListFiles,'^(-|\.|\+/\.)');% detect strings beginning by '-' ,'.' or '+/.'(dir beginning by . )
    275         check_keep=cellfun('isempty', cell_remove);
     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);
    276277        check_dir=cell2mat(ListCells(4,:));% =1 for directories, =0 for files
    277278        for ilist=1:numel(ListFiles)
     
    282283                else %update the list of dataSeries
    283284                    [tild,msg]=fileattrib(mirror);
     285                    msg.Name=regexprep(msg.Name,'^/.','/');%remove the dot in /. at the beginning of the name
    284286                    if ~strcmp(msg.Name,mirror)% if it is a link
    285287                        ListFiles{ilist}=['~' ListFiles{ilist}];%mark link by '@' in the list
  • trunk/src/series.m

    r932 r934  
    469469RootPathCell=InputTable(:,1);
    470470SubDirCell=InputTable(:,2);
    471 oldfile=fullfile(RootPathCell{1},SubDirCell{1});
     471oldfile=fullfile(InputTable{1,1},InputTable{1,2});
    472472if isempty(oldfile)
    473473    % use a file name stored in prefdir
     
    481481    end
    482482end
    483 %% launch the browser
    484 fileinput=uigetfile_uvmat('pick an input file in the series',oldfile);
    485 hh=dir(fileinput);
    486 if numel(hh)>1
    487     msgbox_uvmat('ERROR','invalid input, probably a broken link');
    488 else
    489     if ~isempty(fileinput)
    490         display_file_name(handles,fileinput,'one')
    491     end
    492 end
    493 append='one';
    494 set(handles.MenuOpenCampaign,'ForegroundColor',[1 1 0])
    495 drawnow
    496 browse_campaign(handles,append);
     483
     484OutPut=browse_data(oldfile,'on','on');% open the GUI browse_data to get select a campaign dir, experiment and device
     485NbLines=numel(OutPut.Experiment)*numel(OutPut.DataSeries);
     486icount=0;
     487for iexp=1:numel(OutPut.Experiment)
     488    for idevice=1:numel(OutPut.DataSeries)
     489        icount=icount+1;
     490        InputTable{icount,1}=fullfile(OutPut.Campaign,OutPut.Experiment{iexp});
     491        InputTable{icount,2}=OutPut.DataSeries{idevice};
     492        if isempty(InputTable{icount,3})
     493            if icount>1
     494            InputTable{icount,3}=InputTable{icount-1,3};
     495            else
     496                InputTable{icount,3}='';
     497            end
     498        end
     499        if isempty(InputTable{icount,4})
     500            if icount>1
     501            InputTable{icount,4}=InputTable{icount-1,4};
     502            else
     503                InputTable{icount,4}='';
     504            end
     505        end
     506                if isempty(InputTable{icount,5})
     507            if icount>1
     508            InputTable{icount,5}=InputTable{icount-1,5};
     509            else
     510                InputTable{icount,5}='';
     511            end
     512        end
     513    end
     514end
     515if size(InputTable,1)>icount
     516    InputTable(icount+1:size(InputTable,1),:)=[];
     517end
     518set(handles.InputTable,'Data',InputTable)
     519REFRESH_Callback(hObject, eventdata, handles)
     520% DataSeries=fullfile(OutPut.Campaign,OutPut.Experiment{1},OutPut.DataSeries{1});
     521% fileinput=uigetfile_uvmat('pick an input file',DataSeries);
     522% hh=dir(fileinput);
     523% if numel(hh)>1
     524%     msgbox_uvmat('ERROR','invalid input, probably a broken link');
     525%     return
     526% end
     527%
     528%
     529%
     530% %% launch the browser
     531% fileinput=uigetfile_uvmat('pick an input file in the series',oldfile);
     532% hh=dir(fileinput);
     533% if numel(hh)>1
     534%     msgbox_uvmat('ERROR','invalid input, probably a broken link');
     535% else
     536%     if ~isempty(fileinput)
     537%         display_file_name(handles,fileinput,'one')
     538%     end
     539% end
     540% append='one';
     541% set(handles.MenuOpenCampaign,'ForegroundColor',[1 1 0])
     542% drawnow
     543% browse_campaign(handles,append);
    497544
    498545%------------------------------------------------------------------------
     
    14861533errormsg='';%default error message
    14871534xmlfile=fullfile(path_series,'PARAM.xml');
    1488 %test_batch=0;%default: ,no batch mode available
    14891535if ~exist(xmlfile,'file')
    14901536    [success,message]=copyfile(fullfile(path_series,'PARAM.xml.default'),xmlfile);
     
    15051551end
    15061552ActionFullName=fullfile(get(handles.ActionPath,'String'),ActionName);
    1507 %% If a compiled version has been selected (ext .sh) check weather it needs to be recompiled
     1553
     1554%% If a compiled version has been selected (ext .sh) check wether it needs to be recompiled
    15081555if strcmp(ActionExt,'.sh')
    15091556    TransformPath='';
     
    15151562    [mcrmajor, mcrminor] = mcrversion;   
    15161563    MCRROOT = ['MCRROOT',int2str(mcrmajor),int2str(mcrminor)];
    1517     %hver=ver('MATLAB');
    1518     %MCRROOT=['MCRROOT' regexprep(hver.Version,'\.','')];%suppress the dot in version number
    15191564    RunTime = getenv(MCRROOT);
    15201565    ActionNameVersion=[ActionName '_' MCRROOT];
    15211566    ActionFullName=fullfile(get(handles.ActionPath,'String'),[ActionNameVersion '.sh']);
     1567    % compile the .m file if the .sh file does not exist yet
    15221568    if ~exist(ActionFullName,'file')
    15231569        answer=msgbox_uvmat('INPUT_Y-N','compiled version has not been created: compile now?');
     
    15521598        end
    15531599    end
     1600
    15541601    set(handles.ActionExt,'BackgroundColor',[1 1 1])
    15551602     set(handles.series,'Pointer','arrow') % set the mouse pointer to 'watch
     
    17741821    if isempty(Param.IndexRange.NbSlice)
    17751822        Param.IndexRange.first_i=first_i+(iprocess-1)*BlockLength*incr_i;
    1776         %         Param.IndexRange.first_i=ref_i(1+(iprocess-1)*BlockLength);
    17771823        if Param.IndexRange.first_i>last_i
    17781824            NbProcess=iprocess-1;% leave the loop, we are at the end of the calculation
    17791825            break
    17801826        end
    1781         %Param.IndexRange.last_i=min(ref_i(iprocess*BlockLength),last_i);
    1782         %Param.IndexRange.last_i=min(first_i+(iprocess)*BlockLength*incr_i-1,last_i);
    17831827        Param.IndexRange.last_i=min(last_i,first_i+(iprocess)*BlockLength*incr_i-1);
    17841828    else %multislices (then incr_i is not empty)
    1785         %         Param.IndexRange.first_i= first_i+incr_i*(iprocess-1);
    1786         %         Param.IndexRange.incr_i=incr_i*Param.IndexRange.NbSlice;
    17871829        Param.IndexRange.first_i= first_i+iprocess-1;
    17881830        Param.IndexRange.incr_i=incr_i*Param.IndexRange.NbSlice;
     
    17911833        Param.InputTable{ilist,1}=regexprep(Param.InputTable{ilist,1},'\','/');%correct path name for PCWIN system
    17921834    end
    1793    
    1794     %         if isempty(Param.IndexRange.NbSlice)% process by blocks of i index
    1795     %             Param.IndexRange.first_i=first_i+(iprocess-1)*BlockLength*incr_i;
    1796     %             if Param.IndexRange.first_i>last_i
    1797     %                 NbProcess=iprocess-1;
    1798     %                 break% leave the loop, we are at the end of the calculation
    1799     %             end
    1800     %             Param.IndexRange.last_i=min(last_i,first_i+(iprocess)*BlockLength*incr_i-1);
    1801     %         else% process by slices of i index if NbSlice is defined, computation in a single process if NbSlice =1
    1802     %             Param.IndexRange.first_i= first_i+iprocess-1;
    1803     %             Param.IndexRange.incr_i=incr_i*Param.IndexRange.NbSlice;
    1804     %         end
    1805    
    18061835   
    18071836    if isfield(Param,'OutputSubDir')
     
    18191848            end
    18201849        end
    1821         %         [success,msg] = fileattrib(filexml{iprocess},'+w','g');% allow writing access for the group of users, recursively in the folder
    1822         %     if success==0
    1823         %         msgbox_uvmat('WARNING',{['unable to set group write access to ' filexml{iprocess} ':']; msg});%error message for directory creation
    1824         %     end
    18251850    end
    18261851    if strcmp (RunMode,'local')
     
    18401865    end
    18411866end
    1842 % [success,msg] = fileattrib(DirXml,'+w','g','s');% allow writing access for the group of users, recursively in the folder
    1843 %     if success==0
    1844 %         msgbox_uvmat('WARNING',{['unable to set group write access to ' DirXml ':']; msg});%error message for directory creation
    1845 %     end
     1867
    18461868if ~strcmp (RunMode,'local') && ~strcmp(RunMode,'python')
    18471869    %% processing on a different session of the same computer (background) or cluster, create executable files
     
    18791901        first_i,last_i,first_j,last_j);
    18801902    filelog_global=fullfile(OutputDir,'0_LOG',filelog_global);
    1881    
    1882     %     [success,msg] = fileattrib(DirLog,'+w','g','s');% allow writing access for the group of users, recursively in the folder
    1883     %     if success==0
    1884     %         msgbox_uvmat('WARNING',{['unable to set group write access to ' DirLog ':']; msg});%error message for directory creation
    1885     %     end
    1886     %     [success,msg] = fileattrib(fullfile(OutputDir,'0_EXE'),'+w','g','s');% allow writing access for the group of users, recursively in the folder
    1887     %     if success==0
    1888     %         msgbox_uvmat('WARNING',{['unable to set group write access to ' fullfile(OutputDir,'0_EXE') ':']; msg});%error message for directory creation
    1889     %     end
    1890     %
     1903
    18911904    for iprocess=1:NbProcess
    18921905       
     
    18941907       
    18951908        batch_file_list{iprocess}=fullfile(OutputDir,'0_EXE',regexprep(extxml{iprocess},'.xml$',ExeExt));
    1896         %         [fid,message]=fopen(batch_file_list{iprocess},'w');% create the executable file
    1897         %         if isequal(fid,-1)
    1898         %             errormsg=['creation of ' batch_file_list{iprocess} ':' message];
    1899         %             return
    1900         %         end
    19011909       
    19021910        % set the log file name
     
    19581966                                'hostname && date \n '...
    19591967                                'umask 002 \n'...
    1960                                 ActionFullName ' ' RunTime ' ' filexml];%allow writting access to created files for user group
     1968                                ActionFullName ' ' RunTime ' ' filexml{iprocess}];%allow writting access to created files for user group
    19611969                            fprintf(fid,cmd);%fill the executable file with the  char string cmd
    19621970                            fclose(fid);% close the executable file
     
    19791987                return
    19801988            end
    1981             %             [success,msg] = fileattrib(batch_file_list{iprocess},'+w','g');% allow writing access for the group of users, recursively in the folder
    1982             %     if success==0
    1983             %         msgbox_uvmat('WARNING',{['unable to set group write access to ' batch_file_list{iprocess} ':']; msg});%error message for directory creation
    1984             %     end
    19851989            if  strcmp(ActionExt,'.sh')
    19861990                cmd=['#!/bin/bash \n '...
     
    20202024        filename_joblist=fullfile(DirOAR,'job_list.txt');% name of the file containing the list of executables
    20212025        fid=fopen(filename_joblist,'w');%open it for writting
    2022         %         [success,msg] = fileattrib(filename_joblist,'+w','g');% allow writing access for the group of users,
    20232026        for iprocess=1:length(batch_file_list)
    20242027            fprintf(fid,[batch_file_list{iprocess} '\n']);% write list of exe files
     
    20532056            '-l ' filename_joblist '.log"'];
    20542057       
    2055        
    2056        
    20572058        fprintf(oar_command);% display  system command on the Matlab command window
    20582059        [status,result]=system(oar_command)% execute system command and show the result (ID number of the launched job) on the Matlab command window
     
    20632064        fclose(fid);
    20642065        msgbox_uvmat('CONFIRMATION',[ActionFullName ' launched as  ' num2str(NbProcess) ' processes in cluster: press STATUS to see results'])
    2065         %         [success,msg] = fileattrib(DirOAR,'+w','g','s');% allow writing access for the group of users, recursively in the folder
    2066         %     if success==0
    2067         %         msgbox_uvmat('WARNING',{['unable to set group write access to ' DirOAR ':']; msg});%error message for directory creation
    2068         %     end
    20692066       
    20702067    case 'cluster_pbs' % for LMFA Kepler machine
     
    21212118    end
    21222119end
     2120
    21232121%------------------------------------------------------------------------
    21242122function STOP_Callback(hObject, eventdata, handles)
     
    21282126set(handles.RUN,'enable','on')
    21292127set(handles.RUN, 'Value',0)
    2130 
    21312128
    21322129%------------------------------------------------------------------------
  • trunk/src/uvmat.m

    r931 r934  
    488488% -----------------------------------------------------------------------
    489489function MenuBrowseCampaign_Callback(hObject, eventdata, handles)
    490 set(handles.MenuOpenCampaign,'ForegroundColor',[1 1 0])
    491 drawnow
     490% set(handles.MenuOpenCampaign,'ForegroundColor',[1 1 0])
     491% drawnow
    492492[RootPath,SubDir,RootFile,FileIndices,FileExt]=read_file_boxes(handles);
    493493DataSeries=fullfile(RootPath,SubDir);
    494494if isempty(DataSeries) %loads the previously stored file name and set it as default in the file_input box
    495495    DataSeries=get(handles.RootPath,'UserData');
    496 end
    497 % RootPath=get(handles.RootPath,'String');
    498 % if isempty(RootPath)
    499 %     RootPath=get(handles.RootPath,'UserData');%use Rootpath recored from the personal file at uvmat opening
    500 % end
    501 % CampaignPath=fileparts(fileparts(RootPath));
    502 % DirFull=uigetfile_uvmat('define this path as the Campaign folder:',CampaignPath,'uigetdir');
    503 % %DirFull = uigetdir(CampaignPath,'Select a Campaign dir, then press OK');
    504 % if isempty(DirFull)
    505 %     return
    506 % end
    507 if isempty(DataSeries)||~ischar(DataSeries)
    508     DataSeries=pwd;
    509496end
    510497OutPut=browse_data(DataSeries,'on');% open the GUI browse_data to get select a campaign dir, experiment and device
Note: See TracChangeset for help on using the changeset viewer.