Changeset 2490 in lmdz_wrf
- Timestamp:
- May 1, 2019, 4:28:49 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/generic.py
r2489 r2490 23 23 # ASCIIfile_stats: Function to provide the statistics of a series of values from an ASCII file 24 24 # coincident_CFtimes: Function to make coincident times for two different sets of CFtimes 25 # coldec_hex: Function to pas a decimal ([r,g,b]; [0.,1.]) color to hexadecimal (#[RR][GG][BB], 00-64, 0A-FF) 25 26 # count_cond: Function to count values of a variable which attain a condition 26 27 # create_LateX_figs: Function to create a LaTeX from a folder with multiple plots from different values … … 54 55 55 56 # List of available operations 56 operations=['ASCIIfile_stats', 'coincident_CFtimes', 'co unt_cond',\57 operations=['ASCIIfile_stats', 'coincident_CFtimes', 'coldec_hex', 'count_cond', \ 57 58 'create_LateX_figs', 'datetimeStr_conversion', 'get_right_CFtimeunits', \ 58 59 'grid_combinations', 'inf_operSlist', \ … … 93 94 ## 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 95 ## e.g. # generic.py -o get_right_CFtimeunits -S 'minutes!since!1-1-1' 96 ## e.g. # generic.py -o coldec_hex -S 0.545,0.352,0. 95 97 96 98 operationnames = "'" + gen.numVector_String(operations, "', '") + "'" … … 153 155 print gen.coincident_CFtimes(vals0, vals[1], vals[2]) 154 156 157 elif oper == 'coldec_hex': 158 Nvals = 3 159 vals = opts.values.split(cS) 160 if vals[0] == 'h': 161 print gen.coldec_hex.__doc__ 162 quit(-1) 163 else: 164 if len(vals) != Nvals: 165 print errormsg 166 print ' ' + main + ": operation '" + oper + "' requires", Nvals, 'and', \ 167 len(vals), ' has passed!!' 168 print gen.coldec_hex.__doc__ 169 quit(-1) 170 valsF = np.array(vals, dtype=np.float) 171 print gen.coldec_hex(valsF) 172 155 173 elif oper == 'count_cond': 156 174 Nvals = 3 … … 169 187 print gen.count_cond(np.array(vals[0].split(cV), dtype=np.float), \ 170 188 np.float(vals[1]), vals[2]) 171 172 189 173 190 elif oper == 'create_LateX_figs':
Note: See TracChangeset
for help on using the changeset viewer.