Changeset 2170 in lmdz_wrf for trunk


Ignore:
Timestamp:
Oct 8, 2018, 3:19:17 PM (7 years ago)
Author:
lfita
Message:

Adding percentiles to `stats_time2D'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/generic_tools.py

    r2166 r2170  
    56165616        self.stdv[t]: temporal standard deviation at each grid point
    56175617        self.anomv[t]: temporal anomaly from the whole mean at each grid point
     5618        self.precen[t]: temporal percentiles at each grid point
    56185619    """
    56195620 
     
    56335634            self.mean2v = None
    56345635            self.stdv = None
     5636            self.percen = None
    56355637        else:
    56365638            dimx = vals.shape[2]
     
    56385640            stats=np.zeros((dimy,dimx,5), dtype=np.float)
    56395641            absmean = np.mean(vals,axis=0)
     5642            pecents = np.zeros((20,dimy,dimx), dtype=np.float)
    56405643
    56415644            stats[:,:,0]=np.min(vals, axis=0)
     
    56495652            stats = np.where(stats is np.inf, fillValue, stats)
    56505653            stats = np.where(stats is None, fillValue, stats)
     5654
     5655            for j in range(dimy):
     5656                for i in range(dimx):
     5657                    percents[:,j,i] = Quantiles(vals[:,j,i],20).quantilesv
    56515658
    56525659            self.minv=stats[:,:,0]
     
    56565663            self.stdv=np.sqrt(stats[:,:,3]-stats[:,:,2]*stats[:,:,2])
    56575664            self.anomv=stats[:,:,4]
     5665            self.percen=percents
    56585666
    56595667        return
Note: See TracChangeset for help on using the changeset viewer.