- Timestamp:
- 03/02/15 15:50:26 (10 years ago)
- Location:
- TOOLS/ConsoGENCMIP6/bin
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
TOOLS/ConsoGENCMIP6/bin/conso_gencmip6.py
r2424 r2425 292 292 filein = os.path.join(DIR["DATA"], filename) 293 293 if os.path.isfile(filein): 294 fileout = os.path.join(DIR["SAVE "],294 fileout = os.path.join(DIR["SAVEDATA"], 295 295 "_".join((filename, suffix))) 296 296 shutil.copy(filein, fileout) … … 327 327 if args.verbose: 328 328 print(DIR["DATA"]) 329 print(DIR["SAVE "])329 print(DIR["SAVEDATA"]) 330 330 331 331 (project, logins, today, total, utheo, ureal) = \ … … 387 387 if args.verbose: 388 388 print("=> Save files") 389 390 389 if not args.dryrun: 391 390 save_files(OUT, today) -
TOOLS/ConsoGENCMIP6/bin/gencmip6_path.py.init
r2421 r2425 7 7 # standard library imports 8 8 import os 9 #import os.path9 import os.path 10 10 11 11 # Application library imports … … 16 16 17 17 # Common paths 18 # ============ 18 19 DIR = { 19 20 "ROOT": ROOT_DIR, … … 23 24 "DODS": None, 24 25 } 26 DIR["SAVEDATA"] = os.path.join(DIR["SAVE"], "data") 27 DIR["SAVEPLOT"] = os.path.join(DIR["SAVE"], "plot") 28 29 for dirname in DIR.itervalues(): 30 if dirname and not os.path.isdir(dirname): 31 try : 32 os.makedirs(dirname) 33 except Exception as rc : 34 print("Could not create {}:\n{}".format(dirname, rc)) 25 35 26 36 # Common files 37 # ============ 27 38 OUT = { 28 39 "PARAM": "OUT_CONSO_PARAM", -
TOOLS/ConsoGENCMIP6/bin/plot_bilan.py
r2421 r2425 274 274 # .. Initialization .. 275 275 # ==================== 276 277 276 # ... Command line arguments ... 278 277 # ------------------------------ 279 278 args = get_arguments() 279 if args.verbose: 280 print(args) 280 281 281 282 # ... Turn interactive mode off ... … … 293 294 # ... Files and directories ... 294 295 # ----------------------------- 295 file_param = get_last_file(DIR["SAVE"], OUT["PARAM"]) 296 file_utheo = get_last_file(DIR["SAVE"], OUT["UTHEO"]) 297 file_bilan = get_last_file(DIR["SAVE"], OUT["BILAN"]) 298 img_name = "bilan.pdf" 296 file_param = get_last_file(DIR["SAVEDATA"], OUT["PARAM"]) 297 file_utheo = get_last_file(DIR["SAVEDATA"], OUT["UTHEO"]) 298 file_bilan = get_last_file(DIR["SAVEDATA"], OUT["BILAN"]) 299 img_name = "bilan" 300 301 today = os.path.basename(file_param).strip(OUT["PARAM"]) 299 302 300 303 if args.verbose: … … 303 306 print(file_bilan) 304 307 print(img_name) 308 print(today) 309 print(DIR) 310 print(OUT) 305 311 306 312 # .. Get project info .. … … 386 392 # ... Save figure ... 387 393 # ------------------- 388 plot_save(os.path.join(DIR["PLOT"], img_name)) 394 # plot_save(os.path.join(DIR["PLOT"], img_name)) 395 img_in = os.path.join(DIR["PLOT"], "{}.pdf".format(img_name)) 396 plot_save(img_in) 397 if os.path.isdir(DIR["SAVEPLOT"]): 398 img_out = os.path.join(DIR["SAVEPLOT"], 399 "{}_{}.pdf".format(img_name, today)) 400 shutil.copy(img_in, img_out) 389 401 390 402 # ... Publish figure on dods ... 391 403 # ------------------------------ 392 404 if args.dods: 393 dods_cp( os.path.join(DIR["PLOT"], img_name))405 dods_cp(img_in) 394 406 395 407 if args.show: 396 408 plt.show() 409 410 exit() -
TOOLS/ConsoGENCMIP6/bin/plot_login.py
r2417 r2425 10 10 import os.path 11 11 import numpy as np 12 import matplotlib.pyplot as plt13 from matplotlib.backends.backend_pdf import PdfPages12 # import matplotlib.pyplot as plt 13 # from matplotlib.backends.backend_pdf import PdfPages 14 14 15 15 # Application library imports … … 147 147 help="plot all the logins" + 148 148 " (default: plot only non-zero)") 149 parser.add_argument("-s", "--show", action="store_true", 150 help="interactive mode") 151 parser.add_argument("-d", "--dods", action="store_true", 152 help="copy output on dods") 149 153 150 154 return parser.parse_args() … … 159 163 # ------------------------------ 160 164 args = get_arguments() 165 if args.verbose: 166 print(args) 167 168 # ... Turn interactive mode off ... 169 # --------------------------------- 170 if not args.show: 171 import matplotlib 172 matplotlib.use('Agg') 173 174 import matplotlib.pyplot as plt 175 from matplotlib.backends.backend_pdf import PdfPages 176 177 if not args.show: 178 plt.ioff() 161 179 162 180 # ... Files and directories ... 163 181 # ----------------------------- 164 file_param = get_last_file(DIR[" DATA"], OUT["PARAM"])165 file_utheo = get_last_file(DIR[" DATA"], OUT["UTHEO"])166 file_login = get_last_file(DIR[" DATA"], OUT["LOGIN"])182 file_param = get_last_file(DIR["SAVE"], OUT["PARAM"]) 183 file_utheo = get_last_file(DIR["SAVE"], OUT["UTHEO"]) 184 file_login = get_last_file(DIR["SAVE"], OUT["LOGIN"]) 167 185 img_name = "bilan.pdf" 168 186 … … 229 247 plot_save(os.path.join(DIR["PLOT"], img_name)) 230 248 231 plt.show() 249 # ... Publish figure on dods ... 250 # ------------------------------ 251 if args.dods: 252 dods_cp(os.path.join(DIR["PLOT"], img_name)) 253 254 if args.show: 255 plt.show() 256 232 257 exit() -
TOOLS/ConsoGENCMIP6/bin/plot_store.py
r2417 r2425 10 10 import os.path 11 11 import numpy as np 12 import matplotlib.pyplot as plt13 from matplotlib.backends.backend_pdf import PdfPages12 # import matplotlib.pyplot as plt 13 # from matplotlib.backends.backend_pdf import PdfPages 14 14 15 15 # Application library imports … … 194 194 default="IPSLCM6", 195 195 help="plot the whole period") 196 parser.add_argument("-s", "--show", action="store_true", 197 help="interactive mode") 198 parser.add_argument("-d", "--dods", action="store_true", 199 help="copy output on dods") 196 200 197 201 return parser.parse_args() … … 209 213 print(args) 210 214 215 # ... Turn interactive mode off ... 216 # --------------------------------- 217 if not args.show: 218 import matplotlib 219 matplotlib.use('Agg') 220 221 import matplotlib.pyplot as plt 222 from matplotlib.backends.backend_pdf import PdfPages 223 224 if not args.show: 225 plt.ioff() 226 211 227 # ... Files and directories ... 212 228 # ----------------------------- 213 file_param = get_last_file(DIR[" DATA"], OUT["PARAM"])214 file_utheo = get_last_file(DIR[" DATA"], OUT["UTHEO"])215 file_store = get_last_file(DIR[" DATA"], OUT["STORE"])229 file_param = get_last_file(DIR["SAVE"], OUT["PARAM"]) 230 file_utheo = get_last_file(DIR["SAVE"], OUT["UTHEO"]) 231 file_store = get_last_file(DIR["SAVE"], OUT["STORE"]) 216 232 img_name = "bilan.pdf" 217 233 … … 287 303 plot_save(os.path.join(DIR["PLOT"], img_name)) 288 304 289 plt.show() 305 # ... Publish figure on dods ... 306 # ------------------------------ 307 if args.dods: 308 dods_cp(os.path.join(DIR["PLOT"], img_name)) 309 310 if args.show: 311 plt.show() 312 290 313 exit()
Note: See TracChangeset
for help on using the changeset viewer.