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_store.py

    r2417 r2425  
    1010import os.path 
    1111import numpy as np 
    12 import matplotlib.pyplot as plt 
    13 from matplotlib.backends.backend_pdf import PdfPages 
     12# import matplotlib.pyplot as plt 
     13# from matplotlib.backends.backend_pdf import PdfPages 
    1414 
    1515# Application library imports 
     
    194194                      default="IPSLCM6", 
    195195                      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") 
    196200 
    197201  return parser.parse_args() 
     
    209213    print(args) 
    210214 
     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 
    211227  # ... Files and directories ... 
    212228  # ----------------------------- 
    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"]) 
    216232  img_name = "bilan.pdf" 
    217233 
     
    287303  plot_save(os.path.join(DIR["PLOT"], img_name)) 
    288304 
    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 
    290313  exit() 
Note: See TracChangeset for help on using the changeset viewer.