Changeset 453 for trunk/UTIL
- Timestamp:
- Dec 5, 2011, 2:50:20 PM (13 years ago)
- Location:
- trunk/UTIL/PYTHON
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UTIL/PYTHON/README.PP
r451 r453 53 53 Goal: I want the same map, but projected with north polar stereographic view 54 54 pp.py -f diagfired.nc -v tauice -m 0.2 -M 0.9 -H -b vishires -p npstere 55 56 Goal: I want the same map, but with a transparent field to see background image 57 pp.py -f diagfired.nc -v tauice -m 0.2 -M 0.9 -H -b vishires -p npstere --trans 0.6 55 58 56 59 Goal: I want to save this in PNG format -
trunk/UTIL/PYTHON/myplot.py
r451 r453 196 196 subh = 99999 197 197 elif numplot == 2: 198 subv = 1199 subh = 2198 subv = 2 199 subh = 1 200 200 fig.subplots_adjust(wspace = 0.35) 201 201 rcParams['font.size'] = int( rcParams['font.size'] * 3. / 4. ) 202 202 elif numplot == 3: 203 subv = 2204 subh = 2203 subv = 3 204 subh = 1 205 205 fig.subplots_adjust(wspace = 0.5) 206 206 rcParams['font.size'] = int( rcParams['font.size'] * 1. / 2. ) … … 228 228 subv = 3 229 229 subh = 4 230 fig.subplots_adjust(wspace = 0 .1, hspace = 0.1)230 fig.subplots_adjust(wspace = 0, hspace = 0.1) 231 231 rcParams['font.size'] = int( rcParams['font.size'] * 1. / 2. ) 232 232 elif numplot <= 16: … … 559 559 if blat is None: 560 560 ortholat=meanlat 561 if wlat[0] >= 80.: blat = 40.561 if wlat[0] >= 80.: blat = -40. 562 562 elif wlat[1] <= -80.: blat = -40. 563 563 elif wlat[1] >= 0.: blat = wlat[0] … … 586 586 else: step = 10. 587 587 steplon = step*2. 588 #if back in ["geolocal"]: 589 # step = np.min([5.,step]) 590 # steplon = step 591 m.drawmeridians(np.r_[-180.:180.:steplon], labels=[0,0,0,1], color='grey', fontsize=fontsizemer) 592 m.drawparallels(np.r_[-90.:90.:step], labels=[1,0,0,0], color='grey', fontsize=fontsizemer) 588 zecolor ='grey' 589 zelinewidth = 1 590 zelatmax = 80 591 # to show gcm grid: 592 #zecolor = 'r' 593 #zelinewidth = 1 594 #step = 5.625 595 #steplon = 5.625 596 #zelatmax = 89.9 597 m.drawmeridians(np.r_[-180.:180.:steplon], labels=[0,0,0,1], color=zecolor, linewidth=zelinewidth, fontsize=fontsizemer, latmax=zelatmax) 598 m.drawparallels(np.r_[-90.:90.:step], labels=[1,0,0,0], color=zecolor, linewidth=zelinewidth, fontsize=fontsizemer, latmax=zelatmax) 593 599 if back: m.warpimage(marsmap(back),scale=0.75) 594 600 #if not back: … … 770 776 "VMR_H2OICE": "PuBu",\ 771 777 "VMR_H2OVAP": "PuBu",\ 778 "WATERCAPTAG": "Blues",\ 772 779 } 773 780 #W --> spectral ou jet … … 810 817 #"mola": "http://www.lns.cornell.edu/~seb/celestia/mars-mola-2k.jpg",\ 811 818 #"molabw": "http://dl.dropbox.com/u/11078310/MarsElevation_2500x1250.jpg",\ 819 "thermalday": domain+"thermalday.jpg",\ 820 "thermalnight": domain+"thermalnight.jpg",\ 821 "tesalbedo": domain+"tesalbedo.jpg",\ 812 822 "vis": domain+"mar0kuu2.jpg",\ 813 823 "vishires": domain+"MarsMap_2500x1250.jpg",\ -
trunk/UTIL/PYTHON/myscript.py
r451 r453 30 30 parser.add_option('-T', '--tiled', action='store_true',dest='tile', default=False, help='draw a tiled plot (no blank zone)') 31 31 parser.add_option('--res', action='store',dest='res', type="float", default=200., help='Resolution for png outputs. --save png needed. [200.]') 32 parser.add_option('--trans', action='store',dest='trans', type="float", default=1., help='shaded plots transparency, from 0 (transparent) to 1 (opaque) [1]') 32 33 33 34 ### SPECIFIC FOR MAPPING [MAPMODE 1] -
trunk/UTIL/PYTHON/planetoplot.py
r451 r453 55 55 flagnolow=False,\ 56 56 mrate=None,\ 57 mquality=False): 57 mquality=False,\ 58 trans=1): 58 59 59 60 … … 363 364 #zelevels = np.linspace(zevmin*(1. + 1.e-7),zevmax*(1. - 1.e-7)) #,num=20) 364 365 zelevels = np.linspace(zevmin,zevmax,num=ticks) 365 if mapmode == 1: m.contourf( x, y, what_I_plot_frame, zelevels, cmap = palette )366 elif mapmode == 0: contourf( x, y, what_I_plot_frame, zelevels, cmap = palette )366 if mapmode == 1: m.contourf( x, y, what_I_plot_frame, zelevels, cmap = palette, alpha=trans) 367 elif mapmode == 0: contourf( x, y, what_I_plot_frame, zelevels, cmap = palette, alpha=trans) 367 368 else: 368 if mapmode == 1: m.pcolor( x, y, what_I_plot_frame, cmap = palette, vmin=zevmin, vmax=zevmax )369 elif mapmode == 0: pcolor( x, y, what_I_plot_frame, cmap = palette, vmin=zevmin, vmax=zevmax )369 if mapmode == 1: m.pcolor( x, y, what_I_plot_frame, cmap = palette, vmin=zevmin, vmax=zevmax ,alpha=trans) 370 elif mapmode == 0: pcolor( x, y, what_I_plot_frame, cmap = palette, vmin=zevmin, vmax=zevmax ,alpha=trans) 370 371 if colorb != 'nobar': 371 372 if (fileref is not None) and (index_f is numplot-1): daformat = "%.3f" -
trunk/UTIL/PYTHON/pp.py
r451 r453 140 140 ope=opt.operat,fileref=reffile,minop=opt.vminope,maxop=opt.vmaxope,titleref=opt.titref,\ 141 141 invert_y=opt.inverty,xaxis=zexaxis,yaxis=zeyaxis,ylog=opt.logy,yintegral=opt.column,\ 142 blat=opt.blat,blon=opt.blon,tsat=opt.tsat,flagnolow=opt.nolow,mrate=opt.rate,mquality=opt.quality) 142 blat=opt.blat,blon=opt.blon,tsat=opt.tsat,flagnolow=opt.nolow,\ 143 mrate=opt.rate,mquality=opt.quality,trans=opt.trans) 143 144 print 'DONE: '+name 144 145 system("rm -f to_be_erased")
Note: See TracChangeset
for help on using the changeset viewer.