Changeset 520 in lmdz_wrf for trunk/tools


Ignore:
Timestamp:
Jun 19, 2015, 4:16:37 PM (10 years ago)
Author:
lfita
Message:

Removing `simobsTvalues'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/validation_sim.py

    r519 r520  
    11631163      sovalues= simulated values at the observation point and time
    11641164      soSvalues= values Ngrid points around the simulated point
    1165       soTvalues= values around observed times (for `single-station')
    11661165      soTtvalues= inital/ending period between two consecutive obsevations (for `single-station')
    11671166      trjs= trajectory on the simulation space
     
    12151214
    12161215    if okind == 'single-station':
    1217         soTvalues = {}
    12181216        soTtvalues = np.zeros((dimt,2), dtype=np.float)
    12191217    else:
     
    12701268                itod = int( (int(tvalues[it+1,1]) - ito) / 2 )
    12711269                itof = ito + itod
    1272 
    1273             slicev = ds['T'][1] + ':' + str(itoi) + '@' + str(itof + 1)
    1274 
    1275             slicevar, dimslice = slice_variable(ovo, slicev)
    1276             soTvalues[str(it)] = slicevar
    12771270
    12781271            soTtvalues[it,0] = valdimobs['T'][itoi]
     
    13501343##
    13511344    if kvals == 'instantaneous':
    1352         return sovalues, soSvalues, soTvalues, soTtvalues, trjs
     1345        return sovalues, soSvalues, soTtvalues, trjs
    13531346
    13541347    elif kvals == 'tbackwardSmean':
     
    13681361
    13691362        if okind == 'single-station':
    1370             fsoTvalues = {}
    13711363            fsoTtvalues = np.zeros((dimtf,2), dtype=np.float)
    13721364        else:
     
    14071399                          iy,ix])
    14081400            print fsoSvalues[it,]
    1409             print 'soTvalues________________',type(soTvalues)
    1410             for itt in range(intv[0],intv[1]):
    1411                 print soTvalues[str(itt)]
    14121401            fsoTtvalues[it,0] = soTtvalues[intv[0],0]
    14131402            fsoTtvalues[it,1] = soTtvalues[intv[1],0]
    14141403            print fsoTtvalues[it,:]
    1415             quit()
    1416 
     1404
     1405        quit()
     1406        return sovalues, soSvalues, soTtvalues, trjs
    14171407
    14181408    elif kvals == 'tbackwardOmean':
     
    14231413
    14241414
    1425     return sovalues, soSvalues, soTvalues, soTtvalues, trjs
     1415    return
    14261416
    14271417
     
    19391929
    19401930# Observed values temporally exact times
    1941     Esimobsvalues, EsimobsSvalues, EsimobsTvalues, EsimobsTtvalues, trjsim =         \
     1931    Esimobsvalues, EsimobsSvalues, EsimobsTtvalues, trjsim =                         \
    19421932        getting_ValidationValues(obskind, Nexactt, dims, trajpos, ovsim, ovobs,      \
    19431933        exacttvalues, oFillValue, Ngrid, 'instantaneous')
    19441934
    19451935# Observed values temporally around coincident times
    1946     simobsvalues, simobsSvalues, simobsTvalues, simobsTtvalues, trjsim =             \
     1936    simobsvalues, simobsSvalues, simobsTtvalues, trjsim =                            \
    19471937        getting_ValidationValues(obskind, Ncoindt, dims, trajpos, ovsim, ovobs,      \
    19481938        coindtvalues, oFillValue, Ngrid, 'tbackwardSmean')
     
    21092099          Earoundstats[2,it])
    21102100
    2111 # Statistics around obs values exact
    2112     Earoundostats = np.zeros((6,Nexactt), dtype=np.float)
    2113 
    2114     for it in range(Nexactt):
    2115         obsmask = ma.masked_equal(EsimobsTvalues[str(it)], fillValueF)
    2116         obsmask2 = obsmask*obsmask
    2117 
    2118         Earoundostats[0,it] = len(obsmask.flatten())
    2119         Earoundostats[1,it] = obsmask.min()
    2120         Earoundostats[2,it] = obsmask.max()
    2121         Earoundostats[3,it] = obsmask.mean()
    2122         Earoundostats[4,it] = obsmask2.mean()
    2123         Earoundostats[5,it] = np.sqrt(Earoundostats[4,it] - Earoundostats[3,it]*     \
    2124           Earoundostats[3,it])
    2125 
    21262101# Statistics around sim values between
    21272102    aroundstats = np.zeros((5,Ncoindt), dtype=np.float)
     
    21332108        aroundstats[4,it] = np.sqrt(aroundstats[3,it] - aroundstats[2,it]*           \
    21342109          aroundstats[2,it])
    2135 
    2136 # Statistics around obs values between
    2137     aroundostats = np.zeros((6,Ncoindt), dtype=np.float)
    2138 
    2139     for it in range(Ncoindt):
    2140         obsmask = ma.masked_equal(simobsTvalues[str(it)], fillValueF)
    2141         obsmask2 = obsmask*obsmask
    2142 
    2143         aroundostats[0,it] = len(obsmask.flatten())
    2144         aroundostats[1,it] = obsmask.min()
    2145         aroundostats[2,it] = obsmask.max()
    2146         aroundostats[3,it] = obsmask.mean()
    2147         aroundostats[4,it] = obsmask2.mean()
    2148         aroundostats[5,it] = np.sqrt(aroundostats[4,it] - aroundostats[3,it]*        \
    2149           aroundostats[3,it])
    21502110
    21512111# exact sim Values to netCDF
Note: See TracChangeset for help on using the changeset viewer.