Ignore:
Timestamp:
May 1, 2014, 8:28:05 AM (10 years ago)
Author:
sommeria
Message:

turb_stat corrected
civ corrected to allow civ2 from an existing civ1 series

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/series/turb_stat.m

    r751 r761  
    184184U2Mean_1=0;
    185185V2Mean_1=0;
    186 checkgrid=0;% test for a structured grid for input field
     186Counter_1=0;
     187
    187188%%%%%%%%%%%%%%%% loop on field indices %%%%%%%%%%%%%%%%
    188189for index=1:NbField
     
    201202        Uprev=Field.U;
    202203        Vprev=Field.V;
    203     end
    204     FF=isnan(Field.U)|Field.U<-60|Field.U>30;% threshold on U
     204        FFprev=Field.FF;
     205    end
     206    FF=isnan(Field.U);%|Field.U<-60|Field.U>30;% threshold on U
    205207    DataOut.Counter=DataOut.Counter+ (~FF);% add 1 to the couter for non NaN point
     208    Counter_1=Counter_1+(~FF & ~FFprev);
    206209    Field.U(FF)=0;% set to 0 the nan values
    207210    Field.V(FF)=0;
     
    215218    Uprev=Field.U; %store for next iteration
    216219    Vprev=Field.V;
     220    FFprev=FF;
    217221end
    218222%%%%%%%%%%%%%%%% end loop on field indices %%%%%%%%%%%%%%%%
     
    224228V2Mean=V2Mean./DataOut.Counter; % normalize the mean
    225229UVMean=UVMean./DataOut.Counter; % normalize the mean
    226 U2Mean_1=U2Mean_1./DataOut.Counter; % normalize the mean
    227 V2Mean_1=V2Mean_1./DataOut.Counter; % normalize the mean
     230U2Mean_1=U2Mean_1./Counter_1; % normalize the mean
     231V2Mean_1=V2Mean_1./Counter_1; % normalize the mean
    228232DataOut.u2Mean=U2Mean-DataOut.UMean.*DataOut.UMean; % normalize the mean
    229233DataOut.v2Mean=V2Mean-DataOut.VMean.*DataOut.VMean; % normalize the mean
Note: See TracChangeset for help on using the changeset viewer.