Changeset 285 in lmdz_wrf


Ignore:
Timestamp:
Feb 25, 2015, 2:52:29 PM (10 years ago)
Author:
lfita
Message:

Fixing statistics for 4D var

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/nc_var_tools.py

    r284 r285  
    1058410584# box stats values
    1058510585                    maskedvals = ma.masked_values (varvalst, fillValue)
    10586                     statvarvals[it,:,0] = varvalst[box2,box2]
    10587                     statvarvals[it,:,1] = maskedvals.min()
    10588                     statvarvals[it,:,2] = maskedvals.max()
    10589                     statvarvals[it,:,3] = maskedvals.mean()
    1059010586                    maskedvals2 = maskedvals*maskedvals
    10591                     statvarvals[it,:,4] = maskedvals2.mean()
    10592                     statvarvals[it,:,5] = np.sqrt(statvarvals[it,:,4] -              \
    10593                       statvarvals[it,:,3]*statvarvals[it,:,3])
    10594 
     10587                    for iz in range(dimz):
     10588                        statvarvals[it,iz,0] = varvalst[iz,box2,box2]
     10589                        statvarvals[it,iz,1] = np.min(varvalst[iz,:,:])
     10590                        statvarvals[it,iz,2] = np.max(varvalst[iz,:,:])
     10591                        statvarvals[it,iz,3] = np.mean(varvalst[iz,:,:])
     10592                        statvarvals[it,iz,4] = maskedvals2[iz,:,:].mean()
     10593                        statvarvals[it,iz,5] = np.sqrt(statvarvals[it,iz,4] -        \
     10594                          statvarvals[it,iz,3]*statvarvals[it,iz,3])
    1059510595                else:
    1059610596                    slicev.append(slice(0,dimz))
     
    1061610616
    1061710617# box stats values
    10618                     statvarvals[it,:,0] = varvalst[:,box2,box2]
    1061910618                    for iz in range(dimz):
     10619                        statvarvals[it,:,0] = varvalst[:,box2,box2]
    1062010620                        statvarvals[it,iz,1] = np.min(varvalst[iz,:,:])
    1062110621                        statvarvals[it,iz,2] = np.max(varvalst[iz,:,:])
    1062210622                        statvarvals[it,iz,3] = np.mean(varvalst[iz,:,:])
    10623                         statvarvals[it,iz,4] = np.mean(varvalst*varvalst[iz,:,:])
     10623                        statvarvals[it,iz,4] = np.mean(varvalst[iz,:,:]*             \
     10624                          varvalst[iz,:,:])
    1062410625                        statvarvals[it,iz,5] = np.sqrt(statvarvals[it,iz,4] -        \
    1062510626                          statvarvals[it,iz,3]*statvarvals[it,iz,3])
     
    1065210653                    maskedvals = ma.masked_values (rvarvalst, fillValue)
    1065310654                    maskedvals2 = maskedvals*maskedvals
    10654                     rtatvarvals[it,:,0] = varvalst[:,box2,box2]
    1065510655                    for iz in range(dimz):
     10656                        rtatvarvals[it,:,0] = varvalst[:,box2,box2]
    1065610657                        rtatvarvals[it,iz,1] = np.min(varvalst[iz,:,:])
    1065710658                        rtatvarvals[it,iz,2] = np.max(varvalst[iz,:,:])
     
    1068510686# circle stats values
    1068610687                    maskedvals = ma.masked_values (rvarvalst, fillValue)
    10687                     rstatvarvals[it,:,0] = rvarvalst[Nrad,Nrad]
    10688                     rstatvarvals[it,:,1] = maskedvals.min()
    10689                     rstatvarvals[it,:,2] = maskedvals.max()
    10690                     rstatvarvals[it,:,3] = maskedvals.mean()
    1069110688                    maskedvals2 = maskedvals*maskedvals
    10692                     rstatvarvals[it,:,4] = maskedvals2.mean()
    10693                     rstatvarvals[it,:,5] = np.sqrt(rstatvarvals[it,:,4] -            \
    10694                       rstatvarvals[it,:,3]*rstatvarvals[it,:,3])
     10689                    for iz in range(dimz):
     10690                        rstatvarvals[it,iz,0] = rvarvalst[iz,Nrad,Nrad]
     10691                        rstatvarvals[it,iz,1] = maskedvals.min()
     10692                        rstatvarvals[it,iz,2] = maskedvals.max()
     10693                        rstatvarvals[it,iz,3] = maskedvals.mean()
     10694                        rstatvarvals[it,iz,4] = maskedvals2[iz,:,:].mean()
     10695                        rstatvarvals[it,iz,5] = np.sqrt(rstatvarvals[it,iz,4] -      \
     10696                          rstatvarvals[it,iz,3]*rstatvarvals[it,:,3])
    1069510697
    1069610698#            print 'statistics:',rstatvarvals[it,:]
Note: See TracChangeset for help on using the changeset viewer.