Changeset 483
- Timestamp:
- Dec 19, 2011, 9:57:26 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MESOSCALE/LMD_MM_MARS/SIMU/runmeso
r482 r483 195 195 3) scat=1 ;; 196 196 11) echo "!! How many scatterers are you using : 1,2,..." ; read scat ;; 197 12) echo "!! How many scatterers are you using : 1,2,..." ; read scat ;; 197 198 20) scat=1 ;; 198 199 *) scat=1 ;; -
trunk/UTIL/PYTHON/README.PP
r475 r483 71 71 Goal: I want to plot averaged results in the file from one time to another time 72 72 pp.py -f diagfi.nc -v tsurf --time 4,7 73 74 Goal: I want to plot the minimum/maximum value over times stored in the file 75 pp.py -f diagfi.nc -v tsurf --redope mint 76 pp.py -f diagfi.nc -v tsurf --redope maxt 73 77 74 78 Goal: I want to plot a globally-averaged 1D temperature profile -
trunk/UTIL/PYTHON/myplot.py
r477 r483 44 44 elif 'vert' in nc.variables: typefile = 'mesoapi' 45 45 elif 'U' in nc.variables: typefile = 'meso' 46 #elif 'HGT_M' in nc.variables: typefile = 'geo' 47 elif 'HGT' in nc.variables: typefile = 'meso' 46 48 elif 'HGT_M' in nc.variables: typefile = 'geo' 47 #else: errormess("whatkindfile: typefile not supported.")48 49 else: typefile = 'gcm' # for lslin-ed files from gcm 49 50 return typefile … … 75 76 76 77 ## Author: AS + TN + AC 77 def reducefield (input,d4=None,d3=None,d2=None,d1=None,yint=False,alt=None,anomaly=False ):78 def reducefield (input,d4=None,d3=None,d2=None,d1=None,yint=False,alt=None,anomaly=False,redope=None): 78 79 ### we do it the reverse way to be compliant with netcdf "t z y x" or "t y x" or "y x" 79 80 ### it would be actually better to name d4 d3 d2 d1 as t z y x 80 81 ### ... note, anomaly is only computed over d1 and d2 for the moment 81 82 import numpy as np 82 from mymath import max,mean 83 from mymath import max,mean,min 83 84 csmooth = 12 ## a fair amount of grid points (too high results in high computation time) 85 if redope is not None: 86 if redope == "mint": input = min(input,axis=0) ; d1 = None 87 elif redope == "maxt": input = max(input,axis=0) ; d1 = None 88 else: errormess("not supported. but try lines in reducefield beforehand.") 89 #elif redope == "minz": input = min(input,axis=1) ; d2 = None 90 #elif redope == "maxz": input = max(input,axis=1) ; d2 = None 91 #elif redope == "miny": input = min(input,axis=2) ; d3 = None 92 #elif redope == "maxy": input = max(input,axis=2) ; d3 = None 93 #elif redope == "minx": input = min(input,axis=3) ; d4 = None 94 #elif redope == "maxx": input = max(input,axis=3) ; d4 = None 84 95 dimension = np.array(input).ndim 85 96 shape = np.array(input).shape … … 201 212 subh = 99999 202 213 elif numplot == 2: 203 subv = 2204 subh = 1214 subv = 1 #2 215 subh = 2 #1 205 216 fig.subplots_adjust(wspace = 0.35) 206 217 rcParams['font.size'] = int( rcParams['font.size'] * 3. / 4. ) -
trunk/UTIL/PYTHON/myscript.py
r479 r483 7 7 parser.add_option('-d', '--display',action='store_false',dest='display', default=True, help='do not pop up created images') 8 8 parser.add_option('-O','--output', action='store',dest='out', type="string", default=None, help='output file name') 9 parser.add_option('--rate', action='store' ,dest='rate', type="int", default=None, help='output is a movie along Time dimension [None]') 10 parser.add_option('--quality', action='store_true',dest='quality', default=False,help='For movie mode: improves movie quality.(slower)') 9 11 10 12 ### WHAT I PLOT … … 16 18 parser.add_option('-M', '--max', action='append',dest='vmax', type="float", default=None, help='bounding maximum value [max]') 17 19 parser.add_option('-H', '--hole', action='store_true',dest='hole', default=False, help='holes above max and below min') 18 parser.add_option('--nolow', action='store_true',dest='nolow', default=False, help='plot only minima and maxima [false]') 20 parser.add_option('--nolow', action='store_true',dest='nolow', default=False, help='do not plot low |values| [False]') 21 parser.add_option('--redope', action='store',dest='redope', type="string", default=None, help='REDuce OPErators: mint,maxt for the moment [None]') 19 22 20 23 ### VERTICAL INTERPOLATION … … 65 68 ### SPECIAL 66 69 parser.add_option('--tsat', action='store_true',dest='tsat', default=False,help='convert temperature field T in Tsat-T using pressure') 67 parser.add_option('--rate', action='store' ,dest='rate', type="int", default=None, help='output is a movie along Time dimension [None]')68 parser.add_option('--quality', action='store_true',dest='quality', default=False,help='For movie mode: improves movie quality.(slower)')69 70 70 71 return parser -
trunk/UTIL/PYTHON/planetoplot.py
r477 r483 58 58 trans=1,\ 59 59 zarea=None,\ 60 axtime=None): 60 axtime=None,\ 61 redope=None): 61 62 62 63 … … 181 182 if "Times" in nc.variables: time = count + np.arange(0,len(nc.variables["Times"]),1) 182 183 elif "Time" in nc.variables: time = count + np.arange(0,len(nc.variables["Time"]),1) 184 else: time = count + np.arange(0,1,1) 183 185 count = time[-1] + 1 ## so that a cat is possible with simple subscripts 184 186 ### … … 303 305 if varname: ### what is shaded. 304 306 what_I_plot, error = reducefield( all_var[index_f], d4=indextime, d1=indexlon, d2=indexlat, d3=indexvert, \ 305 yint=yintegral, alt=vert, anomaly=anomaly )307 yint=yintegral, alt=vert, anomaly=anomaly, redope=redope ) 306 308 what_I_plot = what_I_plot*mult 307 309 if var2: ### what is contoured. … … 473 475 474 476 ### Next subplot 475 basename = getname(var=varname,var2=var2,winds=winds,anomaly=anomaly) 477 zevarname = varname 478 if redope is not None: zevarname = zevarname + "_" + redope 479 basename = getname(var=zevarname,var2=var2,winds=winds,anomaly=anomaly) 476 480 if len(what_I_plot.shape) > 3: 477 481 basename = basename + getstralt(nc,level) -
trunk/UTIL/PYTHON/pp.py
r479 r483 152 152 invert_y=opt.inverty,xaxis=zexaxis,yaxis=zeyaxis,ylog=opt.logy,yintegral=opt.column,\ 153 153 blat=opt.blat,blon=opt.blon,tsat=opt.tsat,flagnolow=opt.nolow,\ 154 mrate=opt.rate,mquality=opt.quality,trans=opt.trans,zarea=opt.area,axtime=opt.axtime) 154 mrate=opt.rate,mquality=opt.quality,trans=opt.trans,zarea=opt.area,axtime=opt.axtime,\ 155 redope=opt.redope) 155 156 print 'DONE: '+name 156 157 system("rm -f to_be_erased")
Note: See TracChangeset
for help on using the changeset viewer.