Changeset 1032 for trunk/src/series
- Timestamp:
- Mar 22, 2018, 9:27:17 PM (7 years ago)
- Location:
- trunk/src/series
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series/sub_background.m
r1027 r1032 107 107 108 108 %% check the validity of input file types 109 ImageTypeOptions={'image','multimage','mmreader','video','cine_phantom' };%allowed input file types(images)109 ImageTypeOptions={'image','multimage','mmreader','video','cine_phantom','image_DaVis'};%allowed input file types(images) 110 110 FileInfo=get_file_info(FirstFileName); 111 111 FileType=FileInfo.FileType; … … 348 348 imwrite(C,newname,'BitDepth',16); % save the new image 349 349 else 350 if ~isfield(FileInfo{1},'BitDepth') 351 FileInfo{1}.BitDepth=16; 352 end 350 353 if isequal(FileInfo{1}.BitDepth,16) 351 354 C=uint16(Acor); … … 379 382 end 380 383 filename=fullfile_uvmat(RootPath{1},SubDir{1},RootFile{1},FileExt{1},NomType{1},i1_series{1}(ifile),[],j1); 381 Aread=read_image(filename,FileType{1},MovieObject{1}, i1_series{1}(ifile));384 Aread=read_image(filename,FileType{1},MovieObject{1},frame_index{1}(ifile)); 382 385 if ndims(Aread)==3;%color images 383 386 Aread=sum(double(Aread),3);% take the sum of color components -
trunk/src/series/turb_stat.m
r1031 r1032 180 180 InputFields{1}=Param.InputFields; 181 181 end 182 if isempty(InputFields{1}.FieldName) 183 disp('ERROR: input fields U, V and posibly curl and div must be entered by get_field...') 184 return 185 end 182 186 183 187 nbfiles=0; … … 187 191 DataOut.ListGlobalAttribute= {'Conventions'}; 188 192 DataOut.Conventions= 'uvmat'; 189 DataOut.ListVarName={'coord_y', 'coord_x' ,'UMean' , 'VMean','u2Mean','v2Mean','u2Mean_1','v2Mean_1','uvMean','C ounter'};193 DataOut.ListVarName={'coord_y', 'coord_x' ,'UMean' , 'VMean','u2Mean','v2Mean','u2Mean_1','v2Mean_1','uvMean','CurlMean','DivMean','Curl2Mean','Div2Mean','Counter'}; 190 194 DataOut.VarDimName={'coord_y','coord_x',{'coord_y','coord_x'},{'coord_y','coord_x'},{'coord_y','coord_x'},{'coord_y','coord_x'},{'coord_y','coord_x'},{'coord_y','coord_x'},... 191 {'coord_y','coord_x'},{'coord_y','coord_x'} };195 {'coord_y','coord_x'},{'coord_y','coord_x'},{'coord_y','coord_x'},{'coord_y','coord_x'},{'coord_y','coord_x'},{'coord_y','coord_x'}}; 192 196 DataOut.UMean=0; 193 197 DataOut.VMean=0; … … 198 202 DataOut.uvMean=0; 199 203 DataOut.Counter=0; 204 DataOut.CurlMean=0; 205 DataOut.DivMean=0; 206 DataOut.Curl2Mean=0; 207 DataOut.Div2Mean=0; 200 208 U2Mean=0; 201 209 V2Mean=0; … … 215 223 216 224 %%%%%%%%%%%% MAIN RUNNING OPERATIONS %%%%%%%%%%%% 217 if index==1 % first field225 if index==1 %initiate the output data structure in the first field 218 226 219 227 DataOut.coord_y=Field.coord_y; 220 228 DataOut.coord_x=Field.coord_x; 221 Uprev=Field.U; 229 Uprev=Field.U;% store the current field for next iteration 222 230 Vprev=Field.V; 223 231 if isfield(Field,'FF') 224 FFprev=Field.FF; 232 FFprev=Field.FF;% possible flag for false data 225 233 else 226 FFprev=true(size(Field.U)); 234 %FFprev=true(size(Field.U)); 235 FFprev=isnan(Field.U); 227 236 end 228 237 end … … 242 251 Vprev=Field.V; 243 252 FFprev=FF; 253 if isfield(Field,'curl') && isfield(Field,'div') 254 Field.curl(FF)=0;% set to 0 the nan values 255 Field.div(FF)=0; 256 DataOut.CurlMean=DataOut.CurlMean+Field.curl; 257 DataOut.DivMean=DataOut.DivMean+Field.div; 258 DataOut.Curl2Mean=DataOut.Curl2Mean+Field.curl.*Field.curl; 259 DataOut.Div2Mean=DataOut.Div2Mean+Field.div.*Field.div; 260 end 244 261 end 245 262 %%%%%%%%%%%%%%%% end loop on field indices %%%%%%%%%%%%%%%% … … 258 275 DataOut.u2Mean_1=U2Mean_1-DataOut.UMean.*DataOut.UMean; % normalize the mean 259 276 DataOut.v2Mean_1=V2Mean_1-DataOut.VMean.*DataOut.VMean; % normalize the mean 260 277 DataOut.CurlMean=DataOut.CurlMean./DataOut.Counter; 278 DataOut.DivMean=DataOut.DivMean./DataOut.Counter; 279 DataOut.Curl2Mean=DataOut.Curl2Mean./DataOut.Counter-DataOut.CurlMean.*DataOut.CurlMean; 280 DataOut.Div2Mean=DataOut.Div2Mean./DataOut.Counter-DataOut.DivMean.*DataOut.DivMean; 261 281 262 282 %% calculate the profiles
Note: See TracChangeset
for help on using the changeset viewer.