Changeset 464
- Timestamp:
- Dec 9, 2011, 4:22:21 PM (13 years ago)
- Location:
- trunk/UTIL/PYTHON
- Files:
-
- 1 added
- 1 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UTIL/PYTHON/mcs.py
r427 r464 22 22 from myplot import getfield,separatenames 23 23 from make_netcdf import make_gcm_netcdf 24 from zrecast_wrapper import call_zrecast24 from gcm_transformations import call_zrecast,call_hrecast 25 25 parser = OptionParser() 26 26 … … 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 parser.add_option('--latreverse', action='store_true', dest='latreverse', default=False, help='Reverse the latitude axis in output diagfi. [False]') 37 36 38 ############################# 37 39 ### Get options and variables … … 86 88 print "Error: could not find controle variable in diagfi." 87 89 day_ini=input("Please type initial sol number:")%669 90 else: 91 print "Error: could not find controle variable in diagfi." 92 day_ini=input("Please type initial sol number:")%669 88 93 time[:]=time[:]+day_ini 89 94 nx=len(lon) … … 281 286 varnightout.set_fill_value([np.NaN]) 282 287 288 if opt.latreverse: 289 vardayout[:,:,:,:,:]=vardayout[:,:,:,::-1,:] 290 varnightout[:,:,:,:,:]=varnightout[:,:,:,::-1,:] 291 283 292 all=[aps,bps] 284 293 for vv in np.arange(nzvar): … … 293 302 all=all[2:] 294 303 fullnames=fullnames[2:] 304 305 if opt.latreverse: 306 lat=lat[::-1] 295 307 296 308 make_gcm_netcdf (zfilename="diagfi_MCS.nc", \ -
trunk/UTIL/PYTHON/myplot.py
r457 r464 65 65 out.set_fill_value([np.NaN]) 66 66 else: 67 out=field 67 # missing values from zrecast or hrecast are -1e-33 68 masked=np.ma.masked_where(field < -1e-30,field) 69 masked.set_fill_value([np.NaN]) 70 mask = np.ma.getmask(masked) 71 if (True in mask):out=masked 72 else:out=field 68 73 return out 69 74 -
trunk/UTIL/PYTHON/planetoplot.py
r462 r464 163 163 vertdim='BOTTOM-TOP_PATCH_END_UNSTAG' 164 164 dumped_vert_stag=True 165 else: dumped_vert_stag=False 165 166 if varname in ['V']: latdim='SOUTH-NORTH_PATCH_END_STAG' 166 167 else: latdim='SOUTH-NORTH_PATCH_END_UNSTAG' … … 246 247 numplot = numplot + 1 ; all_time[k] = all_time[k-1] ; all_namefile[k] = all_namefile[k-1] 247 248 all_varname[k] = all_varname[k-2] + insert + all_varname[k-1] 248 249 249 ################################## 250 250 ### Open a figure and set subplots … … 354 354 x, y = m(lon2d, lat2d) ## this is dirty, defined above but out of imov loop 355 355 if typefile in ['mesoapi','meso'] and mapmode == 1: what_I_plot_frame = dumpbdy(what_I_plot_frame,6,condition=True) 356 356 # if typefile in ['mesoideal']: what_I_plot_frame = dumpbdy(what_I_plot_frame,0,stag='W',condition=dumped_vert_stag) 357 357 358 358 if imov >= 0: -
trunk/UTIL/PYTHON/pp.py
r457 r464 10 10 from optparse import OptionParser ### to be replaced by argparse 11 11 from api_wrapper import api_onelevel 12 from zrecast_wrapperimport call_zrecast12 from gcm_transformations import call_zrecast 13 13 from netCDF4 import Dataset 14 14 from myplot import getlschar, separatenames, readslices, adjust_length, whatkindfile, errormess … … 111 111 input_name=zefiles,\ 112 112 fields=zevars,\ 113 pred ifined=opt.intas)113 predefined=opt.intas) 114 114 115 115 zefiles=interpolated_files … … 119 119 input_name=[opt.fref],\ 120 120 fields=zevars,\ 121 pred ifined=opt.intas)121 predefined=opt.intas) 122 122 123 123 reffile=interpolated_ref[0]
Note: See TracChangeset
for help on using the changeset viewer.