Changeset 610 in lmdz_wrf


Ignore:
Timestamp:
Jul 20, 2015, 1:18:53 PM (10 years ago)
Author:
lfita
Message:

Fixing wrong calculation of statistics
Adding statistics of the values `between'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/validation_sim.py

    r609 r610  
    19371937iobst = CFtimes_datetime_NOfile([valdimobs['T'][0]], obstunits, 'standard')
    19381938fobst = CFtimes_datetime_NOfile([valdimobs['T'][dimtobs-1]], obstunits, 'standard')
    1939 print 'Lluis:', simobstimes[0],'tobs:',obstunits
    19401939isimt = CFtimes_datetime_NOfile([simobstimes[0]], obstunits, 'standard')
    19411940fsimt = CFtimes_datetime_NOfile([simobstimes[dimtsim-1]], obstunits, 'standard')
     
    19631962
    19641963exacttvalues = np.array(exacttvalues0, dtype=np.float)
    1965 print 'Lluis: shapes exactvalues:',exacttvalues.shape
    19661964
    19671965if len(exacttvalues) == 0:
     
    22182216        arrayvals = np.zeros((len(simobsvalues),2), dtype=np.float)
    22192217        for it in range(len(simobsvalues)):
    2220             arrayvals[it,:] = simobsvalues[it][0:1]
     2218            arrayvals[it,:] = simobsvalues[it][0:2]
    22212219       
    22222220        if len(valvars[ivar]) > 2:
     
    22382236                print '  ' + fname + ": operation '"+valvars[ivar][2]+"' not ready!!"
    22392237                quit(-1)
     2238
     2239#        for it in range(len(arrayvals[:,0])):
     2240#            print it,arrayvals[it,:],':',simobsvalues[it]
     2241#        quit()
    22402242
    22412243        if kst == 0:
     
    23552357            newvar[:] = arrayvals[:,1]
    23562358
     2359# Including statistics of the between simulated values
     2360        if stdescsim[kst] == 'B':
     2361            if not searchInlist(onewnc.dimensions, 'Bstats'):
     2362                newdim = onewnc.createDimension('Bstats',3)
     2363
     2364                newvar = onewnc.createVariable('Bstats','c',('Bstats','StrLength'))
     2365                descvar = prestdescsim[kst] + ' time simulated: ' + valvars[ivar][0]
     2366                basicvardef(newvar, 'Bstats', 'Between values statistics',           \
     2367                  ovobs.getncattr('units'))
     2368                Bstsvals=['minimum','maximum','stdandard deviation']
     2369                writing_str_nc(newvar,Bstsvals,StringLength)
     2370
     2371            newvar = onewnc.createVariable(valvars[ivar][0] + '_Bstats_sim', 'f',    \
     2372              (timedn,'Bstats'), fill_value=fillValueF)
     2373            descvar = prestdescsim[kst] + ' time simulated: ' + valvars[ivar][0] +   \
     2374              ' statistics'
     2375            basicvardef(newvar, valvars[ivar][0], descvar, ovobs.getncattr('units'))
     2376            newvar[0,:] = [fillValueF, fillValueF, fillValueF]
     2377            for it in range(dimt-1):
     2378                newvar[it+1,:] = simobsvalues[it][2:5]
     2379
    23572380# Around values
    23582381        if not onewnc.variables.has_key(valvars[ivar][0] + 'around'):
Note: See TracChangeset for help on using the changeset viewer.