Changeset 468 in lmdz_wrf for trunk/tools
- Timestamp:
- Jun 9, 2015, 6:15:34 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/validation_sim.py
r467 r468 1422 1422 1423 1423 ovobs = oobs.variables[valvars[ivar][1]] 1424 if searchInlist(ovobs.ncattrs(),'_FillValue'): 1425 oFillValue = ovobs.getncattr('_FillValue') 1424 1426 1425 1427 # Simulated values spatially around coincident times … … 1451 1453 for it in range(Ncoindt): 1452 1454 ito = int(coindtvalues[it,1]) 1453 slicev = dims['X'][0] + ':' + str(stationpos[1]) + '|' + \ 1454 dims['Y'][0] + ':' + str(stationpos[0]) + '|' + \ 1455 dims['T'][0] + ':' + str(int(coindtvalues[it][0])) 1455 if valdimsim.has_key('X') and valdimsim.has_key('Y'): 1456 slicev = dims['X'][0] + ':' + str(stationpos[1]) + '|' + \ 1457 dims['Y'][0] + ':' + str(stationpos[0]) + '|' + \ 1458 dims['T'][0] + ':' + str(int(coindtvalues[it][0])) 1459 else: 1460 slicev = dims['T'][0] + ':' + str(int(coindtvalues[it][0])) 1456 1461 slicevar, dimslice = slice_variable(ovsim, slicev) 1457 if ovobs[int(ito)] != ovobs[int(ito)]:1462 if ovobs[int(ito)] == oFillValue or ovobs[int(ito)] == '--': 1458 1463 simobsvalues.append([ slicevar, fillValueF]) 1464 # elif ovobs[int(ito)] != ovobs[int(ito)]: 1465 # simobsvalues.append([ slicevar, fillValueF]) 1459 1466 else: 1460 1467 simobsvalues.append([ slicevar, ovobs[int(ito)]]) 1461 slicev = dims['X'][0] + ':' + str(stationpos[1]-Ngrid) + '@' + \ 1462 str(stationpos[1]+Ngrid+1) + '|' + dims['Y'][0] + ':' + \ 1463 str(stationpos[0]-Ngrid) + '@' + str(stationpos[0]+Ngrid+1) + '|' + \ 1464 dims['T'][0] + ':' + str(int(coindtvalues[it,0])) 1468 if valdimsim.has_key('X') and valdimsim.has_key('Y'): 1469 slicev = dims['X'][0] + ':' + str(stationpos[1]-Ngrid) + '@' + \ 1470 str(stationpos[1]+Ngrid+1) + '|' + dims['Y'][0] + ':' + \ 1471 str(stationpos[0]-Ngrid) + '@' + str(stationpos[0]+Ngrid+1) + '|' +\ 1472 dims['T'][0] + ':' + str(int(coindtvalues[it,0])) 1473 else: 1474 slicev = dims['T'][0] + ':' + str(int(coindtvalues[it][0])) 1465 1475 slicevar, dimslice = slice_variable(ovsim, slicev) 1466 1476 simobsSvalues[it,:,:] = slicevar … … 1629 1639 1630 1640 # sim Values to netCDF 1631 newvar = onewnc.createVariable(valvars[ivar][0] , 'f', ('time'),\1641 newvar = onewnc.createVariable(valvars[ivar][0] + '_sim', 'f', ('time'), \ 1632 1642 fill_value=fillValueF) 1633 1643 descvar = 'simulated: ' + valvars[ivar][0] … … 1636 1646 1637 1647 # obs Values to netCDF 1638 newvar = onewnc.createVariable(valvars[ivar][1] , 'f', ('time'),\1648 newvar = onewnc.createVariable(valvars[ivar][1] + '_obs', 'f', ('time'), \ 1639 1649 fill_value=fillValueF) 1640 1650 descvar = 'observed: ' + valvars[ivar][1]
Note: See TracChangeset
for help on using the changeset viewer.