Changeset 1097
- Timestamp:
- Apr 11, 2021, 10:03:02 PM (4 years ago)
- Location:
- trunk/src
- Files:
-
- 1 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/get_file_series.m
r1093 r1097 36 36 InputTable=Param.InputTable; 37 37 first_i=Param.IndexRange.first_i; 38 incr_i=Param.IndexRange.incr_ slice;38 incr_i=Param.IndexRange.incr_i; 39 39 last_i=Param.IndexRange.last_i; 40 40 first_j=[];last_j=[];incr_j=1;%default -
trunk/src/mouse_motion.m
r1093 r1097 279 279 Param.Action.RUN=1; 280 280 Param.ActionInput.ListCompareMode='PIV'; 281 Param.ActionInput.PairIndices=read_GUI(hhciv.PairIndices); 281 282 par_civ.ImageA=Field.A; 282 283 par_civ.ImageB=Field.B; -
trunk/src/plot_field.m
r1095 r1097 127 127 return 128 128 end 129 % end130 129 131 130 %% test axes and figure … … 266 265 FigData=get(hfig,'UserData'); 267 266 if strcmp(get(hfig,'tag'),'view_field')||strcmp(get(hfig,'tag'),'uvmat') 267 if ~isempty(get(haxes,'tag')) 268 268 FigData.(get(haxes,'tag'))=Data; 269 end 269 270 set(hfig,'UserData',FigData) 270 271 end -
trunk/src/series.m
r1096 r1097 168 168 RunModeList={'local';'background'}; % default choice of extensions (Matlab fct .m or compiled version .sh) 169 169 [s,w]=system(SeriesData.SeriesParam.ClusterParam.ExistenceTest); % look for cluster system presence 170 % [s,w]=system('oarstat'); % look for cluster system 'oar'171 170 if isequal(s,0) 172 171 RunModeList=[RunModeList;{'cluster'}]; 173 172 set(handles.MonitorCluster,'Visible','on'); % make visible button for access to Monika 174 173 set(handles.num_CPUTime,'Visible','on'); % make visible button for CPU time estimate for one ref index 175 set(handles.num_CPUTime,'String',' 1')% defqult CPU time estimate 1 minute174 set(handles.num_CPUTime,'String','')% default CPU time undefined 176 175 set(handles.CPUTime_txt,'Visible','on'); % make visible button for CPU time title 177 176 end 178 % [s,w]=system('qstat -help'); % look for cluster system 'sge'179 % if isequal(s,0)180 % if regexp(w,'^pbs')181 % RunModeList=[RunModeList;{'cluster_pbs'}];182 % elseif regexp(w,'^SGE')183 % RunModeList=[RunModeList;{'cluster_sge'}];184 % else185 % RunModeList=[RunModeList;{'cluster_qstat_unknown'}];186 % end187 % end188 177 set(handles.RunMode,'String',RunModeList)% display the menu of available run modes, local, background or cluster manager 189 178 … … 208 197 end 209 198 end 210 %get the list of previous campaigns in the upper bar menu Open campaign211 % if isfield(h,'MenuCampaign')212 % for ifile=1:min(length(h.MenuCampaign),5)213 % set(handles.(['MenuCampaign_' num2str(ifile)]),'Label',h.MenuCampaign{ifile});214 % end215 % end216 199 %get the menu of actions 217 200 if isfield(h,'ActionListUser') && iscell(h.ActionListUser) && isfield(h,'ActionPathListUser') && iscell(h.ActionPathListUser) … … 287 270 if isfield(Param,'InputFile') 288 271 289 %% fill the list of file series272 %% fill the list of input file series 290 273 InputTable=[{Param.InputFile.RootPath},{Param.InputFile.SubDir},{Param.InputFile.RootFile},{Param.InputFile.NomType},{Param.InputFile.FileExt}]; 291 if isempty(find(cellfun('isempty',InputTable)==0)) ;% if there is no input file, do not introduce input info274 if isempty(find(cellfun('isempty',InputTable)==0)) % if there is no input file, do not introduce input info 292 275 set(handles.REFRESH,'BackgroundColor',[1 0 1])% set REFRESH button to magenta color to indicate that input refresh is needed 293 276 return … … 299 282 end 300 283 set(handles.InputTable,'Data',InputTable) 284 285 %% define the default path for the output files 286 [InputPath,Device,DeviceExt]=fileparts(InputTable{1,1}); 287 [InputPath,Experiment,ExperimentExt]=fileparts(InputPath); 288 set(handles.Device,'String',[Device DeviceExt]) 289 set(handles.Experiment,'String',[Experiment ExperimentExt]) 290 if ~isempty(regexp(InputTable{1,1},'(^http://)|(^https://)')) 291 set(handles.OutputPathBrowse,'Value',1)% an output folder needs to be specified for OpenDAP data 292 end 293 294 %update the output path if needed 295 if ~(isfield(SeriesData,'InputPath') && strcmp(SeriesData.InputPath,InputPath)) 296 if get(handles.OutputPathBrowse,'Value')==1 % fix the output path in manual mode 297 OutputPathOld=get(handles.OutputPath,'String'); 298 OutputPath=uigetdir(OutputPathOld,'pick a root folder for output data'); 299 set(handles.OutputPath,'String',OutputPath) 300 else %reproduce the input path for output 301 set(handles.OutputPath,'String',InputPath) 302 end 303 end 304 301 305 %% determine the selected reference field indices for pair display 302 306 … … 857 861 [InputPath,Device,DeviceExt]=fileparts(InputTable{1,1}); 858 862 [InputPath,Experiment,ExperimentExt]=fileparts(InputPath); 859 [~,InputPath,InputPathExt]=fileparts(InputPath);860 863 set(handles.Device,'String',[Device DeviceExt]) 861 864 set(handles.Experiment,'String',[Experiment ExperimentExt]) … … 1843 1846 end 1844 1847 end 1845 CPUTime=1; % job time estimated at 1 min per iteration (on index i and j) by default1846 if isfield(Param.Action, 'CPUTime') && ~isempty(Param.Action.CPUTime)1847 CPUTime=Param.Action.CPUTime; % Note: CpUTime for one iteration ref_i has to be multiplied by the number of j indices nbfield_j1848 end1848 % CPUTime=1; % job time estimated at 1 min per iteration (on index i and j) by default 1849 % if isfield(Param.Action, 'CPUTime') && ~isempty(Param.Action.CPUTime) 1850 % CPUTime=Param.Action.CPUTime; % Note: CpUTime for one iteration ref_i has to be multiplied by the number of j indices nbfield_j 1851 % end 1849 1852 nbfield_j=numel(ref_j); % number of j indices 1850 1853 BlockLength=numel(ref_i); % by default, job involves the full set of i field indices … … 1852 1855 switch RunMode 1853 1856 case 'cluster' 1857 if (isfield(Param.Action, 'CPUTime') && ~isempty(Param.Action.CPUTime)) 1858 CPUTime=Param.Action.CPUTime; % Note: CpUTime for one iteration ref_i has to be multiplied by the number of j indices nbfield_j 1859 else 1860 answer=msgbox_uvmat('INPUT_TXT','estimate the CPU time(in minutes) for each value of index i:' ,''); 1861 CPUTime=str2num(answer); 1862 set(handles.num_CPUTime,'String',answer) 1863 end 1854 1864 JobNumberMax=SeriesData.SeriesParam.ClusterParam.JobNumberMax; 1855 1865 JobCPUTimeAdvised=SeriesData.SeriesParam.ClusterParam.JobCPUTimeAdvised; … … 2424 2434 set(handles.ActionName,'BackgroundColor',[1 1 1]) 2425 2435 set(handles.ActionInput,'BackgroundColor',[1 0 1])% set ActionInput button to magenta color to indicate that input refr 2426 2436 set(handles.num_CPUTime,'String','') 2427 2437 2428 2438 % --- Executes on button press in ActionInput. … … 2637 2647 end 2638 2648 if last_i < first_i || last_j < first_j , msgbox_uvmat('ERROR','last field number must be larger than the first one'),... 2639 set(handles.RUN, 'Enable','On'), set(handles.RUN,'BackgroundColor',[1 0 0]),return,end ;2649 set(handles.RUN, 'Enable','On'), set(handles.RUN,'BackgroundColor',[1 0 0]),return,end 2640 2650 end 2641 2651 -
trunk/src/series/aver_stat.m
r1093 r1097 225 225 226 226 %% settings for the output file 227 OutputDir=[Param.OutputSubDir Param.OutputDirExt];% subdirectory for output files 228 OutputPath=fullfile(Param.OutputPath,num2str(Param.Experiment),num2str(Param.Device)); 227 229 NomTypeOut=nomtype2pair(NomType{1});% determine the index nomenclature type for the output file 228 230 first_i=i1_series{1}(1); … … 467 469 468 470 %% writing the result file 469 OutputFile=fullfile_uvmat( RootPath{1},OutputDir,RootFile{1},FileExtOut,NomTypeOut,first_i,last_i,first_j_out,last_j_out);471 OutputFile=fullfile_uvmat(OutputPath,OutputDir,RootFile{1},FileExtOut,NomTypeOut,first_i,last_i,first_j_out,last_j_out); 470 472 if strcmp(FileExtOut,'.png') %case of images 471 473 if isequal(FileInfo{1}.BitDepth,16)||(numel(FileInfo)==2 &&isequal(FileInfo{2}.BitDepth,16)) -
trunk/src/series/civ_input.m
r1093 r1097 249 249 set(handles.dt_unit,'String',['dt in m' TimeUnit]);%display dt in unit 10-3 of the time (e.g ms) 250 250 set(handles.TimeUnit,'String',TimeUnit); 251 %set(handles.CoordUnit,'String',CoordUnit)252 251 set(handles.SearchRange,'UserData', pxcm_search); 253 252 … … 319 318 %% set the menu and default choice of civ pairs 320 319 if ~isfield(Param.IndexRange,'first_j')||isequal(MaxIndex_j,MinIndex_j)% no possibility of j pairs 321 set(handles.ListPairMode,'Value',1)322 320 PairMenu={'series(Di)'}; 323 321 elseif MaxIndex_i==1 && MaxIndex_j>1% simple series in j 324 322 PairMenu={'pair j1-j2';'series(Dj)'}; 325 if MaxIndex_j <= 10326 set(handles.ListPairMode,'Value',1)% advice 'pair j1-j2' except in MaxIndex_j is large327 end328 323 else 329 324 PairMenu={'pair j1-j2';'series(Dj)';'series(Di)'};%multiple choice 330 if strcmp(NomTypeNc,'_1-2_1')331 set(handles.ListPairMode,'Value',3)% advise 'series(Di)'332 elseif MaxIndex_j <= 10333 set(handles.ListPairMode,'Value',1)% advice 'pair j1-j2' except in MaxIndex_j is large334 end335 325 end 336 326 set(handles.ListPairMode,'String',PairMenu) 337 327 338 328 %% set default choice of pair mode 339 PairIndex= 1;329 PairIndex=[]; 340 330 if isfield(Param,'ActionInput') && isfield(Param.ActionInput,'PairIndices') 341 PairIndex=find(strcmp(Param.ActionInput.PairIndices.ListPairMode,PairMenu)); 331 PairIndex=find(strcmp(Param.ActionInput.PairIndices.ListPairMode,PairMenu));%retrieve the previous option 342 332 end 343 333 if isempty(PairIndex) … … 353 343 elseif MaxIndex_j <= 10 354 344 PairIndex=1;% advice 'pair j1-j2' except in MaxIndex_j is large 345 else 346 PairIndex=2;% advice 'Dj' 355 347 end 356 348 end … … 1748 1740 ImageData.ListVarName={'ny','nx','A'}; 1749 1741 ImageData.VarDimName= {'ny','nx',{'ny','nx'}}; 1742 ImageData.VarAttribute{1}.Role='coord_y'; 1743 ImageData.VarAttribute{2}.Role='coord_x'; 1744 ImageData.VarAttribute{3}.Role='scalar'; 1750 1745 ImageData.A=imread(Data.Civ1_ImageA); % read the first image 1751 1746 if ndims(ImageData.A)==3 %case of color image -
trunk/src/series/civ_series.m
r1096 r1097 71 71 Data.OutputFileMode='NbInput_i';% one output file expected per value of i index (used for waitbar) 72 72 Data.CheckOverwriteVisible='on'; % manage the overwrite of existing files (default=1) 73 if isfield(Data .ActionInput,'PairIndices') && strcmp(Data.ActionInput.PairIndices.ListPairMode,'pair j1-j2')73 if isfield(Data,'ActionInput') && isfield(Data.ActionInput,'PairIndices') && strcmp(Data.ActionInput.PairIndices.ListPairMode,'pair j1-j2') 74 74 if isfield(Data.ActionInput.PairIndices,'ListPairCiv2') 75 75 str_civ=Data.ActionInput.PairIndices.ListPairCiv2; … … 90 90 end 91 91 % estimated CPUTime 92 CPUtime_unit=0.01;%estimated time for a multiplication (in microsecond)93 if isfield(Param.SeriesData,'FileInfo')&&isfield(Param.SeriesData.FileInfo{1},'Height')&&isfield(Param.SeriesData.FileInfo{1},'Width')94 pixnbre=Param.SeriesData.FileInfo{1}.Height*Param.SeriesData.FileInfo{1}.Width; % total number of pxels for input images95 CPUtime=0;96 if isfield(Data.ActionInput,'Civ1')97 %BoxSize=Data.ActionInput.Civ1.CorrBoxSize(1)*Data.ActionInput.Civ1.CorrBoxSize(2);98 tic99 testboxa=rand(Data.ActionInput.Civ1.CorrBoxSize(1),Data.ActionInput.Civ1.CorrBoxSize(2));100 testboxb=rand(Data.ActionInput.Civ1.SearchBoxSize(1),Data.ActionInput.Civ1.SearchBoxSize(2));101 anss=conv2(testboxa,testboxb);102 CPUtime_unit=toc;103 nb_box=pixnbre/(Data.ActionInput.Civ1.Dx*Data.ActionInput.Civ1.Dy);104 %nbpos=Data.ActionInput.Civ1.SearchBoxSize-Data.ActionInput.Civ1.CorrBoxSize;105 CPUtime=2*CPUtime_unit*nb_box%*BoxSize*nbpos(1)*nbpos(2);% adjustement factor 2 used106 end107 if isfield(Data.ActionInput,'Patch1')108 CPUtime=2*CPUtime;109 end110 if isfield(Data.ActionInput,'Civ2')111 tic112 testboxa=rand(Data.ActionInput.Civ2.CorrBoxSize(1),Data.ActionInput.Civ2.CorrBoxSize(2));113 testboxb=rand(Data.ActionInput.Civ2.SearchBoxSize(1),Data.ActionInput.Civ2.SearchBoxSize(2));114 anss=conv2(testboxa,testboxb);115 CPUtime_unit=toc;116 nb_box=pixnbre/(Data.ActionInput.Civ2.Dx*Data.ActionInput.Civ2.Dy);117 %BoxSize=Data.ActionInput.Civ2.CorrBoxSize(1)*Data.ActionInput.Civ2.CorrBoxSize(2);118 %nbpos=Data.ActionInput.Civ2.SearchBoxSize-Data.ActionInput.Civ2.CorrBoxSize;119 CPUtime=CPUtime+2*CPUtime_unit*nb_box;%*BoxSize*nbpos(1)*nbpos(2);120 end121 if isfield(Data.ActionInput,'Patch2')122 CPUtime=(4/3)*CPUtime;123 end124 Data.CPUTime=ceil(CPUtime/6); % estimated CPU time per field pair in minute125 Data.CPUTime=Data.CPUTime/10; % displqy CPU time with 1 digit beyond dot126 end92 % CPUtime_unit=0.01;%estimated time for a multiplication (in microsecond) 93 % if isfield(Param.SeriesData,'FileInfo')&&isfield(Param.SeriesData.FileInfo{1},'Height')&&isfield(Param.SeriesData.FileInfo{1},'Width') 94 % pixnbre=Param.SeriesData.FileInfo{1}.Height*Param.SeriesData.FileInfo{1}.Width; % total number of pxels for input images 95 % CPUtime=0; 96 % if isfield(Data.ActionInput,'Civ1') 97 % %BoxSize=Data.ActionInput.Civ1.CorrBoxSize(1)*Data.ActionInput.Civ1.CorrBoxSize(2); 98 % tic 99 % testboxa=rand(Data.ActionInput.Civ1.CorrBoxSize(1),Data.ActionInput.Civ1.CorrBoxSize(2)); 100 % testboxb=rand(Data.ActionInput.Civ1.SearchBoxSize(1),Data.ActionInput.Civ1.SearchBoxSize(2)); 101 % anss=conv2(testboxa,testboxb); 102 % CPUtime_unit=toc; 103 % nb_box=pixnbre/(Data.ActionInput.Civ1.Dx*Data.ActionInput.Civ1.Dy); 104 % %nbpos=Data.ActionInput.Civ1.SearchBoxSize-Data.ActionInput.Civ1.CorrBoxSize; 105 % CPUtime=2*CPUtime_unit*nb_box%*BoxSize*nbpos(1)*nbpos(2);% adjustement factor 2 used 106 % end 107 % if isfield(Data.ActionInput,'Patch1') 108 % CPUtime=2*CPUtime; 109 % end 110 % if isfield(Data.ActionInput,'Civ2') 111 % tic 112 % testboxa=rand(Data.ActionInput.Civ2.CorrBoxSize(1),Data.ActionInput.Civ2.CorrBoxSize(2)); 113 % testboxb=rand(Data.ActionInput.Civ2.SearchBoxSize(1),Data.ActionInput.Civ2.SearchBoxSize(2)); 114 % anss=conv2(testboxa,testboxb); 115 % CPUtime_unit=toc; 116 % nb_box=pixnbre/(Data.ActionInput.Civ2.Dx*Data.ActionInput.Civ2.Dy); 117 % %BoxSize=Data.ActionInput.Civ2.CorrBoxSize(1)*Data.ActionInput.Civ2.CorrBoxSize(2); 118 % %nbpos=Data.ActionInput.Civ2.SearchBoxSize-Data.ActionInput.Civ2.CorrBoxSize; 119 % CPUtime=CPUtime+2*CPUtime_unit*nb_box;%*BoxSize*nbpos(1)*nbpos(2); 120 % end 121 % if isfield(Data.ActionInput,'Patch2') 122 % CPUtime=(4/3)*CPUtime; 123 % end 124 % Data.CPUTime=ceil(CPUtime/6); % estimated CPU time per field pair in minute 125 % Data.CPUTime=Data.CPUTime/10; % displqy CPU time with 1 digit beyond dot 126 % end 127 127 return 128 128 end … … 474 474 Data.ListGlobalAttribute=[ListGlobalAttribute Civ1_param]; 475 475 Data.CivStage=1; 476 else 477 i1=Param.ActionInput.PairIndices.ref_i; %case of TESTmode 476 478 end 477 479 % set the list of variables -
trunk/src/series/merge_proj.m
r1096 r1097 239 239 %% MAIN LOOP ON FIELDS 240 240 %%%%%%%%%%%%% STANDARD PART (DO NOT EDIT) %%%%%%%%%%%% 241 % for i_slice=1:NbSlice242 % index_slice=i_slice:NbSlice:NbField;% select file indices of the slice243 % NbFiles=0;244 % nbmissing=0;245 241 246 242 %%%%%%%%%%%%%%%% loop on field indices %%%%%%%%%%%%%%%% -
trunk/src/series/sliding_average.m
r1096 r1097 205 205 end 206 206 NbPeriod=2; %number of periods for the sliding average 207 omega=2* pi/T;207 omega=2*2*pi/T;%harmonic 208 208 Lscale=15;%diameter of the torus, length scale for normalisation 209 209 Uscale=amplitude*omega; -
trunk/src/transform_field/ima_levels.m
r1093 r1097 69 69 fctblock= inline('mean(x(:))'); 70 70 B=imresize(Backg,size(A),'bilinear');% interpolate to the initial size image 71 A=(A-B);%substract background 72 AMean=blkproc(A,[nblock_y nblock_x],fctblock);% take the mean in blocks 73 fctblock= inline('var(x(:))'); 74 AVar=blkproc(A,[nblock_y nblock_x],fctblock);% take the mean in blocks 75 Avalue=AVar./AMean% typical value of particle luminosity 76 Avalue=imresize(Avalue,size(A),'bilinear');% interpolate to the initial size image 77 DataOut.A=uint16(1000*tanh(A./(2*Avalue))); 71 DataOut.A=B; 72 73 % A=(A-B);%substract background 74 % AMean=blkproc(A,[nblock_y nblock_x],fctblock);% take the mean in blocks 75 % fctblock= inline('var(x(:))'); 76 % AVar=blkproc(A,[nblock_y nblock_x],fctblock);% take the mean in blocks 77 % Avalue=AVar./AMean;% typical value of particle luminosity 78 % Avalue=imresize(Avalue,size(A),'bilinear');% interpolate to the initial size image 79 % DataOut.A=uint16(1000*tanh(A./(2*Avalue))); 78 80 %Bmin=blkproc(Aflagmin,[nblock_y nblock_x],sumblock);% find the number of minima in blocks 79 81 %Backg=Backg./Bmin; % find the average of minima in blocks 80 82 81 83 84 85
Note: See TracChangeset
for help on using the changeset viewer.