Changeset 984 for trunk/src


Ignore:
Timestamp:
Jan 18, 2017, 3:37:05 PM (4 years ago)
Author:
sommeria
Message:

introduce .cine in various functions, improve stero PIV

Location:
trunk/src
Files:
21 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/series.m

    r983 r984  
    155155    set(handles.CPUTime_txt,'Visible','on'); % make visible button for access to Monika
    156156end
    157 [s,w]=system('qstat --version');% look for cluster system 'sge'
     157[s,w]=system('qstat -help');% look for cluster system 'sge'
    158158if isequal(s,0)
    159159    if regexp(w,'^pbs')
    160160        RunModeList=[RunModeList;{'cluster_pbs'}];
     161    elseif regexp(w,'^SGE')
     162        RunModeList=[RunModeList;{'cluster_sge'}];
    161163    else
    162         RunModeList=[RunModeList;{'cluster_sge'}];
    163     end
    164 end
    165 set(handles.RunMode,'String',RunModeList)
     164        RunModeList=[RunModeList;{'cluster_qstat_unknown'}];
     165    end
     166end
     167set(handles.RunMode,'String',RunModeList)% display the menu of available run modes, local, background or cluster manager
    166168
    167169%% list of builtin transform functions in the menu TransformName
     
    15021504    if exist(xmlfile,'file')
    15031505        s=xml2struct(xmlfile);
    1504         if strcmp(RunMode,'cluster_oar') && isfield(s,'BatchParam')
     1506        if (strcmp(RunMode,'cluster_oar') || strcmp(RunMode, 'cluster_pbs') || strcmp(RunMode, 'cluster_sge')) && isfield(s,'BatchParam')
    15051507            if isfield(s.BatchParam,'NbCore')
    15061508                NbCore=s.BatchParam.NbCore;
     
    15911593            extra_oar=answer{2};
    15921594 %       end
    1593     case 'cluster_pbs'
     1595    case {'cluster_pbs', 'cluster_sge', 'cluster_qstat_unknown'}
    15941596        if strcmp(ActionExt,'.m')% case of Matlab function (uncompiled)
    15951597            NbCore=1;% one core used only (limitation of Matlab licences)
     
    16011603            extra_oar='';
    16021604        else
    1603             answer=inputdlg({'Number of cores (max 36)','extra oar options'},'oarsub parameter',1,{'12',''});
     1605            answer=inputdlg({'Number of jobs (max 1000)','Queue'},'qsub parameters',1,{'100','piv_debian'});
    16041606            NbCore=str2double(answer{1});
     1607            qstat_Queue=answer{2};
    16051608            %extra_oar=answer{2};%TODO : fix this for LMFA cluster. Maybe
    16061609            %extrs_oar and extra_pbs are not the best names
     
    17291732NbProcess=1;
    17301733switch RunMode
    1731     case {'cluster_oar','cluster_pbs'}
     1734    case {'cluster_oar','cluster_pbs','cluster_sge','cluster_qstat_unknown'}
    17321735        if isempty(Param.IndexRange.NbSlice)% if NbSlice is not defined
    17331736            BlockLength= ceil(20/(CPUTime*nbfield_j));% short iterations are grouped such that the minimum time of a process is 20 min.
     
    20592062        fclose(fid);
    20602063        system(['chmod +x ' filename_joblist]);% set the file to executable
    2061         pbs_command=['qstat -n CIVX '...
     2064        pbs_command=['qsub -n CIVX '...
    20622065            '-t idempotent --checkpoint ' num2str(walltime_onejob+60) ' '...
    20632066            '-l /core=' num2str(NbCore) ','...
     
    20652068            '-E ' regexprep(filename_joblist,'\.txt\>','.stderr') ' '...
    20662069            '-O ' regexprep(filename_joblist,'\.txt\>','.log') ' '...
    2067             extra_oar ' '...
     2070            extra_qstat ' '...
    20682071            '"oar-parexec -s -f ' filename_joblist ' '...
    20692072            '-l ' filename_joblist '.log"'];
     
    20752078        %system(pbs_command);
    20762079        msgbox_uvmat('CONFIRMATION',[ActionFullName ' command ready to be launched in cluster'])
     2080
     2081     case 'cluster_sge' % for PSMN
     2082        % Au PSMN, on ne crée pas 1 job avec plusieurs cœurs, mais N jobs de 1 cœurs
     2083        % où N < 1000.
     2084        %create subdirectory for pbs command and log files
     2085
     2086        DirSGE=fullfile(OutputDir,'0_SGE');
     2087        if exist(DirSGE,'dir')% delete the content of the dir 0_LOG to allow new input
     2088            curdir=pwd;
     2089            cd(DirSGE)
     2090            delete('*')
     2091            cd(curdir)
     2092        else
     2093            [tild,msg1]=mkdir(DirSGE);
     2094            if ~strcmp(msg1,'')
     2095                errormsg=['cannot create ' DirSGE ': ' msg1];%error message for directory creation
     2096                return
     2097            end
     2098        end
     2099        maxImgsPerJob = ceil(length(batch_file_list)/NbCore);
     2100        disp(['Max number of jobs: ' num2str(NbCore)])
     2101        disp(['Images per job: ' num2str(maxImgsPerJob)])
     2102       
     2103        iprocess = 1;
     2104        imgsInJob = [];
     2105        currJobIndex = 1;
     2106        done = 0;
     2107        while(~done)
     2108            if(iprocess <= length(batch_file_list))
     2109                imgsInJob = [imgsInJob, iprocess];
     2110            end
     2111            if((numel(imgsInJob) >= maxImgsPerJob) || (iprocess == length(batch_file_list)))
     2112                cmd=['#!/bin/sh \n'...
     2113                     '#$ -cwd \n'...
     2114                     'hostname && date\n']
     2115                for ii=1:numel(imgsInJob)
     2116                    cmd=[cmd ActionFullName ' /softs/matlab ' filexml{imgsInJob(ii)} '\n'];
     2117                end
     2118                [fid, message] = fopen([DirSGE '/job' num2str(currJobIndex) '.sh'], 'w');
     2119                fprintf(fid, cmd);
     2120                fclose(fid);
     2121                system(['chmod +x ' DirSGE '/job' num2str(currJobIndex) '.sh'])
     2122                sge_command=['qsub -N civ_' num2str(currJobIndex) ' '...
     2123                    '-q ' qstat_Queue ' '...
     2124                    '-e ' fullfile([DirSGE '/job' num2str(currJobIndex) '.out']) ' '...
     2125                    '-o ' fullfile([DirSGE '/job' num2str(currJobIndex) '.out']) ' '...
     2126                    fullfile([DirSGE '/job' num2str(currJobIndex) '.sh'])];
     2127                fprintf(sge_command);% display in command line
     2128                [status, result] = system(sge_command);
     2129                fprintf(result);
     2130                currJobIndex = currJobIndex + 1;
     2131                imgsInJob = [];
     2132            end
     2133            if(iprocess == length(batch_file_list))
     2134                done = 1;
     2135            end
     2136            iprocess = iprocess + 1;
     2137        end
     2138        msgbox_uvmat('CONFIRMATION',[num2str(currJobIndex-1) ' jobs launched on queue ' qstat_Queue '.'])
    20772139    case 'python'
    20782140        command = [
     
    23562418            end
    23572419        end
     2420    else
     2421        set(handles.FieldName,'Visible','off')
    23582422    end
    23592423   
     
    23822446            end
    23832447            if warn_coord
    2384                 msgbox_uvmat('WARNING','coordiante names do not exist in the second netcdf input file')
     2448                msgbox_uvmat('WARNING','coordinate names do not exist in the second netcdf input file')
    23852449            end
    23862450           
  • trunk/src/series/aver_stat.m

    r977 r984  
    167167
    168168%% determine the file type on each line from the first input file
    169 ImageTypeOptions={'image','multimage','mmreader','video'};
     169ImageTypeOptions={'image','multimage','mmreader','video','cine_phantom'};
    170170NcTypeOptions={'netcdf','civx','civdata'};
    171171for iview=1:NbView
  • trunk/src/series/beam_forming.m

    r977 r984  
    9393
    9494%% determine the file type on each line from the first input file
    95 ImageTypeOptions={'image','multimage','mmreader','video'};
     95ImageTypeOptions={'image','multimage','mmreader','video','cine_phantom'};
    9696NcTypeOptions={'netcdf','civx','civdata'};
    9797for iview=1:NbView
  • trunk/src/series/check_data_files.m

    r977 r984  
    108108
    109109%determine the file type on each line from the first input file
    110 ImageTypeOptions={'image','multimage','mmreader','video'};
     110ImageTypeOptions={'image','multimage','mmreader','video','cine_phantom'};
    111111NcTypeOptions={'netcdf','civx','civdata'};
    112112for iview=1:nbview
  • trunk/src/series/check_peaklock.m

    r977 r984  
    125125
    126126%determine the file type on each line from the first input file
    127 ImageTypeOptions={'image','multimage','mmreader','video'};
     127ImageTypeOptions={'image','multimage','mmreader','video','cine_phantom'};
    128128NcTypeOptions={'netcdf','civx','civdata'};
    129129for iview=1:nbview
     
    528528Integ(izero)=min(Integ(inonzero));
    529529aa=log(Integ);%initial guess for a coeff
    530 spli=spline4(aa,mini,nbb);  %appel à la fonction spline4
     530spli=spline4(aa,mini,nbb);  %appel ï¿œ la fonction spline4
    531531histsmooth=exp(spli);
    532532
     
    581581
    582582%data
    583 % n=10;% résolution de la pdf: nbre de points par unite de u
     583% n=10;% rï¿œsolution de la pdf: nbre de points par unite de u
    584584% mini=-10.0;%general mini=uint16(min(values)-1 CHOOSE maxi-mini+1 EVEN
    585585% maxi=9.0; % general maxi=uint16(max(values))+1
     
    588588nint=siz(2);
    589589maxi=mini+nint-1;
    590 npdf=nint*n;% nbre total d'intervals à introduire dans la pdf: hist(u,npdf)
     590npdf=nint*n;% nbre total d'intervals ï¿œ introduire dans la pdf: hist(u,npdf)
    591591%simulation de pdf
    592592xfin=[mini-0.5+1/(2*n):(1/n):maxi+0.5-(1/(2*n))];% valeurs d'interpolation: we take n values in each integer interval
  • trunk/src/series/civ2vel_3C.m

    r981 r984  
    335335    for iview=1:2
    336336        %% reading PIV input file(s)
    337         [Data{iview},tild,errormsg]=read_civdata(filecell{iview,field_index},{'vec(U,V)'},'*');
     337        [Data{iview},tild,errormsg]=read_civdata(filecell{iview,field_index},{'vec(U,V)'},Param.InputFields.VelType);
    338338        if ~isempty(errormsg)
    339339            disp_uvmat('ERROR',['ERROR in civ2vel_3C/read_field/' errormsg],checkrun)
  • trunk/src/series/float_tracking.m

    r977 r984  
    2020% global hfig1 hfig2 scalar
    2121% global Abackg nbpart lum diam
    22 %%%%%%%%%%%%%%ù
     22%%%%%%%%%%%%%%ï¿œ
    2323%
    2424%%%%%%%%%%% GENERAL TO ALL SERIES ACTION FCTS %%%%%%%%%%%%%%%%%%%%%%%%%%%
     
    147147[FileInfo,VideoObject]=get_file_info(filecell{1,1});
    148148FileType=FileInfo.FileType;
    149 ImageTypeOptions={'image','multimage','mmreader','video'};
     149ImageTypeOptions={'image','multimage','mmreader','video','cine_phantom'};
    150150if isempty(find(strcmp(FileType,ImageTypeOptions)))
    151151    disp('input file not images')
  • trunk/src/series/ima_threshold.m

    r977 r984  
    154154[FileInfo,VideoObject]=get_file_info(filecell{1,1});
    155155FileType=FileInfo.FileType;
    156 ImageTypeOptions={'image','multimage','mmreader','video'};
     156ImageTypeOptions={'image','multimage','mmreader','video','cine_phantom'};
    157157if isempty(find(strcmp(FileType,ImageTypeOptions)))
    158158    disp('input file not images')
  • trunk/src/series/merge_proj.m

    r977 r984  
    134134
    135135%% determine the file type on each line from the first input file
    136 ImageTypeOptions={'image','multimage','mmreader','video'};
     136ImageTypeOptions={'image','multimage','mmreader','video','cine_phantom'};
    137137NcTypeOptions={'netcdf','civx','civdata'};
    138138for iview=1:NbView
  • trunk/src/series/merge_proj_polar.m

    r977 r984  
    162162
    163163%% determine the file type on each line from the first input file
    164 ImageTypeOptions={'image','multimage','mmreader','video'};
     164ImageTypeOptions={'image','multimage','mmreader','video','cine_phantom'};
    165165NcTypeOptions={'netcdf','civx','civdata'};
    166166for iview=1:NbView
  • trunk/src/series/merge_proj_polar_multifile.m

    r977 r984  
    165165
    166166%% determine the file type on each line from the first input file
    167 ImageTypeOptions={'image','multimage','mmreader','video'};
     167ImageTypeOptions={'image','multimage','mmreader','video','cine_phantom'};
    168168NcTypeOptions={'netcdf','civx','civdata'};
    169169for iview=1:NbView
  • trunk/src/series/merge_proj_polar_singlefile.m

    r977 r984  
    212212
    213213%% determine the file type on each line from the first input file
    214 ImageTypeOptions={'image','multimage','mmreader','video'};
     214ImageTypeOptions={'image','multimage','mmreader','video','cine_phantom'};
    215215NcTypeOptions={'netcdf','civx','civdata'};
    216216for iview=1:NbView
  • trunk/src/series/particle_tracking.m

    r977 r984  
    2020% global hfig1 hfig2 scalar
    2121% global Abackg nbpart lum diam
    22 %%%%%%%%%%%%%%ù
     22%%%%%%%%%%%%%%ï¿œ
    2323%
    2424%%%%%%%%%%% GENERAL TO ALL SERIES ACTION FCTS %%%%%%%%%%%%%%%%%%%%%%%%%%%
     
    147147[FileInfo,VideoObject]=get_file_info(filecell{1,1});
    148148FileType=FileInfo.FileType;
    149 ImageTypeOptions={'image','multimage','mmreader','video'};
     149ImageTypeOptions={'image','multimage','mmreader','video','cine_phantom'};
    150150if isempty(find(strcmp(FileType,ImageTypeOptions)))
    151151    disp('input file not images')
  • trunk/src/series/stereo_civ.m

    r977 r984  
    244244
    245245%% get timing from input video
    246 if isempty(time) && ~isempty(find(strcmp(FileType_A,{'mmreader','video'})))% case of video input
     246if isempty(time) && ~isempty(find(strcmp(FileType_A,{'mmreader','video','cine_phantom'})))% case of video input
    247247    time=zeros(FileInfo_A.NumberOfFrames+1,2);
    248248    time(:,2)=(0:1/FileInfo_A.FrameRate:(FileInfo_A.NumberOfFrames)/FileInfo_A.FrameRate)';
  • trunk/src/series/stereo_input.m

    r977 r984  
    111111iview_image=1;%line # for the input images
    112112switch FileType
    113     case {'image','multimage','video','mmreader','netcdf'}
     113    case {'image','multimage','video','mmreader','cine_phantom','netcdf'}
    114114%         NomTypeImaA=NomTypeInput;
    115115%         iview_image=1;%line # for the input images
  • trunk/src/series/sub_background.m

    r977 r984  
    107107
    108108    %% check the validity of  input file types
    109     ImageTypeOptions={'image','multimage','mmreader','video'};%allowed input file types(images)
     109    ImageTypeOptions={'image','multimage','mmreader','video','cine_phantom'};%allowed input file types(images)
    110110    FileInfo=get_file_info(FirstFileName);
    111111    FileType=FileInfo.FileType;
  • trunk/src/series/time_series.m

    r977 r984  
    170170
    171171%% determine the file type on each line from the first input file
    172 ImageTypeOptions={'image','multimage','mmreader','video'};
     172ImageTypeOptions={'image','multimage','mmreader','video','cine_phantom'};
    173173NcTypeOptions={'netcdf','civx','civdata'};
    174174FileType=cell(1,NbView);
  • trunk/src/series/turb_correlation.m

    r977 r984  
    114114
    115115%% determine the file type on each line from the first input file
    116 ImageTypeOptions={'image','multimage','mmreader','video'};
     116ImageTypeOptions={'image','multimage','mmreader','video','cine_phantom'};
    117117NcTypeOptions={'netcdf','civx','civdata'};
    118118for iview=1:NbView
  • trunk/src/series/turb_stat.m

    r977 r984  
    114114
    115115%% determine the file type on each line from the first input file
    116 ImageTypeOptions={'image','multimage','mmreader','video'};
     116ImageTypeOptions={'image','multimage','mmreader','video','cine_phantom'};
    117117NcTypeOptions={'netcdf','civx','civdata'};
    118118for iview=1:NbView
  • trunk/src/series/usr_fct/merge_proj_images.m

    r977 r984  
    6060
    6161%% set the input elements needed on the GUI series when the function is selected in the menu ActionName or InputTable refreshed
    62 ImageTypeOptions={'image','multimage','mmreader','video'};
     62ImageTypeOptions={'image','multimage','mmreader','video','cine_phantom'};
    6363if isstruct(Param) && isequal(Param.Action.RUN,0)
    6464    ParamOut.AllowInputSort='off';% allow alphabetic sorting of the list of input file SubDir (options 'off'/'on', 'off' by default)
     
    141141
    142142%% determine the file type on each line from the first input file
    143 ImageTypeOptions={'image','multimage','mmreader','video'};
     143ImageTypeOptions={'image','multimage','mmreader','video','cine_phantom'};
    144144NcTypeOptions={'netcdf','civx','civdata'};
    145145for iview=1:NbView
  • trunk/src/uvmat.m

    r982 r984  
    35203520end
    35213521%put W as background image by default if NbDim=2:
    3522 if  UvData.NewSeries && isequal(get(handles.SubField,'Value'),0) && isfield(Field{1},'W') && ~isempty(Field{1}.W) && ~isequal(Field{1}.NbDim,3);
    3523         set(handles.SubField,'Value',1);
    3524         set(handles.RootPath_1,'String','"')
    3525         set(handles.RootFile_1,'String','"')
    3526         set(handles.SubDir_1,'String','"');
    3527          indices=fullfile_uvmat('','','','',NomType,num_i1,num_i2,num_j1,num_j2);
    3528         set(handles.FileIndex_1,'String',indices)
    3529         set(handles.FileExt_1,'String','"');
    3530         set(handles.FieldName_1,'Visible','on');
    3531         set(handles.FieldName_1,'Visible','on');
    3532         set(handles.RootPath_1,'Visible','on')
    3533         set(handles.RootFile_1,'Visible','on')
    3534         set(handles.SubDir_1,'Visible','on');
    3535         set(handles.FileIndex_1,'Visible','on');
    3536         set(handles.FileExt_1,'Visible','on');
    3537         set(handles.FieldName_1,'Visible','on');
    3538         Field{1}.AName='w';
    3539 end           
     3522% if  UvData.NewSeries && isequal(get(handles.SubField,'Value'),0) && isfield(Field{1},'W') && ~isempty(Field{1}.W) && ~isequal(Field{1}.NbDim,3);
     3523%         set(handles.SubField,'Value',1);
     3524%         set(handles.RootPath_1,'String','"')
     3525%         set(handles.RootFile_1,'String','"')
     3526%         set(handles.SubDir_1,'String','"');
     3527%          indices=fullfile_uvmat('','','','',NomType,num_i1,num_i2,num_j1,num_j2);
     3528%         set(handles.FileIndex_1,'String',indices)
     3529%         set(handles.FileExt_1,'String','"');
     3530%         set(handles.FieldName_1,'Visible','on');
     3531%         set(handles.FieldName_1,'Visible','on');
     3532%         set(handles.RootPath_1,'Visible','on')
     3533%         set(handles.RootFile_1,'Visible','on')
     3534%         set(handles.SubDir_1,'Visible','on');
     3535%         set(handles.FileIndex_1,'Visible','on');
     3536%         set(handles.FileExt_1,'Visible','on');
     3537%         set(handles.FieldName_1,'Visible','on');
     3538%         Field{1}.AName='w';
     3539% end           
    35403540
    35413541%% display time value of the current file
Note: See TracChangeset for help on using the changeset viewer.