Changeset 817 for trunk/UTIL/PYTHON/myplot.py
- Timestamp:
- Oct 25, 2012, 11:24:38 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UTIL/PYTHON/myplot.py
r796 r817 65 65 def check_localtime(time): 66 66 a=-1 67 print time68 67 for i in range(len(time)-1): 69 68 if (time[i] > time[i+1]): a=i … … 452 451 453 452 ## Author: AS + TN 454 def definesubplot ( numplot, fig 453 def definesubplot ( numplot, fig, ipreferline=False): 455 454 from matplotlib.pyplot import rcParams 456 455 rcParams['font.size'] = 12. ## default (important for multiple calls) … … 470 469 subh = 1 471 470 fig.subplots_adjust(hspace = 0.5) 471 if ipreferline: subv = 1 ; subh = 3 ; fig.subplots_adjust(wspace = 0.35) 472 472 rcParams['font.size'] = int( rcParams['font.size'] * 1. / 2. ) 473 473 elif numplot == 4: … … 883 883 h = 50. ## en km 884 884 radius = 3397200. 885 #print meanlat, meanlon886 885 if char == "cyl": m = Basemap(rsphere=radius,projection='cyl',\ 887 886 llcrnrlat=wlat[0],urcrnrlat=wlat[1],llcrnrlon=wlon[0],urcrnrlon=wlon[1]) … … 900 899 elif char == "merc": m = Basemap(rsphere=radius,projection='merc',lat_ts=0.,\ 901 900 llcrnrlat=wlat[0],urcrnrlat=wlat[1],llcrnrlon=wlon[0],urcrnrlon=wlon[1]) 901 elif char == "geos": m = Basemap(rsphere=radius,projection='geos',lon_0=meanlon) 902 elif char == "robin": m = Basemap(rsphere=radius,projection='robin',lon_0=0) 903 elif char == "cass": 904 if zewidth > 60000.: ## approx. more than one degree 905 m = Basemap(rsphere=radius,projection='cass',\ 906 lon_0=meanlon,lat_0=meanlat,\ 907 width=zewidth,height=zeheight) 908 else: 909 m = Basemap(rsphere=radius,projection='cass',\ 910 lon_0=meanlon,lat_0=meanlat,\ 911 llcrnrlat=wlat[0],urcrnrlat=wlat[1],llcrnrlon=wlon[0],urcrnrlon=wlon[1]) 912 else: errormess("projection not supported.") 902 913 fontsizemer = int(mpl.rcParams['font.size']*3./4.) 903 if char in ["cyl","lcc","merc","nsper","laea"]: step = findstep(wlon) 904 else: step = 10. 905 steplon = step*2. 914 if zewidth > 60000.: 915 if char in ["cyl","lcc","merc","nsper","laea"]: step = findstep(wlon) 916 else: step = 10. 917 steplon = step*2. 918 else: 919 print "very small domain !" 920 steplon = 0.5 921 step = 0.5 906 922 zecolor ='grey' 907 923 zelinewidth = 1 908 zelatmax = 80 909 if meanlat > 75.: zelatmax = 90. ; step = step/2.924 zelatmax = 80. 925 if meanlat > 75.: zelatmax = 90. ; step = step/2. ; steplon = steplon*2. 910 926 # to show gcm grid: 911 927 #zecolor = 'r' … … 914 930 #steplon = 360./64. 915 931 #zelatmax = 90. - step/3 916 if char not in ["moll" ]:932 if char not in ["moll","robin"]: 917 933 if wlon[1]-wlon[0] < 2.: ## LOCAL MODE 918 934 m.drawmeridians(np.r_[-1.:1.:0.05], labels=[0,0,0,1], color=zecolor, linewidth=zelinewidth, fontsize=fontsizemer, fmt='%5.2f') … … 1041 1057 "TPOT": "%.0f",\ 1042 1058 "TSURF": "%.0f",\ 1059 "TSK": "%.0f",\ 1043 1060 "U_OUT1": "%.0f",\ 1044 1061 "T_OUT1": "%.0f",\ … … 1092 1109 "TPOT": "Paired",\ 1093 1110 "TSURF": "RdBu_r",\ 1111 "TSK": "RdBu_r",\ 1094 1112 "QH2O": "PuBu",\ 1095 1113 "USTM": "YlOrRd",\ … … 1350 1368 else: y = lat 1351 1369 count = count+1 1352 if indexvert is None and ((dim0 == 4) or (y is None)):1370 if indexvert is None and len(vert) > 1 and ((dim0 == 4) or (y is None)): 1353 1371 print "AXIS is vert" 1354 1372 if vertmode == 0: # vertical axis is as is (GCM grid)
Note: See TracChangeset
for help on using the changeset viewer.