Changeset 1197 for trunk/src/series
- Timestamp:
- Mar 11, 2026, 5:31:25 PM (4 weeks ago)
- Location:
- trunk/src/series
- Files:
-
- 3 edited
-
civ_series.m (modified) (1 diff)
-
merge_proj.m (modified) (1 diff)
-
turb_correlation_x.m (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series/civ_series.m
r1196 r1197 276 276 time_patch2=0; 277 277 if ~isempty(RUNHandle)% update the waitbar in interactive mode with GUI series (checkrun=1) 278 update_waitbar(WaitbarHandle,ifield/NbField)279 278 if checkrun && ~strcmp(get(RUNHandle,'BusyAction'),'queue') 280 279 disp('program stopped by user') -
trunk/src/series/merge_proj.m
r1196 r1197 354 354 end 355 355 [MaskData,~,errormsg] = read_field(maskname,'image'); 356 if ~isempty(errormsg) 357 disp(['error reading ' maskname ' :' errormsg]) 358 return 359 end 356 360 if ~isempty(NbSlice_calib) 357 361 MaskData.ZIndex=mod(i1_series{iview}(index)-1,NbSlice_calib{iview})+1;%Zindex for phys transform -
trunk/src/series/turb_correlation_x.m
r1127 r1197 94 94 95 95 %% root input file(s) name, type and index series 96 RootPath=Param.InputTable (:,1);97 RootFile=Param.InputTable (:,3);98 SubDir=Param.InputTable(:,2);99 NomType=Param.InputTable (:,4);100 FileExt=Param.InputTable(:,5);96 RootPath=Param.InputTable{:,1}; 97 RootFile=Param.InputTable{:,3}; 98 %SubDir=Param.InputTable(:,2); 99 NomType=Param.InputTable{1,4}; 100 %FileExt=Param.InputTable(:,5); 101 101 [filecell,i1_series,i2_series,j1_series,j2_series]=get_file_series(Param); 102 102 %%%%%%%%%%%% … … 108 108 % i1_series(iview,fileindex) expresses the same indices as a 1D array in file indices 109 109 %%%%%%%%%%%% NbView=1 : a single input series 110 NbView=numel(i1_series);%number of input file series (lines in InputTable)110 %NbView=numel(i1_series);%number of input file series (lines in InputTable) 111 111 NbField_j=size(i1_series{1},1); %nb of fields for the j index (bursts or volume slices) 112 112 NbField_i=size(i1_series{1},2); %nb of fields for the i index 113 113 NbField=NbField_j*NbField_i; %total number of fields 114 114 115 %% determine the file type on each line from the first input file 116 ImageTypeOptions={'image','multimage','mmreader','video','cine_phantom'}; 117 NcTypeOptions={'netcdf','civx','civdata'}; 118 for iview=1:NbView 119 if ~exist(filecell{iview,1}','file') 120 msgbox_uvmat('ERROR',['the first input file ' filecell{iview,1} ' does not exist']) 121 return 122 end 123 [FileInfo{iview},MovieObject{iview}]=get_file_info(filecell{iview,1}); 124 FileType{iview}=FileInfo{iview}.FileType; 125 CheckImage{iview}=~isempty(find(strcmp(FileType{iview},ImageTypeOptions)));% =1 for images 126 CheckNc{iview}=~isempty(find(strcmp(FileType{iview},NcTypeOptions)));% =1 for netcdf files 127 if ~isempty(j1_series{iview}) 128 frame_index{iview}=j1_series{iview}; 129 else 130 frame_index{iview}=i1_series{iview}; 131 end 132 end 133 134 %% calibration data and timing: read the ImaDoc files 135 XmlData=[]; 136 [XmlData,NbSlice_calib,time,errormsg]=read_multimadoc(RootPath,SubDir,RootFile,FileExt,i1_series,i2_series,j1_series,j2_series); 137 if size(time,1)>1 138 diff_time=max(max(diff(time))); 139 if diff_time>0 140 msgbox_uvmat('WARNING',['times of series differ by (max) ' num2str(diff_time)]) 141 end 142 end 143 144 %% coordinate transform or other user defined transform 145 transform_fct='';%default 146 if isfield(Param,'FieldTransform')&&~isempty(Param.FieldTransform.TransformName) 147 addpath(Param.FieldTransform.TransformPath) 148 transform_fct=str2func(Param.FieldTransform.TransformName); 149 rmpath(Param.FieldTransform.TransformPath) 150 end 151 152 %%%%%%%%%%%% END STANDARD PART %%%%%%%%%%%% 153 % EDIT FROM HERE 154 155 %% check the validity of input file types 156 if CheckImage{1} 157 FileExtOut='.png'; % write result as .png images for image inputs 158 elseif CheckNc{1} 159 FileExtOut='.nc';% write result as .nc files for netcdf inputs 115 %% determine the file type on each line from the first input file 116 117 [FileInfo,MovieObject]=get_file_info(filecell{1,1}); 118 FileType=FileInfo.FileType; 119 120 if ~isempty(j1_series{1}) 121 frame_index=j1_series{1}; 160 122 else 161 msgbox_uvmat('ERROR',['invalid file type input ' FileType{1}]) 162 return 163 end 164 123 frame_index=i1_series{1}; 124 end 165 125 166 126 %% settings for the output file 167 NomTypeOut=nomtype2pair(NomType{1});% determine the index nomenclature type for the output file 127 FileExtOut='.nc';% write result as .nc files for netcdf inputs 128 NomTypeOut=nomtype2pair(NomType);% determine the index nomenclature type for the output file 168 129 first_i=i1_series{1}(1); 169 130 last_i=i1_series{1}(end); … … 177 138 %% Set field names and velocity types 178 139 InputFields{1}=[];%default (case of images) 179 if isfield(Param,'InputFields') 180 InputFields{1}=Param.InputFields; 181 end 182 140 %%%%%%%%%%%%%%%%%%%%% 141 if isfield(Param.IndexRange,'TimeSource') && find(regexp(Param.IndexRange.TimeSource,'^var:'))==1 142 Param.InputFields.TimeVarName=regexprep(Param.IndexRange.TimeSource,'^var:',''); 143 end 144 %%%%%%%%%%%%%%%%%%%% 145 % if isfield(Param,'InputFields') 146 % InputFields{1}=Param.InputFields; 147 % end 148 Param.InputFields.FieldName={'Uprime','Vprime'}; 183 149 nbfiles=0; 184 150 nbmissing=0; … … 197 163 disp('loop for mean started') 198 164 for index=1:NbField 199 update_waitbar(WaitbarHandle,index/NbField) 200 if ~isempty(RUNHandle)&& ~strcmp(get(RUNHandle,'BusyAction'),'queue') 201 disp('program stopped by user') 202 break 203 end 204 [Field,tild,errormsg] = read_field(filecell{1,index},FileType{iview},InputFields{iview},frame_index{iview}(index)); 165 % if ~isempty(RUNHandle)&& ~strcmp(get(RUNHandle,'BusyAction'),'queue') 166 % disp('program stopped by user') 167 % break 168 % end 169 [Field,~,errormsg] = read_field(filecell{1,index},FileType,Param.InputFields,frame_index(index)); 170 171 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 172 Field.U=Field.Uprime; 173 Field.V=Field.Vprime; 174 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 205 175 if index==1 %first field 206 176 if ~isfield(Field,'U')||~isfield(Field,'V') … … 208 178 return 209 179 end 180 210 181 [npy,npx]=size(Field.U); 211 182 UMean=zeros(npy,npx); 212 183 VMean=zeros(npy,npx); 213 184 Counter=zeros(npy,npx); 214 % transcripts the global attributes185 % transcripts the global attributes 215 186 if isfield(Field,'ListGlobalAttribute') 216 187 DataOut.ListGlobalAttribute= Field.ListGlobalAttribute; … … 236 207 disp('loop for correlation started') 237 208 for index=1:NbField 238 update_waitbar(WaitbarHandle,index/NbField)239 209 if ~isempty(RUNHandle)&& ~strcmp(get(RUNHandle,'BusyAction'),'queue') 240 210 disp('program stopped by user') 241 211 break 242 212 end 243 [Field,tild,errormsg] = read_field(filecell{1,index},FileType{iview},InputFields{iview},frame_index{iview}(index)); 244 213 [Field,~,errormsg] = read_field(filecell{1,index},FileType,Param.InputFields,frame_index(index)); 214 Field.U=Field.Uprime; 215 Field.V=Field.Vprime; 245 216 %%%%%%%%%%%% MAIN RUNNING OPERATIONS %%%%%%%%%%%% 246 217 if index==1 %first field … … 281 252 VVCorr(ishift+npcorr+1,:,:)=Field.V.*V_shift; 282 253 UVCorr(ishift+npcorr+1,:,:)=Field.U.*V_shift; 283 FFCorr(ishift+npcorr+1,:,:)=FF | FF_shift; 254 FFCorr(ishift+npcorr+1,:,:)=FF | FF_shift; 284 255 end 285 256 DataOut.UUCorr=DataOut.UUCorr+UUCorr; … … 322 293 323 294 %% writing the result file as netcdf file 324 OutputFile=fullfile_uvmat(RootPath {1},OutputDir,RootFile{1},FileExtOut,NomTypeOut,first_i,last_i,first_j,last_j);295 OutputFile=fullfile_uvmat(RootPath,OutputDir,RootFile,FileExtOut,NomTypeOut,first_i,last_i,first_j,last_j); 325 296 %case of netcdf input file , determine global attributes 326 297 errormsg=struct2nc(OutputFile,DataOut); %save result file … … 331 302 end 332 303 333 334 %% open the result file with uvmat (in RUN mode)335 if checkrun336 uvmat(OutputFile)% open the last result file with uvmat337 end
Note: See TracChangeset
for help on using the changeset viewer.
