Ignore:
Timestamp:
03/02/15 15:50:26 (9 years ago)
Author:
labetoulle
Message:

Save daily plots on WORK

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TOOLS/ConsoGENCMIP6/bin/plot_bilan.py

    r2421 r2425  
    274274  # .. Initialization .. 
    275275  # ==================== 
    276  
    277276  # ... Command line arguments ... 
    278277  # ------------------------------ 
    279278  args = get_arguments() 
     279  if args.verbose: 
     280    print(args) 
    280281 
    281282  # ... Turn interactive mode off ... 
     
    293294  # ... Files and directories ... 
    294295  # ----------------------------- 
    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"]) 
    299302 
    300303  if args.verbose: 
     
    303306    print(file_bilan) 
    304307    print(img_name) 
     308    print(today) 
     309    print(DIR) 
     310    print(OUT) 
    305311 
    306312  # .. Get project info .. 
     
    386392  # ... Save figure ... 
    387393  # ------------------- 
    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) 
    389401 
    390402  # ... Publish figure on dods ... 
    391403  # ------------------------------ 
    392404  if args.dods: 
    393     dods_cp(os.path.join(DIR["PLOT"], img_name)) 
     405    dods_cp(img_in) 
    394406 
    395407  if args.show: 
    396408    plt.show() 
     409 
     410  exit() 
Note: See TracChangeset for help on using the changeset viewer.