Changeset 2427 for TOOLS/ConsoGENCMIP6/bin/plot_store.py
- Timestamp:
- 03/02/15 17:43:15 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TOOLS/ConsoGENCMIP6/bin/plot_store.py
r2425 r2427 40 40 #--------------------------------------- 41 41 def fill_data(self, filein): 42 data = np.genfromtxt( 43 filein, 44 skip_header=1, 45 converters={0: string_to_date, 46 1: str, 47 2: string_to_size_unit, 48 3: str}, 49 missing_values="nan", 50 ) 42 """ 43 """ 44 try: 45 data = np.genfromtxt( 46 filein, 47 skip_header=1, 48 converters={0: string_to_date, 49 1: str, 50 2: string_to_size_unit, 51 3: str}, 52 missing_values="nan", 53 ) 54 except: 55 print("Empty file {}".format(filein)) 56 exit(1) 51 57 52 58 for date, login, dirsize, dirname in data: … … 161 167 plt.figtext(x=0.95, y=0.93, s=tot_label, backgroundcolor="linen", 162 168 ha="right", va="bottom", fontsize="small") 163 164 165 ########################################166 def plot_save(img_name):167 """168 """169 dpi = 200.170 171 with PdfPages(img_name) as pdf:172 pdf.savefig(dpi=dpi)173 174 # pdf file's metadata175 d = pdf.infodict()176 d["Title"] = "Occupation GENCMIP6 sur STORE par login"177 d["Author"] = "plot_bilan.py"178 # d["Subject"] = "Time spent over specific commands during create_ts \179 # jobs at IDRIS and four configurations at TGCC"180 # d["Keywords"] = "bench create_ts TGCC IDRIS ncrcat"181 # d["CreationDate"] = dt.datetime(2009, 11, 13)182 # d["ModDate"] = dt.datetime.today()183 169 184 170 … … 220 206 221 207 import matplotlib.pyplot as plt 222 from matplotlib.backends.backend_pdf import PdfPages208 # from matplotlib.backends.backend_pdf import PdfPages 223 209 224 210 if not args.show: … … 227 213 # ... Files and directories ... 228 214 # ----------------------------- 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"]) 232 img_name = "bilan.pdf" 215 (file_param, file_utheo, file_data) = \ 216 get_input_files(DIR["SAVEDATA"], 217 [OUT["PARAM"], OUT["UTHEO"], OUT["STORE"]]) 218 219 img_name = "store" 220 today = os.path.basename(file_param).strip(OUT["PARAM"]) 233 221 234 222 if args.verbose: 235 223 print(file_param) 236 224 print(file_utheo) 237 print(file_ store)225 print(file_data) 238 226 print(img_name) 227 print(today) 239 228 240 229 # .. Get project info .. … … 247 236 # ======================= 248 237 stores = StoreDict() 249 stores.fill_data(file_ store)238 stores.fill_data(file_data) 250 239 251 240 # .. Extract data depending on C.L. arguments .. … … 301 290 # ... Save figure ... 302 291 # ------------------- 303 plot_save( os.path.join(DIR["PLOT"], img_name))292 plot_save(img_name, today, "Occupation GENCMIP6 sur STORE par login") 304 293 305 294 # ... Publish figure on dods ... … … 311 300 plt.show() 312 301 313 exit( )302 exit(0)
Note: See TracChangeset
for help on using the changeset viewer.