Changeset 2780 in lmdz_wrf for trunk/tools
- Timestamp:
- Dec 6, 2019, 8:48:32 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/drawing_tools.py
r2777 r2780 3060 3060 if len(projvals) != Nvals: 3061 3061 expvals = ['llcrnrlon', 'llcrnrlat', 'urcrnrlon','urcrnrlat'] 3062 print err rormsg3062 print errormsg 3063 3063 print ' ' + fname + ": projection '" + proj + "' reequires ", Nvals, \ 3064 3064 "values, ", len(projvals), 'provided!!' … … 3070 3070 3071 3071 elif proj == 'lcc': 3072 Nvals = 63072 Nvals = 8 3073 3073 if len(projvals) != Nvals: 3074 expvals = ['lat _0', 'lon_0', 'llcrnrlon', 'llcrnrlat', 'urcrnrlon',\3075 ' urcrnrlat']3076 print err rormsg3074 expvals = ['lat1', 'lat2', 'lat_0', 'lon_0', 'SWlon', 'SWlat', 'NElon', \ 3075 'NElat'] 3076 print errormsg 3077 3077 print ' ' + fname + ": projection '" + proj + "' reequires ", Nvals, \ 3078 3078 "values, ", len(projvals), 'provided!!' … … 3080 3080 print ' provided:', projvals 3081 3081 quit(-1) 3082 defmap = Basemap(projection=proj, lat_0=projvals[0], lon_0=projvals[1], \ 3083 llcrnrlon=projvals[2], llcrnrlat=projvals[3], urcrnrlon=projvals[4], \ 3084 urcrnrlat=projvals[5], resolution=res) 3082 defmap = Basemap(projection=proj, lat_1=projvals[0], lat_2=projvals[1], \ 3083 lat_0=projvals[2], lon_0=projvals[3], llcrnrlon=projvals[4], \ 3084 llcrnrlat=projvals[5], urcrnrlon=projvals[6], urcrnrlat=projvals[7], \ 3085 resolution=res) 3085 3086 3086 3087 elif proj == 'npstere': … … 3088 3089 if len(projvals) != Nvals: 3089 3090 expvals = ['boundinglat', 'lon_0'] 3090 print err rormsg3091 print errormsg 3091 3092 print ' ' + fname + ": projection '" + proj + "' reequires ", Nvals, \ 3092 3093 "values, ", len(projvals), 'provided!!' … … 4439 4440 m = DefineMap(map_proj, map_res, [nlon,nlat,xlon,xlat]) 4440 4441 elif map_proj == 'lcc': 4441 m = DefineMap(map_proj, map_res, [lat2, lon2, nlon, nlat, xlon, xlat]) 4442 Nvals = len(mapv.split(',')) 4443 if Nvals > 2: 4444 expected = ['lat1', 'lat2', 'lat_0', 'lon_0', 'llcrnrlo', \ 4445 'llcrnrlat', 'urcrnrlon', 'urcrnrlat'] 4446 Nexpected = len(expected) 4447 if Nvals - 2 != Nexpected: 4448 print errormsg 4449 print ' ' + fname + ": additional values provided for '" + \ 4450 map_proj + "' but ", Nexpected, "where expected and", Nvals, \ 4451 "provided" 4452 print ' one epxect to additinoaly have:', ','.join(expected) 4453 quit(-1) 4454 lat1 = np.float(mapv.split(',')[2]) 4455 lon2 = np.float(mapv.split(',')[3]) 4456 lat_0 = np.float(mapv.split(',')[4]) 4457 lon_0 = np.float(mapv.split(',')[5]) 4458 SWlon = np.float(mapv.split(',')[6]) 4459 SWlat = np.float(mapv.split(',')[7]) 4460 NElon = np.float(mapv.split(',')[8]) 4461 NElat = np.float(mapv.split(',')[9]) 4462 m = DefineMap(map_proj, map_res, [lat1, lat2, lat_0, lon_0, SWlon, \ 4463 SWlat, NElon, NElat]) 4464 else: 4465 m = DefineMap(map_proj, map_res, [nlat, xlat, lat2, lon2]) 4442 4466 elif map_proj == 'npstere': 4443 4467 m = DefineMap(map_proj, map_res, [lat2, lon2])
Note: See TracChangeset
for help on using the changeset viewer.