Changeset 520 in lmdz_wrf for trunk/tools
- Timestamp:
- Jun 19, 2015, 4:16:37 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/validation_sim.py
r519 r520 1163 1163 sovalues= simulated values at the observation point and time 1164 1164 soSvalues= values Ngrid points around the simulated point 1165 soTvalues= values around observed times (for `single-station')1166 1165 soTtvalues= inital/ending period between two consecutive obsevations (for `single-station') 1167 1166 trjs= trajectory on the simulation space … … 1215 1214 1216 1215 if okind == 'single-station': 1217 soTvalues = {}1218 1216 soTtvalues = np.zeros((dimt,2), dtype=np.float) 1219 1217 else: … … 1270 1268 itod = int( (int(tvalues[it+1,1]) - ito) / 2 ) 1271 1269 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)] = slicevar1277 1270 1278 1271 soTtvalues[it,0] = valdimobs['T'][itoi] … … 1350 1343 ## 1351 1344 if kvals == 'instantaneous': 1352 return sovalues, soSvalues, soT values, soTtvalues, trjs1345 return sovalues, soSvalues, soTtvalues, trjs 1353 1346 1354 1347 elif kvals == 'tbackwardSmean': … … 1368 1361 1369 1362 if okind == 'single-station': 1370 fsoTvalues = {}1371 1363 fsoTtvalues = np.zeros((dimtf,2), dtype=np.float) 1372 1364 else: … … 1407 1399 iy,ix]) 1408 1400 print fsoSvalues[it,] 1409 print 'soTvalues________________',type(soTvalues)1410 for itt in range(intv[0],intv[1]):1411 print soTvalues[str(itt)]1412 1401 fsoTtvalues[it,0] = soTtvalues[intv[0],0] 1413 1402 fsoTtvalues[it,1] = soTtvalues[intv[1],0] 1414 1403 print fsoTtvalues[it,:] 1415 quit() 1416 1404 1405 quit() 1406 return sovalues, soSvalues, soTtvalues, trjs 1417 1407 1418 1408 elif kvals == 'tbackwardOmean': … … 1423 1413 1424 1414 1425 return sovalues, soSvalues, soTvalues, soTtvalues, trjs1415 return 1426 1416 1427 1417 … … 1939 1929 1940 1930 # Observed values temporally exact times 1941 Esimobsvalues, EsimobsSvalues, EsimobsT values, EsimobsTtvalues, trjsim =\1931 Esimobsvalues, EsimobsSvalues, EsimobsTtvalues, trjsim = \ 1942 1932 getting_ValidationValues(obskind, Nexactt, dims, trajpos, ovsim, ovobs, \ 1943 1933 exacttvalues, oFillValue, Ngrid, 'instantaneous') 1944 1934 1945 1935 # Observed values temporally around coincident times 1946 simobsvalues, simobsSvalues, simobsT values, simobsTtvalues, trjsim =\1936 simobsvalues, simobsSvalues, simobsTtvalues, trjsim = \ 1947 1937 getting_ValidationValues(obskind, Ncoindt, dims, trajpos, ovsim, ovobs, \ 1948 1938 coindtvalues, oFillValue, Ngrid, 'tbackwardSmean') … … 2109 2099 Earoundstats[2,it]) 2110 2100 2111 # Statistics around obs values exact2112 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*obsmask2117 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 2126 2101 # Statistics around sim values between 2127 2102 aroundstats = np.zeros((5,Ncoindt), dtype=np.float) … … 2133 2108 aroundstats[4,it] = np.sqrt(aroundstats[3,it] - aroundstats[2,it]* \ 2134 2109 aroundstats[2,it]) 2135 2136 # Statistics around obs values between2137 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*obsmask2142 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])2150 2110 2151 2111 # exact sim Values to netCDF
Note: See TracChangeset
for help on using the changeset viewer.