Changeset 1527 in lmdz_wrf


Ignore:
Timestamp:
Apr 18, 2017, 6:06:39 PM (8 years ago)
Author:
lfita
Message:

Switching statistics variable shape for [runningdims] + stats in `field_stats_dim'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/nc_var_tools.py

    r1526 r1527  
    1142311423                runvdimns.append(vdn)
    1142411424                runvLdims.append(stdims[vdn])
    11425         statsresults = np.zeros(tuple([Nstats] + runvLdims), dtype=np.float)
     11425        statsresults = np.zeros(tuple(runvLdims+[Nstats]), dtype=np.float)
    1142611426        if len(runvLdims) == 0:
    1142711427            print warnmsg
     
    1149611496                statsvariable[vn] = [minv, maxv, meanv, mean2v, varv, convals[0]]
    1149711497                if countV is not None:
    11498                     statsresults[tuple([slice(0,Nstats)]+list(slicedims))] = [minv,  \
     11498                    statsresults[tuple(list(slicedims)+[slice(0,Nstats)])] = [minv,  \
    1149911499                      maxv, meanv, mean2v, varv, convals[0]]
    1150011500                else:
    11501                     statsresults[tuple([slice(0,Nstats)]+list(slicedims))] = [minv,  \
     11501                    statsresults[tuple(list(slicedims)+[slice(0,Nstats)])] = [minv,  \
    1150211502                      maxv, meanv, mean2v, varv]
    1150311503
     
    1151711517                    print Sm+'{:<15}'.format(key)+' '+' '.join('{:<15g}'.format(v) for v in vals)
    1151811518
    11519         newvar = onewnc.createVariable(Vn + '_stats', 'f4', tuple(['stats'] +        \
    11520           runvdimns))
     11519        newvar = onewnc.createVariable(Vn+'_stats', 'f4', tuple(runvdimns+['stats']))
    1152111520        newvar[:] = statsresults[:]
    1152211521        for attrn in objfield.ncattrs():
Note: See TracChangeset for help on using the changeset viewer.