- Timestamp:
- Apr 4, 2018, 2:22:43 AM (7 years ago)
- Location:
- trunk/tools
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/CFvariables.dat
r1864 r1887 14 14 uas new_z_dim height height 10. 15 15 vas new_z_dim height height 10. 16 hus new_z_dim pressure pressure 'FROMfile,press'17 ta new_ z_dim pressure pressure 'FROMfile,press'18 ua new_ z_dim pressure pressure 'FROMfile,press'19 va new_ z_dim pressure pressure 'FROMfile,press'20 wa new_ z_dim pressure pressure 'FROMfile,press'21 zg new_ z_dim pressure pressure 'FROMfile,press'16 hus new_z_dim pressure pressure FROMfile,pres 17 ta new_p_dim pressure pressure FROMfile,pres 18 ua new_p_dim pressure pressure FROMfile,pres 19 va new_p_dim pressure pressure FROMfile,pres 20 wa new_p_dim pressure pressure FROMfile,pres 21 zg new_p_dim pressure pressure FROMfile,pres 22 22 -
trunk/tools/generic_tools.py
r1870 r1887 12734 12734 'axis': 'Y', '_CoordinateAxisType': 'Lat', \ 12735 12735 'maxrank': 2, 'length': 0} 12736 CFpress= {'dimn': 'pres sure', 'vdimn': 'pressure',\12736 CFpress= {'dimn': 'pres', 'vdimn': 'pres', \ 12737 12737 'stdn': 'pressure', 'longname': 'Pressure', 'units': 'Pa', \ 12738 12738 'axis': 'Z', '_CoordinateAxisType': 'Pres', 'positive': 'down', \ … … 12748 12748 12749 12749 # names to search for 12750 lonn = ['lon', 'X', 'Longitude', 'longitude', 'x' ]12751 latn = ['lat', 'Y', 'Latitude', 'latitude', 'y' ]12752 pressn = ['pres s', 'P', 'Press', 'Pressure', 'pressure', 'p']12750 lonn = ['lon', 'X', 'Longitude', 'longitude', 'x', 'west_east'] 12751 latn = ['lat', 'Y', 'Latitude', 'latitude', 'y', 'south_north'] 12752 pressn = ['pres', 'press', 'P', 'Press', 'Pressure', 'pressure', 'p'] 12753 12753 heightn = ['height', 'Z', 'Height', 'z'] 12754 12754 timen = ['time', 'T', 'Time', 'TIME', 't'] -
trunk/tools/nc_var_tools.py
r1886 r1887 22966 22966 listoc= list of NetCDF file objects 22967 22967 """ 22968 fname = 'get var_listonc'22968 fname = 'getdim_listonc' 22969 22969 22970 22970 allfs = {} … … 23273 23273 fname = 'CFvars' 23274 23274 23275 availactions = ['new_p_dim', 'new_z_dim']23275 availactions = ['new_p_dim', 'new_z_dim'] 23276 23276 23277 23277 folder = os.path.dirname(os.path.realpath(__file__)) … … 23307 23307 newvvar = np.float(CFactions[3]) 23308 23308 else: 23309 vn = CFacti nos[3].split[0]23309 vn = CFactions[3].split(',')[1] 23310 23310 if not innc.variables.has_key(vn): 23311 23311 print errormsg … … 23316 23316 ovar = innc.variables[vn] 23317 23317 # Assuming all the same value! 23318 var1D = ovar .flatten()23318 var1D = ovar[:].flatten() 23319 23319 newvvar = var1D[0] 23320 23320 outnc.createDimension(newdim, 1) … … 23354 23354 newvvar = np.float(CFactions[3]) 23355 23355 else: 23356 vn = CFacti nos[3].split[0]23356 vn = CFactions[3].split(',')[1] 23357 23357 if not innc.variables.has_key(vn): 23358 23358 print errormsg … … 23633 23633 23634 23634 # CF values of axis 23635 CFdimvalues = gen.CFcorValues( axn)23635 CFdimvalues = gen.CFcorValues(dimn) 23636 23636 #print ' ' + axn + " ..." 23637 23637 #print ' dimension in file:', dimn, ' variable in file:', vardimn … … 23670 23670 if dn == dimn and CFdimvalues['length'] != -1: 23671 23671 CFdimvalues['length'] = len(oaxisd) 23672 ax siv = oaxisv[tuple(varslice)]23672 axisv = oaxisv[tuple(varslice)] 23673 23673 else: 23674 23674 print errormsg … … 23737 23737 23738 23738 CFdimvals[axn] = CFdimvalues 23739 filedimvals[axn] = ax siv[:]23739 filedimvals[axn] = axisv[:] 23740 23740 CFaxisvardimvals[axn] = CFvardimvalues 23741 23741 … … 23911 23911 varv = np.where(varv == fill_value, gen.fillValueF, varv) 23912 23912 else: 23913 print 'Lluis: ', newVdims 23913 23914 newvar=onewnc.createVariable(cfvarn, 'f4', tuple(newVdims), \ 23914 23915 fill_value=gen.fillValueF) -
trunk/tools/variables_values.dat
r1858 r1887 304 304 LPR_CON_L, prcl, convective_liquid_precipitation_flux, 0., 0.003, convective|liquid|precipitation|flux, kgm-2s-1, Blues, $prcl$, prcl 305 305 plev, plev, air_pressure, 0., 103000., air|pressure, Pa, Blues, $plev$, plev 306 presnivs, pres, air_pressure, 0., 103000., air|pressure, Pa, Blues, $pres s$, press307 pres, p lev, air_pressure, 0., 103000., air|pressure, Pa, Blues, $press$, press308 lpres, p lev, air_pressure, 0., 103000., air|pressure, Pa, Blues, $press$, press309 LPRES, p lev, air_pressure, 0., 103000., air|pressure, Pa, Blues, $press$, press310 PRES, p lev, air_pressure, 0., 103000., air|pressure, Pa, Blues, $press$, press311 WRFp, p lev, air_pressure, 0., 103000., air|pressure, Pa, Blues, $press$, press306 presnivs, pres, air_pressure, 0., 103000., air|pressure, Pa, Blues, $pres$, pres 307 pres, pres, air_pressure, 0., 103000., air|pressure, Pa, Blues, $pres$, pres 308 lpres, pres, air_pressure, 0., 103000., air|pressure, Pa, Blues, $pres$, pres 309 LPRES, pres, air_pressure, 0., 103000., air|pressure, Pa, Blues, $pres$, pres 310 PRES, pres, air_pressure, 0., 103000., air|pressure, Pa, Blues, $pres$, pres 311 WRFp, pres, air_pressure, 0., 103000., air|pressure, Pa, Blues, $pres$, pres 312 312 p_base, p_base, air_pressure_base, 0., 103000., air|pressure|base|state, Pa, Blues, $press^{base}$, press_base 313 313 PB, p_base, air_pressure_base, 0., 103000., air|pressure|base|state, Pa, Blues, $press^{base}$, press_base
Note: See TracChangeset
for help on using the changeset viewer.