Changeset 1002 for trunk/src/series/turb_correlation_time.m
- Timestamp:
- Feb 28, 2017, 10:41:54 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series/turb_correlation_time.m
r1001 r1002 57 57 %======================================================================= 58 58 59 function ParamOut=turb_ stat(Param)59 function ParamOut=turb_correlation_time(Param) 60 60 61 61 %% set the input elements needed on the GUI series when the action is selected in the menu ActionName … … 63 63 ParamOut.AllowInputSort='off';% allow alphabetic sorting of the list of input file SubDir (options 'off'/'on', 'off' by default) 64 64 ParamOut.WholeIndexRange='off';% prescribes the file index ranges from min to max (options 'off'/'on', 'off' by default) 65 ParamOut.NbSlice= 'off'; %nbre of slices ('off' by default)65 ParamOut.NbSlice=1; %nbre of slices ('off' by default) 66 66 ParamOut.VelType='off';% menu for selecting the velocity type (options 'off'/'one'/'two', 'off' by default) 67 67 ParamOut.FieldName='one';% menu for selecting the field (s) in the input file(options 'off'/'one'/'two', 'off' by default) … … 277 277 FFCorr=false(NpTime+1,npy,npx); 278 278 end 279 Field.U=Field.U-UMean; 280 Field.V=Field.V-VMean; 279 281 FF=isnan(Field.U);%|Field.U<-60|Field.U>30;% threshold on U 280 282 Field.U(FF)=0;% set to 0 the nan values,'delta_x' 281 283 Field.V(FF)=0; 282 Field.U=Field.U-UMean;283 Field.V=Field.V-VMean;284 284 if index<=NpTime+1 285 U_shift( index,:,:)=Field.U;286 V_shift( index,:,:)=Field.V;287 FF_shift( index,:,:)=FF;285 U_shift(NpTime+2-index,:,:)=Field.U; 286 V_shift(NpTime+2-index,:,:)=Field.V; 287 FF_shift(NpTime+2-index,:,:)=FF; 288 288 else 289 U_shift=circshift(U_shift,[ -1 0 0]); %shift U by ishift along the first index290 V_shift=circshift(V_shift,[ -1 0 0]); %shift U by ishift along the first index291 FF_shift=circshift(FF_shift,[ -1 0 0]); %shift U by ishift along the first index292 U_shift( NpTime+1,:,:)=Field.U;293 V_shift( NpTime+1,:,:)=Field.V;294 FF_shift( NpTime+1,:,:)=FF;295 end 296 for ishift=1:NpTime % calculate the field U shifted297 UUCorr(ishift,:,:)=Field.U.* U_shift(ishift,:,:);298 VVCorr(ishift,:,:)=Field.V.* V_shift(ishift,:,:);299 UVCorr(ishift,:,:)=Field.U.* V_shift(ishift,:,:);300 FFCorr(ishift,:,:)=FF | FF_shift;289 U_shift=circshift(U_shift,[1 0 0]); %shift U by ishift along the first index 290 V_shift=circshift(V_shift,[1 0 0]); %shift U by ishift along the first index 291 FF_shift=circshift(FF_shift,[1 0 0]); %shift U by ishift along the first index 292 U_shift(1,:,:)=Field.U; 293 V_shift(1,:,:)=Field.V; 294 FF_shift(1,:,:)=FF; 295 end 296 for ishift=1:NpTime+1% calculate the field U shifted 297 UUCorr(ishift,:,:)=Field.U.*squeeze(U_shift(ishift,:,:)); 298 VVCorr(ishift,:,:)=Field.V.*squeeze(V_shift(ishift,:,:)); 299 UVCorr(ishift,:,:)=Field.U.*squeeze(V_shift(ishift,:,:)); 300 FFCorr(ishift,:,:)=FF | squeeze(FF_shift(ishift,:,:)); 301 301 end 302 302 DataOut.UUCorr=DataOut.UUCorr+UUCorr; … … 306 306 end 307 307 %%%%%%%%%%%%%%%% end loop on field indices %%%%%%%%%%%%%%%% 308 % DataOut.UUCorr=DataOut.UUCorr./DataOut.Counter; 309 % DataOut.VVCorr=DataOut.VVCorr./DataOut.Counter; 310 % DataOut.VUVCorr=DataOut.UVCorr./DataOut.Counter; 311 %DataOut.Counter(DataOut.Counter==0)=1;% put counter to 1 when it is zero 308 DataOut.Counter(DataOut.Counter==0)=1;% put counter to 1 when it is zero (to avoid NaN) 309 DataOut.UUCorr=DataOut.UUCorr./DataOut.Counter; 310 DataOut.VVCorr=DataOut.VVCorr./DataOut.Counter; 311 DataOut.UVCorr=DataOut.UVCorr./DataOut.Counter; 312 312 313 % DataOut.UMean=DataOut.UMean./DataOut.Counter; % normalize the mean 313 314 % DataOut.VMean=DataOut.VMean./DataOut.Counter; % normalize the mean
Note: See TracChangeset
for help on using the changeset viewer.