Changeset 2203 in lmdz_wrf
- Timestamp:
- Oct 19, 2018, 6:35:46 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/generic.py
r2092 r2203 26 26 # create_LateX_figs: Function to create a LaTeX from a folder with multiple plots from different values 27 27 # datetimeStr_conversion: Function to transform a string date to an another date object 28 # get_right_CFtimeunits: Function to get the right CFtime units from any given format 28 29 # grid_combinations: Function to provide all the possible grid points combination for a given pair of values 29 30 # x,y= pair of grid points … … 54 55 # List of available operations 55 56 operations=['ASCIIfile_stats', 'coincident_CFtimes', 'count_cond', \ 56 'create_LateX_figs', 'datetimeStr_conversion', 57 'create_LateX_figs', 'datetimeStr_conversion', 'get_right_CFtimeunits', \ 57 58 'grid_combinations', 'inf_operSlist', \ 58 59 'interpolate_locs', 'latex_fig_array', 'list_operations', 'PolyArea', \ … … 91 92 ## e.g. # generic.py -o inf_operSlist -S '-98.21:1.2:3.45:100.1:34321.1,threshold,:,3.' 92 93 ## e.g. # generic.py -o create_LateX_figs -S '/home/lluis/estudios/FPS_ALPS/additional/IOP/analysis/figs,WindRose_obs_@SkewT-logP_obs_ta-tda@SkewT-logP_obs_evol@WindRose_obs-sim_step@SkewT-logP_obs-sim_step@SkewT-logP_obs-sim_evol,10868@16080@16144@16546,png' 94 ## e.g. # generic.py -o get_right_CFtimeunits -S 'minutes!since!1-1-1' 93 95 94 96 operationnames = "'" + gen.numVector_String(operations, "', '") + "'" … … 115 117 print opern + '_______ ______ _____ ____ ___ __ _' 116 118 print getattr(object, opern).__doc__ 119 120 elif oper == 'ASCIIfile_stats': 121 Nvals = 3 122 vals = opts.values.split(cS) 123 if vals[0] == 'h': 124 print gen.ASCIIfile_stats.__doc__ 125 quit(-1) 126 else: 127 if len(vals) != Nvals: 128 print errormsg 129 print ' ' + main + ": operation '" + oper + "' requires", Nvals, 'and', \ 130 len(vals), ' has passed!!' 131 print gen.ASCIIfile_stats.__doc__ 132 quit(-1) 133 vals0 = vals[0] 134 vals1 = vals[1] 135 vals2 = vals[2] 136 137 print gen.ASCIIfile_stats(vals0, vals1, vals2) 117 138 118 139 elif oper == 'coincident_CFtimes': … … 198 219 #'days_period' 199 220 221 elif oper == 'get_right_CFtimeunits': 222 Nvals = 1 223 vals = opts.values.split(cS) 224 if vals[0] == 'h': 225 print gen.get_right_CFtimeunits.__doc__ 226 quit(-1) 227 else: 228 if len(vals) != Nvals: 229 print errormsg 230 print ' ' + main + ": operation '" + oper + "' requires", Nvals, 'and', \ 231 len(vals), ' has passed!!' 232 print gen.get_right_CFtimeunits.__doc__ 233 quit(-1) 234 print gen.get_right_CFtimeunits(vals[0].replace('!', ' ')) 235 200 236 elif oper == 'grid_combinations': 201 237 Nvals = 2 … … 471 507 print gen.WRFsetup(vals0, vals1, vals2) 472 508 473 elif oper == 'ASCIIfile_stats':474 Nvals = 3475 vals = opts.values.split(cS)476 if vals[0] == 'h':477 print gen.ASCIIfile_stats.__doc__478 quit(-1)479 else:480 if len(vals) != Nvals:481 print errormsg482 print ' ' + main + ": operation '" + oper + "' requires", Nvals, 'and', \483 len(vals), ' has passed!!'484 print gen.ASCIIfile_stats.__doc__485 quit(-1)486 vals0 = vals[0]487 vals1 = vals[1]488 vals2 = vals[2]489 490 print gen.ASCIIfile_stats(vals0, vals1, vals2)491
Note: See TracChangeset
for help on using the changeset viewer.