Changeset 2631
- Timestamp:
- 08/26/15 11:52:12 (9 years ago)
- Location:
- TOOLS/ConsoGENCMIP6/bin
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TOOLS/ConsoGENCMIP6/bin/plot_bilan.py
r2526 r2631 237 237 ######################################## 238 238 def plot_config(fig, ax_conso, ax_theo, xcoord, dates, title, 239 conso_per_day ):239 conso_per_day, conso_per_day_2): 240 240 """ 241 241 """ … … 247 247 ymax = conso_max # + conso_max*.1 248 248 else: 249 ymax = 2. * conso_per_day249 ymax = 3. * max(conso_per_day, conso_per_day_2) 250 250 251 251 if conso_max > ymax: … … 295 295 yticks = list(ax_conso.get_yticks()) 296 296 yticks.append(conso_per_day) 297 if conso_per_day_2: 298 yticks.append(conso_per_day_2) 297 299 ax_conso.set_yticks(yticks) 298 300 … … 303 305 ax_conso.axhline(y=conso_per_day, color="blue", alpha=0.5, 304 306 label="conso journaliÚre\nidéale (heures)") 307 308 if conso_per_day_2: 309 ax_conso.axhline(y=conso_per_day_2, color="blue", alpha=0.5) 305 310 306 311 for x, d in zip(xcoord, dates): … … 446 451 consos = np.array(consos, dtype=float) 447 452 448 conso_per_day = projet.alloc / projet.days 453 if projet.project == "gencmip6": 454 alloc1 = 5.e6 455 alloc2 = projet.alloc - alloc1 456 conso_per_day = 2 * alloc1 / projet.days 457 conso_per_day_2 = 2 * alloc2 / projet.days 458 else: 459 conso_per_day = projet.alloc / projet.days 460 conso_per_day_2 = None 449 461 450 462 theo_uses = np.array( … … 497 509 498 510 plot_config( 499 fig, ax_conso, ax_theo, xcoord, dates, title, conso_per_day 511 fig, ax_conso, ax_theo, xcoord, dates, title, 512 conso_per_day, conso_per_day_2 500 513 ) 501 514 -
TOOLS/ConsoGENCMIP6/bin/plot_bilan_jobs.py
r2526 r2631 259 259 ######################################## 260 260 def plot_config(fig, ax_conso, ax_theo, xcoord, dates, title, 261 conso_per_day ):261 conso_per_day, conso_per_day_2): 262 262 """ 263 263 """ … … 269 269 ymax = conso_max # + conso_max*.1 270 270 else: 271 ymax = 2. * conso_per_day271 ymax = 3. * max(conso_per_day, conso_per_day_2) 272 272 273 273 if conso_max > ymax: … … 318 318 for ax, y, label in ( 319 319 (ax_conso, conso_per_day, "heures"), 320 (ax_jobs, conso_per_day / 24 , "cÅurs"),320 (ax_jobs, conso_per_day / 24., "cÅurs"), 321 321 ): 322 322 yticks = list(ax.get_yticks()) … … 325 325 ax.axhline(y=y, color="blue", alpha=0.5, 326 326 label="conso journaliÚre\nidéale ({})".format(label)) 327 328 if conso_per_day_2: 329 yticks.append(conso_per_day_2) 330 ax_conso.axhline(y=conso_per_day_2, color="blue", alpha=0.5) 331 ax_jobs.axhline(y=conso_per_day_2 / 24., color="blue", alpha=0.5) 327 332 328 333 ax_theo.spines["right"].set_color("firebrick") … … 477 482 consos = np.array(consos, dtype=float) 478 483 479 conso_per_day = projet.alloc / projet.days 484 if projet.project == "gencmip6": 485 alloc1 = 5.e6 486 alloc2 = projet.alloc - alloc1 487 conso_per_day = 2 * alloc1 / projet.days 488 conso_per_day_2 = 2 * alloc2 / projet.days 489 else: 490 conso_per_day = projet.alloc / projet.days 491 conso_per_day_2 = None 480 492 481 493 theo_uses = np.array( … … 529 541 530 542 plot_config( 531 fig, ax_conso, ax_theo, xcoord, dates, title, conso_per_day 543 fig, ax_conso, ax_theo, xcoord, dates, title, 544 conso_per_day, conso_per_day_2 532 545 ) 533 546 -
TOOLS/ConsoGENCMIP6/bin/plot_jobs.py
r2517 r2631 211 211 212 212 ######################################## 213 def plot_config(fig, ax, xcoord, dates, title, conso_per_day): 213 def plot_config( 214 fig, ax, xcoord, dates, title, conso_per_day, conso_per_day_2 215 ): 214 216 """ 215 217 """ … … 242 244 yticks = list(ax.get_yticks()) 243 245 yticks.append(conso_per_day) 246 if conso_per_day_2: 247 yticks.append(conso_per_day_2) 244 248 ax.set_yticks(yticks) 245 249 246 250 ax.axhline(y=conso_per_day, color="blue", alpha=0.5, 247 251 label="conso journaliÚre idéale") 252 253 if conso_per_day_2: 254 ax.axhline(y=conso_per_day_2, color="blue", alpha=0.5) 248 255 249 256 for x, d in zip(xcoord, dates): … … 407 414 ) 408 415 409 conso_per_day = projet.alloc / (projet.days * 24.) 416 if projet.project == "gencmip6": 417 alloc1 = 5.e6 418 alloc2 = projet.alloc - alloc1 419 conso_per_day = 2 * alloc1 / (projet.days * 24.) 420 conso_per_day_2 = 2 * alloc2 / (projet.days * 24.) 421 else: 422 conso_per_day = projet.alloc / (projet.days * 24.) 423 conso_per_day_2 = None 410 424 411 425 # .. Plot stuff .. … … 427 441 ) 428 442 429 plot_config(fig, ax, xcoord, dates, title, conso_per_day) 443 plot_config( 444 fig, ax, xcoord, dates, title, conso_per_day, conso_per_day_2 445 ) 430 446 431 447 # ... Save figure ...
Note: See TracChangeset
for help on using the changeset viewer.