plot
get_title_from_configuration(dataframe_data, ions=False, crossing_type=None, display_LHC_version=True, display_energy=True, display_bunch_index=True, display_CC_crossing=True, display_bunch_intensity=True, display_beta=True, display_crossing_IP_1=True, display_crossing_IP_2=True, display_crossing_IP_5=True, display_crossing_IP_8=True, display_bunch_length=True, display_polarity_IP_2_8=True, display_emittance=True, display_chromaticity=True, display_octupole_intensity=True, display_coupling=True, display_filling_scheme=True, display_horizontal_tune=None, display_vertical_tune=None, display_tune=True, display_luminosity_1=True, display_luminosity_2=True, display_luminosity_5=True, display_luminosity_8=True, display_PU_1=True, display_PU_2=True, display_PU_5=True, display_PU_8=True, display_number_of_turns=False)
Generates a title string from the configuration data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataframe_data
|
DataFrame
|
The dataframe containing configuration data. |
required |
ions
|
bool
|
Whether the beam is composed of ions. Defaults to False. |
False
|
crossing_type
|
str
|
The type of crossing: 'vh' or 'hv'. Defaults to None, meaning it will try to be inferred from the optics file name. Back to 'hv' if not found. |
None
|
display_betx_bety
|
bool
|
Whether to display the beta functions. Defaults to True. |
required |
display_LHC_version
|
bool
|
Whether to display the LHC version. Defaults to True. |
True
|
display_energy
|
bool
|
Whether to display the energy. Defaults to True. |
True
|
display_bunch_index
|
bool
|
Whether to display the bunch index. Defaults to True. |
True
|
display_CC_crossing
|
bool
|
Whether to display the CC crossing. Defaults to True. |
True
|
display_bunch_intensity
|
bool
|
Whether to display the bunch intensity. Defaults to True. |
True
|
display_beta
|
bool
|
Whether to display the beta function. Defaults to True. |
True
|
display_crossing_IP_1
|
bool
|
Whether to display the crossing at IP1. Defaults to True. |
True
|
display_crossing_IP_2
|
bool
|
Whether to display the crossing at IP2. Defaults to True. |
True
|
display_crossing_IP_5
|
bool
|
Whether to display the crossing at IP5. Defaults to True. |
True
|
display_crossing_IP_8
|
bool
|
Whether to display the crossing at IP8. Defaults to True. |
True
|
display_bunch_length
|
bool
|
Whether to display the bunch length. Defaults to True. |
True
|
display_polarity_IP_2_8
|
bool
|
Whether to display the polarity at IP2 and IP8. Defaults to True. |
True
|
display_emittance
|
bool
|
Whether to display the emittance. Defaults to True. |
True
|
display_chromaticity
|
bool
|
Whether to display the chromaticity. Defaults to True. |
True
|
display_octupole_intensity
|
bool
|
Whether to display the octupole intensity. Defaults to True. |
True
|
display_coupling
|
bool
|
Whether to display the coupling. Defaults to True. |
True
|
display_filling_scheme
|
bool
|
Whether to display the filling scheme. Defaults to True. |
True
|
display_horizontal_tune
|
bool
|
Whether to display the horizontal tune. Defaults to None. Takes precedence over display_tune. |
None
|
display_vertical_tune
|
bool
|
Whether to display the vertical tune. Defaults to None. Takes precedence over display_tune. |
None
|
display_tune
|
bool
|
Whether to display the tune. Defaults to True. |
True
|
display_luminosity_1
|
bool
|
Whether to display the luminosity at IP1. Defaults to True. |
True
|
display_luminosity_2
|
bool
|
Whether to display the luminosity at IP2. Defaults to True. |
True
|
display_luminosity_5
|
bool
|
Whether to display the luminosity at IP5. Defaults to True. |
True
|
display_luminosity_8
|
bool
|
Whether to display the luminosity at IP8. Defaults to True. |
True
|
display_PU_1
|
bool
|
Whether to display the PU at IP1. Defaults to True. |
True
|
display_PU_2
|
bool
|
Whether to display the PU at IP2. Defaults to True. |
True
|
display_PU_5
|
bool
|
Whether to display the PU at IP5. Defaults to True. |
True
|
display_PU_8
|
bool
|
Whether to display the PU at IP8. Defaults to True. |
True
|
display_number_of_turns
|
bool
|
Whether to display the number of turns. Defaults to False. |
False
|
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The generated title string. |
Source code in study_da/plot/build_title.py
660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 | |
plot_3D(dataframe_data, x_variable, y_variable, z_variable, color_variable, xlabel=None, ylabel=None, z_label=None, title='', vmin=4.5, vmax=7.5, surface_count=30, opacity=0.2, figsize=(1000, 1000), colormap='RdBu', colorbar_title_text='Minimum DA (σ)', display_colormap=False, output_path='output.png', output_path_html='output.html', display_plot=True, dark_theme=False)
Plots a 3D volume rendering from the given dataframe.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataframe_data
|
DataFrame
|
The dataframe containing the data to plot. |
required |
x_variable
|
str
|
The variable to plot on the x-axis. |
required |
y_variable
|
str
|
The variable to plot on the y-axis. |
required |
z_variable
|
str
|
The variable to plot on the z-axis. |
required |
color_variable
|
str
|
The variable to use for the color scale. |
required |
xlabel
|
Optional[str]
|
The label for the x-axis. Defaults to None. |
None
|
ylabel
|
Optional[str]
|
The label for the y-axis. Defaults to None. |
None
|
z_label
|
Optional[str]
|
The label for the z-axis. Defaults to None. |
None
|
title
|
str
|
The title of the plot. Defaults to "". |
''
|
vmin
|
float
|
The minimum value for the color scale. Defaults to 4.5. |
4.5
|
vmax
|
float
|
The maximum value for the color scale. Defaults to 7.5. |
7.5
|
surface_count
|
int
|
The number of surfaces for volume rendering. Defaults to 30. |
30
|
opacity
|
float
|
The opacity of the volume rendering. Defaults to 0.2. |
0.2
|
figsize
|
tuple[float, float]
|
The size of the figure. Defaults to (1000, 1000). |
(1000, 1000)
|
colormap
|
str
|
The colormap to use. Defaults to "RdBu". |
'RdBu'
|
colorbar_title_text
|
str
|
The label for the colorbar. Defaults to "Minimum DA (σ)". |
'Minimum DA (σ)'
|
display_colormap
|
bool
|
Whether to display the colormap. Defaults to False. |
False
|
output_path
|
str
|
The path to save the plot image. Defaults to "output.png". |
'output.png'
|
output_path_html
|
str
|
The path to save the plot HTML. Defaults to "output.html". |
'output.html'
|
display_plot
|
bool
|
Whether to display the plot. Defaults to True. |
True
|
dark_theme
|
bool
|
Whether to use a dark theme. Defaults to False. |
False
|
Returns:
| Type | Description |
|---|---|
Any
|
go.Figure: The plotly figure object. |
Source code in study_da/plot/plot_study.py
559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 | |
plot_heatmap(dataframe_data, horizontal_variable, vertical_variable, color_variable, link=None, position_qr='top-right', plot_contours=True, xlabel=None, ylabel=None, tick_interval=2, round_xticks=None, round_yticks=None, symmetric_missing=False, mask_lower_triangle=False, mask_upper_triangle=False, plot_diagonal_lines=True, shift_diagonal_lines=1, xaxis_ticks_on_top=True, title='', vmin=4.5, vmax=7.5, k_masking=-1, green_contour=6.0, min_level_contours=1, max_level_contours=15, delta_levels_contours=0.5, figsize=None, label_cbar='Minimum DA (' + '$\\sigma$' + ')', colormap='coolwarm_r', style='ggplot', output_path='output.png', display_plot=True, latex_fonts=True, vectorize=False, fill_missing_value_with=None, dpi=300)
Plots a heatmap from the given dataframe.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataframe_data
|
DataFrame
|
The dataframe containing the data to plot. |
required |
horizontal_variable
|
str
|
The variable to plot on the horizontal axis. |
required |
vertical_variable
|
str
|
The variable to plot on the vertical axis. |
required |
color_variable
|
str
|
The variable to use for the color scale. |
required |
link
|
Optional[str]
|
A link to encode in a QR code. Defaults to None. |
None
|
plot_contours
|
bool
|
Whether to plot contours. Defaults to True. |
True
|
xlabel
|
Optional[str]
|
The label for the x-axis. Defaults to None. |
None
|
ylabel
|
Optional[str]
|
The label for the y-axis. Defaults to None. |
None
|
tick_interval
|
int
|
The interval for the ticks. Defaults to 2. |
2
|
round_xticks
|
Optional[int]
|
The number of decimal places to round the x-ticks to. Defaults to None. |
None
|
round_yticks
|
Optional[int]
|
The number of decimal places to round the y-ticks to. Defaults to None. |
None
|
symmetric_missing
|
bool
|
Whether to make the matrix symmetric by replacing the lower triangle with the upper triangle. Defaults to False. |
False
|
mask_lower_triangle
|
bool
|
Whether to mask the lower triangle. Defaults to False. |
False
|
mask_upper_triangle
|
bool
|
Whether to mask the upper triangle. Defaults to False. |
False
|
plot_diagonal_lines
|
bool
|
Whether to plot diagonal lines. Defaults to True. |
True
|
shift_diagonal_lines
|
int
|
The shift for the diagonal lines. Defaults to 1. |
1
|
xaxis_ticks_on_top
|
bool
|
Whether to place the x-axis ticks on top. Defaults to True. |
True
|
title
|
str
|
The title of the plot. Defaults to "". |
''
|
vmin
|
float
|
The minimum value for the color scale. Defaults to 4.5. |
4.5
|
vmax
|
float
|
The maximum value for the color scale. Defaults to 7.5. |
7.5
|
k_masking
|
int
|
The k parameter for masking. Defaults to -1. |
-1
|
green_contour
|
Optional[float]
|
The value for the green contour line. Defaults to 6.0. |
6.0
|
min_level_contours
|
float
|
The minimum level for the contours. Defaults to 1. |
1
|
max_level_contours
|
float
|
The maximum level for the contours. Defaults to 15. |
15
|
delta_levels_contours
|
float
|
The delta between contour levels. Defaults to 0.5. |
0.5
|
figsize
|
Optional[tuple[float, float]]
|
The size of the figure. Defaults to None. |
None
|
label_cbar
|
str
|
The label for the colorbar. Defaults to "Minimum DA ($\sigma$)". |
'Minimum DA (' + '$\\sigma$' + ')'
|
colormap
|
str
|
The colormap to use. Defaults to "coolwarm_r". |
'coolwarm_r'
|
style
|
str
|
The style to use for the plot. Defaults to "ggplot". |
'ggplot'
|
output_path
|
str
|
The path to save the plot. Defaults to "output.pdf". |
'output.png'
|
display_plot
|
bool
|
Whether to display the plot. Defaults to True. |
True
|
latex_fonts
|
bool
|
Whether to use LaTeX fonts. Defaults to True. |
True
|
vectorize
|
bool
|
Whether to vectorize the plot. Defaults to False. |
False
|
fill_missing_value_with
|
Optional[str | float]
|
The value to fill missing values with. Can be a number or 'interpolate'. Defaults to None. |
None
|
dpi
|
int
|
The DPI for the plot. Defaults to 300. |
300
|
Returns:
| Type | Description |
|---|---|
tuple[Figure, Axes]
|
tuple[plt.Figure, plt.Axes]: The figure and axes of the plot. |
Source code in study_da/plot/plot_study.py
362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 | |