- Timestamp:
- Mar 4, 2012, 9:24:59 PM (13 years ago)
- Location:
- trunk/UTIL/PYTHON
- Files:
-
- 1 added
- 1 deleted
- 2 edited
- 4 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/UTIL/PYTHON/myecmwf.py
r546 r558 7 7 elif var == "130": name="Atmospheric Temperature (K)" # ["130", "an", "0", "pl" ] 8 8 elif var == "167": name="2m Atmospheric Temperature (K)" # ["167", "fc", "3", "sfc"] 9 elif var == "78": name="Total column liquid water (kg/kg)"9 elif var == "78": name="Total column liquid water (kg/kg)" 10 10 elif var == "137": name="Total column water vapour (kg/m2)" 11 else: name="" 11 12 return name 12 13 … … 22 23 return varchar 23 24 24 def get_ecmwf (var, dataset, wlat, wlon, lev, date, tim):25 def get_ecmwf (var, fieldtype, wlat, wlon, lev, date, tim): 25 26 from ecmwf import ECMWFDataServer 26 27 from os import system 27 28 from netCDF4 import Dataset 28 29 gbfile = 'output.grib' 29 ncfile = 'output.nc' 30 #ncfile = str(date[2]) + str(date[1]) + str(date[0]) + str(date[5]) + str(date[4]) + str(date[3])+'.nc' 31 ncfile = 'output.nc' 32 ###### 33 if fieldtype == "3d": 34 dataset = ["an","pl","0"] 35 elif fieldtype == "2d": 36 dataset = ["fc","sfc","3"] 37 lev = [9999.] 30 38 ###### 31 39 timchar = split_char (tim) -
trunk/UTIL/PYTHON/myplot.py
r548 r558 43 43 elif hasattr(nc,'START_DATE'): typefile = 'meso' 44 44 elif 'HGT_M' in nc.variables: typefile = 'geo' 45 elif hasattr(nc,'institution'): 46 if "European Centre" in getattr(nc,'institution'): typefile = 'ecmwf' 45 47 else: typefile = 'gcm' # for lslin-ed files from gcm 46 48 return typefile … … 449 451 elif typefile in ['gcm']: 450 452 [lon2d,lat2d] = getcoord2d(nc,nlat="latitude",nlon="longitude",is1d=True) 451 elif typefile in ['earthgcm' ]:453 elif typefile in ['earthgcm','ecmwf']: 452 454 [lon2d,lat2d] = getcoord2d(nc,nlat="lat",nlon="lon",is1d=True) 453 455 elif typefile in ['geo']: … … 886 888 "jupiter": "http://www.mmedia.is/~bjj/data/jupiter_css/jupiter_css.jpg",\ 887 889 "jupiter_voy": "http://www.mmedia.is/~bjj/data/jupiter/jupiter_vgr2.jpg",\ 890 #"bw": domain+"EarthElevation_2500x1250.jpg",\ 888 891 "bw": "http://users.info.unicaen.fr/~karczma/TEACH/InfoGeo/Images/Planets/EarthElevation_2500x1250.jpg",\ 889 892 "contrast": "http://users.info.unicaen.fr/~karczma/TEACH/InfoGeo/Images/Planets/EarthMapAtmos_2500x1250.jpg",\ -
trunk/UTIL/PYTHON/planetoplot.py
r548 r558 160 160 else: [wlon,wlat] = simplinterv(lon2d,lat2d) 161 161 if zoom: [wlon,wlat] = zoomset(wlon,wlat,zoom) 162 elif zarea is not None: [wlon,wlat] = latinterv(area=zarea)162 elif zarea is not None: [wlon,wlat] = latinterv(area=zarea) 163 163 164 164 ########################################################## 165 165 ############ LOAD 4D DIMENSIONS : x, y, z, t ############# 166 166 ########################################################## 167 if typefile in ["gcm","earthgcm"]: 168 ### SPACE 169 if typefile == "gcm": lat = nc.variables["latitude"][:] ; lon = nc.variables["longitude"][:] ; vert = nc.variables["altitude"][:] 170 elif typefile == "earthgcm": lat = nc.variables["lat"][:] ; lon = nc.variables["lon"][:] ; vert = nc.variables["Alt"][:] 171 if "aire" in nc.variables: area = nc.variables["aire"][:,:] #JL to weight means with the area 167 if typefile in ["gcm","earthgcm","ecmwf"]: 168 ### LAT 169 if "latitude" in nc.variables: lat = nc.variables["latitude"][:] 170 elif "lat" in nc.variables: lat = nc.variables["lat"][:] 171 ### LON 172 if "longitude" in nc.variables: lon = nc.variables["longitude"][:] 173 elif "lon" in nc.variables: lon = nc.variables["lon"][:] 174 ### ALT 175 if "altitude" in nc.variables: vert = nc.variables["altitude"][:] 176 elif "Alt" in nc.variables: vert = nc.variables["Alt"][:] 177 elif "lev" in nc.variables: vert = nc.variables["lev"][:] 178 else: vert = [0.] 179 ### AIRE (to weight means with the area) 180 if "aire" in nc.variables: area = nc.variables["aire"][:,:] 172 181 else: area = None 173 182 ### TIME
Note: See TracChangeset
for help on using the changeset viewer.