Changeset 2460 for TOOLS/ConsoGENCMIP6/bin/plot_bilan.py
- Timestamp:
- 04/02/15 12:12:26 (9 years ago)
- Location:
- TOOLS/ConsoGENCMIP6/bin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TOOLS/ConsoGENCMIP6/bin
- Property svn:ignore
-
old new 1 gencmip6_path.py 1 *.pyc
-
- Property svn:ignore
-
TOOLS/ConsoGENCMIP6/bin/plot_bilan.py
r2448 r2460 13 13 14 14 # Application library imports 15 from gencmip6 import * 16 from gencmip6_path import * 15 from libconso import * 17 16 18 17 … … 204 203 line_width = 0.1 205 204 206 ax_conso.bar(xcoord, consos, width=1, align="center", color="linen", 207 linewidth=line_width, label="conso (heures)") 208 209 ax_theo.plot(xcoord, theo_equs, "--", 210 color="firebrick", linewidth=0.5, 211 solid_capstyle="round", solid_joinstyle="round") 212 ax_theo.plot(xcoord, theo_uses, line_style, color="firebrick", 213 linewidth=1, markersize=8, 214 solid_capstyle="round", solid_joinstyle="round", 215 label="conso\nthéorique (%)") 216 ax_theo.plot(xcoord, real_uses, line_style, color="forestgreen", 217 linewidth=1, markersize=8, 218 solid_capstyle="round", solid_joinstyle="round", 219 label="conso\nréelle (%)") 220 221 222 ######################################## 223 def plot_config(fig, ax_conso, ax_theo, xcoord, dates, title, conso_per_day): 205 ax_conso.bar( 206 xcoord, consos, width=1, align="center", color="linen", 207 linewidth=line_width, label="conso (heures)" 208 ) 209 210 ax_theo.plot( 211 xcoord, theo_equs, "--", 212 color="firebrick", linewidth=0.5, 213 solid_capstyle="round", solid_joinstyle="round" 214 ) 215 ax_theo.plot( 216 xcoord, theo_uses, line_style, color="firebrick", 217 linewidth=1, markersize=8, 218 solid_capstyle="round", solid_joinstyle="round", 219 label="conso\nthéorique (%)" 220 ) 221 ax_theo.plot( 222 xcoord, real_uses, line_style, color="forestgreen", 223 linewidth=1, markersize=8, 224 solid_capstyle="round", solid_joinstyle="round", 225 label="conso\nréelle (%)" 226 ) 227 228 229 ######################################## 230 def plot_config(fig, ax_conso, ax_theo, xcoord, dates, title, 231 conso_per_day): 224 232 """ 225 233 """ … … 273 281 ax_conso.set_xticks(xcoord, minor=True) 274 282 ax_conso.set_xticks(maj_xticks, minor=False) 275 ax_conso.set_xticklabels(maj_xlabs, rotation="vertical", size="x-small") 283 ax_conso.set_xticklabels( 284 maj_xlabs, rotation="vertical", size="x-small" 285 ) 276 286 277 287 yticks = list(ax_conso.get_yticks()) … … 365 375 # ... Files and directories ... 366 376 # ----------------------------- 377 project_name, DIR, OUT = parse_config("bin/config.ini") 378 367 379 (file_param, file_utheo, file_data) = \ 368 380 get_input_files(DIR["SAVEDATA"], … … 381 393 # .. Get project info .. 382 394 # ====================== 383 gencmip6= Project()384 gencmip6.fill_data(file_param)385 gencmip6.get_date_init(file_utheo)395 projet = Project() 396 projet.fill_data(file_param) 397 projet.get_date_init(file_utheo) 386 398 387 399 # .. Fill in data .. … … 390 402 # ---------------------- 391 403 bilan = DataDict() 392 bilan.init_range( gencmip6.date_init, gencmip6.deadline)404 bilan.init_range(projet.date_init, projet.deadline) 393 405 # ... Extract data from file ... 394 406 # ------------------------------ … … 423 435 consos = np.array(consos, dtype=float) 424 436 425 conso_per_day = gencmip6.alloc / gencmip6.days437 conso_per_day = projet.alloc / projet.days 426 438 427 439 theo_uses = np.array([100.*item.theo_use for item in selected_items], … … 456 468 # -------------------- 457 469 title = "Consommation {}\n({:%d/%m/%Y} - {:%d/%m/%Y})".format( 458 gencmip6.project.upper(), 459 gencmip6.date_init, 460 gencmip6.deadline 461 ) 462 463 plot_config(fig, ax_conso, ax_theo, xcoord, dates, title, conso_per_day) 470 projet.project.upper(), 471 projet.date_init, 472 projet.deadline 473 ) 474 475 plot_config( 476 fig, ax_conso, ax_theo, xcoord, dates, title, conso_per_day 477 ) 464 478 465 479 # ... Save figure ... … … 469 483 "{}_{}.pdf".format(img_name, today)) 470 484 471 plot_save(img_in, img_out, title )485 plot_save(img_in, img_out, title, DIR) 472 486 473 487 # ... Publish figure on dods ... 474 488 # ------------------------------ 475 489 if args.dods: 476 dods_cp(img_in )490 dods_cp(img_in, DIR) 477 491 478 492 if args.show:
Note: See TracChangeset
for help on using the changeset viewer.