build_title
This module provides functions to compute LaTeX strings for plot titles based on data from a pandas DataFrame. The functions extract various parameters such as crossing type, LHC version, energy, bunch index, crab cavity crossing angle, bunch intensity, beta functions, crossing angles at different interaction points (IPs), bunch length, polarity, normalized emittance, chromaticity, octupole intensity, linear coupling, filling scheme, tune, luminosity, and pile-up.
Functions:
| Name | Description |
|---|---|
latex_float |
float, precision: int = 3) -> str: |
get_crossing_type |
pd.DataFrame) -> str: |
get_LHC_version_str |
pd.DataFrame) -> str: |
get_energy_str |
pd.DataFrame) -> str: |
get_bunch_index_str |
pd.DataFrame) -> str: |
get_CC_crossing_str |
pd.DataFrame) -> str: |
get_bunch_intensity_str |
pd.DataFrame) -> str: |
get_beta_str |
float, bety_value: float) -> str: |
_get_plane_crossing_IP_1_5_str |
pd.DataFrame, type_crossing: str) -> tuple[str, str]: |
_get_crossing_value_IP_1_5 |
pd.DataFrame, ip: int) -> float: |
get_crossing_IP_1_5_str |
pd.DataFrame, type_crossing: str) -> tuple[str, str]: |
get_crossing_IP_2_8_str |
pd.DataFrame) -> list[str]: |
get_bunch_length_str |
pd.DataFrame) -> str: |
get_polarity_IP_2_8_str |
pd.DataFrame) -> str: |
get_normalized_emittance_str |
pd.DataFrame) -> str: |
get_chromaticity_str |
pd.DataFrame) -> str: |
get_octupole_intensity_str |
pd.DataFrame) -> str: |
get_linear_coupling_str |
pd.DataFrame) -> str: |
get_filling_scheme_str |
pd.DataFrame) -> str: |
get_tune_str |
pd.DataFrame) -> str: |
get_luminosity_at_ip_str |
pd.DataFrame, ip: int, beam_beam=True) -> str: |
get_PU_at_IP_str |
pd.DataFrame, ip: int, beam_beam=True) -> str: |
get_title_from_configuration |
|
get_CC_crossing_str(dataframe_data)
Retrieves the crab cavity crossing angle from the dataframe.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataframe_data
|
DataFrame
|
The dataframe containing crab cavity crossing angle information. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The crab cavity crossing angle string. |
Source code in study_da/plot/build_title.py
get_LHC_version_str(dataframe_data, ions=False)
Retrieves the LHC version from the dataframe.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataframe_data
|
DataFrame
|
The dataframe containing LHC version information. |
required |
ions
|
bool
|
Whether the study is for ions. Defaults to False. |
False
|
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The LHC version string. |
Source code in study_da/plot/build_title.py
get_PU_at_IP_str(dataframe_data, ip, beam_beam=True)
Retrieves the pile-up at a given IP from the dataframe.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataframe_data
|
DataFrame
|
The dataframe containing pile-up information. |
required |
ip
|
int
|
The IP number. |
required |
beam_beam
|
bool
|
Whether to consider beam-beam pile-up. Defaults to True. |
True
|
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The pile-up string. |
Source code in study_da/plot/build_title.py
get_beta_str(dataframe_data)
Retrieves the beta function string from the dataframe.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataframe_data
|
DataFrame
|
The dataframe containing beta function information. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The beta function string. |
Source code in study_da/plot/build_title.py
get_bunch_index_str(dataframe_data)
Retrieves the bunch index from the dataframe.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataframe_data
|
DataFrame
|
The dataframe containing bunch index information. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The bunch index string. |
Source code in study_da/plot/build_title.py
get_bunch_intensity_str(dataframe_data)
Retrieves the bunch intensity string from the dataframe.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataframe_data
|
DataFrame
|
The dataframe containing bunch intensity information. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The bunch intensity string. |
Source code in study_da/plot/build_title.py
get_bunch_length_str(dataframe_data)
Retrieves the bunch length from the dataframe.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataframe_data
|
DataFrame
|
The dataframe containing bunch length information. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The bunch length string. |
Source code in study_da/plot/build_title.py
get_chromaticity_str(dataframe_data)
Retrieves the chromaticity from the dataframe.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataframe_data
|
DataFrame
|
The dataframe containing chromaticity information. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The chromaticity string. |
Source code in study_da/plot/build_title.py
get_crossing_IP_1_5_str(dataframe_data, type_crossing)
Retrieves the crossing angle strings for IP1 and IP5.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataframe_data
|
DataFrame
|
The dataframe containing crossing angle information. |
required |
type_crossing
|
str
|
The type of crossing. Either "hv" or "vh". |
required |
Returns:
| Type | Description |
|---|---|
tuple[str, str]
|
tuple[str, str]: The crossing angle strings for IP1 and IP5. |
Source code in study_da/plot/build_title.py
get_crossing_IP_2_8_str(dataframe_data)
Retrieves the crossing angle strings for IP2 and IP8.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataframe_data
|
DataFrame
|
The dataframe containing crossing angle information. |
required |
Returns:
| Type | Description |
|---|---|
list[str]
|
tuple[str, str]: The crossing angle strings for IP2 and IP8. |
Source code in study_da/plot/build_title.py
get_crossing_type(dataframe_data)
Retrieves the crossing type from the dataframe.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataframe_data
|
DataFrame
|
The dataframe containing crossing type information. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The crossing type string. |
Source code in study_da/plot/build_title.py
get_energy_str(dataframe_data, ions=False)
Retrieves the energy from the dataframe.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataframe_data
|
DataFrame
|
The dataframe containing energy information. |
required |
ions
|
bool
|
Whether the study is for ions. Defaults to False. |
False
|
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The energy string. |
Source code in study_da/plot/build_title.py
get_filling_scheme_str(dataframe_data)
Retrieves the filling scheme from the dataframe.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataframe_data
|
DataFrame
|
The dataframe containing filling scheme information. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The filling scheme string. |
Source code in study_da/plot/build_title.py
get_linear_coupling_str(dataframe_data)
Retrieves the linear coupling from the dataframe.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataframe_data
|
DataFrame
|
The dataframe containing linear coupling information. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The linear coupling string. |
Source code in study_da/plot/build_title.py
get_luminosity_at_ip_str(dataframe_data, ip, beam_beam=True)
Retrieves the luminosity at a given IP from the dataframe.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataframe_data
|
DataFrame
|
The dataframe containing luminosity information. |
required |
ip
|
int
|
The IP number. |
required |
beam_beam
|
bool
|
Whether to consider beam-beam luminosity. Defaults to True. |
True
|
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The luminosity string. |
Source code in study_da/plot/build_title.py
get_normalized_emittance_str(dataframe_data)
Retrieves the normalized emittance from the dataframe.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataframe_data
|
DataFrame
|
The dataframe containing normalized emittance information. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The normalized emittance string. |
Source code in study_da/plot/build_title.py
get_number_of_turns_str(dataframe_data)
Retrieves the number of turns from the dataframe.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataframe_data
|
DataFrame
|
The dataframe containing the number of turns information. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The number of turns string. |
Source code in study_da/plot/build_title.py
get_octupole_intensity_str(dataframe_data)
Retrieves the octupole intensity from the dataframe.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataframe_data
|
DataFrame
|
The dataframe containing octupole intensity information. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The octupole intensity string. |
Source code in study_da/plot/build_title.py
get_polarity_IP_2_8_str(dataframe_data)
Retrieves the polarity at IP2 and IP8 from the dataframe.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataframe_data
|
DataFrame
|
The dataframe containing polarity information. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The polarity string. |
Source code in study_da/plot/build_title.py
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 | |
get_tune_str(dataframe_data, display_horizontal_tune=None, display_vertical_tune=None)
Retrieves the tune from the dataframe.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataframe_data
|
DataFrame
|
The dataframe containing tune information. |
required |
display_horizontal_tune
|
bool
|
Whether to display the horizontal tune. Defaults to None. |
None
|
display_vertical_tune
|
bool
|
Whether to display the vertical tune. Defaults to None. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The tune string. |
Source code in study_da/plot/build_title.py
latex_float(f, precision=3)
Converts a float to a scientific LaTeX format string.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
f
|
float
|
The float to convert. |
required |
precision
|
int
|
The precision of the float. Defaults to 3. |
3
|
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The float in scientific LaTeX format. |