- Timestamp:
- Jul 27, 2011, 2:23:11 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MESOSCALE_DEV/PLOT/PYTHON/scripts/winds.py
r243 r244 29 29 save="gui",\ 30 30 anomaly=False,\ 31 var2=None): 31 var2=None,\ 32 ndiv=10): 32 33 33 34 #################################################################################################################### … … 140 141 ### 141 142 if anomaly: 142 what_I_plot = 100. * ((what_I_plot / smooth(what_I_plot,1 0)) - 1.)143 what_I_plot = 100. * ((what_I_plot / smooth(what_I_plot,12)) - 1.) 143 144 fvar = 'anomaly' 144 145 ### … … 156 157 vmin=zevmin, vmax=zevmax ) 157 158 if colorb != 'nobar' and var != 'HGT': 158 ndiv = 10159 159 colorbar(fraction=0.05,pad=0.1,format=fmtvar(fvar),\ 160 160 ticks=np.linspace(zevmin,zevmax,ndiv+1),\ … … 248 248 ### Get options and variables 249 249 parser = OptionParser() 250 parser.add_option('-f', action='append',dest='namefile', type="string", default=None, help='[NEEDED] name of WRF file (append)') 251 parser.add_option('-l', action='store',dest='nvert', type="float", default=0, help='vertical level (def=0)(-i 2: p,mbar)(-i 3,4: z,km)') 252 parser.add_option('-p', action='store',dest='proj', type="string", default=None, help='projection') 253 parser.add_option('-b', action='store',dest='back', type="string", default=None, help='background image (def: None)') 254 parser.add_option('-t', action='store',dest='target', type="string", default=None, help='destination folder') 255 parser.add_option('-s', action='store',dest='stride', type="int", default=3, help='stride vectors (def=3)') 256 parser.add_option('-v', action='append',dest='var', type="string", default=None, help='variable color-shaded (append)') 257 parser.add_option('-n', action='store',dest='numplot', type="int", default=2, help='number of plots (def=1)(<0: 1 plot of LT -*numplot*)') 258 parser.add_option('-i', action='store',dest='interp', type="int", default=None, help='interpolation method (2: press, 3: z-amr, 4:z-als)') 259 parser.add_option('-c', action='store',dest='colorb', type="string", default="def", help='change colormap (nobar: no colorbar)') 260 parser.add_option('-x', action='store_false',dest='winds', default=True, help='no wind vectors') 261 parser.add_option('-m', action='append',dest='vmin', type="float", default=None, help='bounding minimum value (append)') 262 parser.add_option('-M', action='append',dest='vmax', type="float", default=None, help='bounding maximum value (append)') 263 parser.add_option('-T', action='store_true',dest='tile', default=False, help='draw a tiled plot (no blank zone)') 264 parser.add_option('-z', action='store',dest='zoom', type="float", default=None, help='zoom factor in %') 265 parser.add_option('-N', action='store_true',dest='nocall', default=False, help='do not recreate api file') 266 parser.add_option('-d', action='store_false',dest='display', default=True, help='do not pop up created images') 267 parser.add_option('-e', action='store',dest='itstep', type="int", default=None, help='stride time (def=4)') 268 parser.add_option('-H', action='store_true',dest='hole', default=False, help='holes above max and below min') 269 parser.add_option('-S', action='store',dest='save', type="string", default="gui", help='save mode (png,eps,svg,pdf or gui)(def=gui)') 270 parser.add_option('-a', action='store_true',dest='anomaly', default=False, help='compute and plot relative anomaly in %') 271 parser.add_option('-w', action='store',dest='var2', type="string", default=None, help='variable contoured') 250 parser.add_option('-f', '--file', action='append',dest='namefile', type="string", default=None, help='[NEEDED] name of WRF file (append)') 251 parser.add_option('-l', '--level', action='store',dest='nvert', type="float", default=0, help='level (def=0)(-i 2: p,mbar)(-i 3,4: z,km)') 252 parser.add_option('-p', '--proj', action='store',dest='proj', type="string", default=None, help='projection') 253 parser.add_option('-b', '--back', action='store',dest='back', type="string", default=None, help='background image (def: None)') 254 parser.add_option('-t', '--target', action='store',dest='target', type="string", default=None, help='destination folder') 255 parser.add_option('-s', '--stride', action='store',dest='stride', type="int", default=3, help='stride vectors (def=3)') 256 parser.add_option('-v', '--var', action='append',dest='var', type="string", default=None, help='variable color-shaded (append)') 257 parser.add_option('-n', '--num', action='store',dest='numplot', type="int", default=2, help='plot number (def=2)(<0: plot LT -*numplot*)') 258 parser.add_option('-i', '--interp', action='store',dest='interp', type="int", default=None, help='interpolation (2: p, 3: z-amr, 4:z-als)') 259 parser.add_option('-c', '--color', action='store',dest='colorb', type="string", default="def", help='change colormap (nobar: no colorbar)') 260 parser.add_option('-x', '--no-vect',action='store_false',dest='winds', default=True, help='no wind vectors') 261 parser.add_option('-m', '--min', action='append',dest='vmin', type="float", default=None, help='bounding minimum value (append)') 262 parser.add_option('-M', '--max', action='append',dest='vmax', type="float", default=None, help='bounding maximum value (append)') 263 parser.add_option('-T', '--tiled', action='store_true',dest='tile', default=False, help='draw a tiled plot (no blank zone)') 264 parser.add_option('-z', '--zoom', action='store',dest='zoom', type="float", default=None, help='zoom factor in %') 265 parser.add_option('-N', '--no-api', action='store_true',dest='nocall', default=False, help='do not recreate api file') 266 parser.add_option('-d', '--display',action='store_false',dest='display', default=True, help='do not pop up created images') 267 parser.add_option('-e', '--itime', action='store',dest='itstep', type="int", default=None, help='stride time (def=4)') 268 parser.add_option('-H', '--hole', action='store_true',dest='hole', default=False, help='holes above max and below min') 269 parser.add_option('-S', '--save', action='store',dest='save', type="string", default="gui", help='save mode (png,eps,svg,pdf or gui)(def=gui)') 270 parser.add_option('-a', '--anomaly',action='store_true',dest='anomaly', default=False, help='compute and plot relative anomaly in %') 271 parser.add_option('-w', '--with', action='store',dest='var2', type="string", default=None, help='variable contoured') 272 parser.add_option('--div', action='store',dest='ndiv', type="int", default=10, help='number of divisions in colorbar (def: 10)') 272 273 #parser.add_option('-V', action='store', dest='comb', type="float", default=None, help='a defined combination of variables') 273 274 (opt,args) = parser.parse_args() … … 344 345 tile=opt.tile,zoom=opt.zoom,display=opt.display,\ 345 346 itstep=opt.itstep,hole=opt.hole,save=opt.save,\ 346 anomaly=opt.anomaly,var2=opt.var2 )347 anomaly=opt.anomaly,var2=opt.var2,ndiv=opt.ndiv) 347 348 print 'Done: '+name 348 349 system("rm -f to_be_erased")
Note: See TracChangeset
for help on using the changeset viewer.