Changeset 2421 for TOOLS/ConsoGENCMIP6/bin/plot_bilan.py
- Timestamp:
- 03/02/15 14:19:08 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TOOLS/ConsoGENCMIP6/bin/plot_bilan.py
r2420 r2421 11 11 import datetime as dt 12 12 import numpy as np 13 import matplotlib.pyplot as plt14 from matplotlib.backends.backend_pdf import PdfPages15 13 16 14 # Application library imports … … 252 250 parser = ArgumentParser() 253 251 parser.add_argument("-v", "--verbose", action="store_true", 254 help=" Verbose mode")252 help="verbose mode") 255 253 parser.add_argument("-f", "--full", action="store_true", 256 254 help="plot the whole period") … … 263 261 parser.add_argument("-m", "--max", action="store_true", 264 262 help="plot with y_max = allocation") 263 parser.add_argument("-s", "--show", action="store_true", 264 help="interactive mode") 265 parser.add_argument("-d", "--dods", action="store_true", 266 help="copy output on dods") 265 267 266 268 return parser.parse_args() … … 272 274 # .. Initialization .. 273 275 # ==================== 276 274 277 # ... Command line arguments ... 275 278 # ------------------------------ 276 279 args = get_arguments() 277 280 281 # ... Turn interactive mode off ... 282 # --------------------------------- 283 if not args.show: 284 import matplotlib 285 matplotlib.use('Agg') 286 287 import matplotlib.pyplot as plt 288 from matplotlib.backends.backend_pdf import PdfPages 289 290 if not args.show: 291 plt.ioff() 292 278 293 # ... Files and directories ... 279 294 # ----------------------------- 280 file_param = get_last_file(DIR[" DATA"], OUT["PARAM"])281 file_utheo = get_last_file(DIR[" DATA"], OUT["UTHEO"])282 file_bilan = get_last_file(DIR[" DATA"], OUT["BILAN"])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"]) 283 298 img_name = "bilan.pdf" 284 299 … … 373 388 plot_save(os.path.join(DIR["PLOT"], img_name)) 374 389 375 plt.show() 390 # ... Publish figure on dods ... 391 # ------------------------------ 392 if args.dods: 393 dods_cp(os.path.join(DIR["PLOT"], img_name)) 394 395 if args.show: 396 plt.show()
Note: See TracChangeset
for help on using the changeset viewer.