Changeset 427
- Timestamp:
- Nov 30, 2011, 10:05:32 AM (13 years ago)
- Location:
- trunk/UTIL/PYTHON
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UTIL/PYTHON/mcs.py
r418 r427 33 33 parser.add_option('-i', '--zrecast', action='store_true', dest='zrecast', default=False, help='Cast zrecast.e on diagfi file with MCS pressure levels. Will pass this operation is recasted file is already present, unless --override is specified. [False]') 34 34 parser.add_option('--override', action='store_true', dest='override', default=False, help='Force zrecast.e to act even if recasted file is already present(will erase previous recasted file) [False]') 35 35 parser.add_option('--ditch', action='store_true', dest='ditch', default=False, help='Ditch recasted file when interpolation is performed. [False]') 36 36 ############################# 37 37 ### Get options and variables … … 302 302 zvariables=all, \ 303 303 znames=fullnames) 304 if opt.zrecast and opt.ditch: 305 print "removing interpolated file" 306 system("rm -f "+opt.file[0:len(opt.file)-3]+"_P.nc") -
trunk/UTIL/PYTHON/mymath.py
r403 r427 26 26 field.set_fill_value(np.NaN) 27 27 zout=np.ma.array(field).mean(axis=axis) 28 zout.set_fill_value(np.NaN) 29 return zout.filled() 28 if axis is not None: 29 zout.set_fill_value(np.NaN) 30 return zout.filled() 31 else:return zout 30 32 elif (np.isnan(np.sum(field)) and (type(field).__name__ not in 'MaskedArray')): 31 33 zout=np.ma.masked_invalid(field).mean(axis=axis) 32 zout.set_fill_value([np.NaN]) 33 return zout.filled() 34 if axis is not None: 35 zout.set_fill_value([np.NaN]) 36 return zout.filled() 37 else:return zout 34 38 else: 35 39 return np.array(field).mean(axis=axis) -
trunk/UTIL/PYTHON/myplot.py
r426 r427 113 113 output = mean(input[d4,:,:,:],axis=0) 114 114 output = reduce_zaxis(output[d3,:,:],ax=0,yint=yint,vert=alt,indice=d3) 115 if anomaly: output = 100. * ((output / smooth(output,csmooth)) - 1.) 115 if anomaly: output = 100. * ((output / smooth(output,csmooth)) - 1.) 116 116 output = mean(output[d2,:],axis=0) 117 117 output = mean(output[d1],axis=0) … … 685 685 "TEMP_NIGHT": "%.0f",\ 686 686 # Variables from MCS and mcs.py ncdf format 687 "DTEMP": "%.0f",\ 688 "NTEMP": "%.0f",\ 687 "DTEMP": "%.0f",\ 688 "NTEMP": "%.0f",\ 689 "DNUMBINTEMP": "%.0f",\ 690 "NNUMBINTEMP": "%.0f",\ 689 691 # other stuff 690 692 "TPOT": "%.0f",\ -
trunk/UTIL/PYTHON/planetoplot.py
r426 r427 280 280 if var2 == 'HGT': zelevels = np.arange(-10000.,30000.,2000.) 281 281 if mapmode == 0: 282 x, y = define_axis(lon,lat,vert,time,indexlon,indexlat,indexvert,\283 indextime,what_I_plot .shape, len(all_var2[index_f].shape),vertmode)282 what_I_plot, x, y = define_axis(lon,lat,vert,time,indexlon,indexlat,indexvert,\ 283 indextime,what_I_plot, len(all_var2[index_f].shape),vertmode) 284 284 ### If we plot a 2-D field 285 285 if len(what_I_plot.shape) is 2: 286 286 cs = contour(x,y,what_I_plot, zelevels, colors='k', linewidths = 1 ) #0.33 colors='w' )# , alpha=0.5) 287 #if typefile in ['gcm']: clabel(cs,fmt = '%1.2e') 287 # clabel(cs,#zelevels[::2], 288 # inline=3, 289 # fmt='%1.1e', 290 # fontsize=7) 288 291 ### If we plot a 1-D field 289 292 elif len(what_I_plot.shape) is 1:
Note: See TracChangeset
for help on using the changeset viewer.