ShapeCalc

ZinggPlot(feature, models, mean=False, n=30, ax=None, marker=None)

summary

Parameters:
  • feature (_type_) –

    description

  • models (_type_) –

    description

  • mean (bool, default: False ) –

    description. Defaults to False.

  • n (int, default: 30 ) –

    description. Defaults to 30.

  • ax (_type_, default: None ) –

    description. Defaults to None.

  • marker (_type_, default: None ) –

    description. Defaults to None.

Returns:
  • _type_

    description

Source code in MinDet/Process/shape_calc.py
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
def ZinggPlot(feature, models, mean = False, n = 30, ax = None, marker = None):
    """_summary_

    Args:
        feature (_type_): _description_
        models (_type_): _description_
        mean (bool, optional): _description_. Defaults to False.
        n (int, optional): _description_. Defaults to 30.
        ax (_type_, optional): _description_. Defaults to None.
        marker (_type_, optional): _description_. Defaults to None.

    Returns:
        _type_: _description_
    """

    if marker is not None:
        m = marker
    else:
        m = 'k.'

    z, err = calc_zingg(feature, models)

    if ax is not None:
        ax.plot(z[0], z[1], m)
        ax.errorbar(z[0], z[1], xerr = err[0], yerr = err[1], fmt = m)
        return None
    else:
        fig, ax = plt.subplots(1,1,figsize = (8,8))
        ax.plot(z[0], z[1], m)
        ax.errorbar(z[0], z[1], xerr = err[0], yerr = err[1], fmt = m)
        ax.set_ylim([0,1])
        ax.set_xlim([0,1])
        ax.set_ylabel("I/L")
        ax.set_xlabel("S/I")
        return fig, ax

split_at(string, char, n)

Splits string into two at the nth occurence of the character specified.

Input

string - string to be split into two char - character to split at n - the occurrence of character at which splitting should occur.

Returns

The two ends of the string split at the specified position.

Source code in MinDet/Process/shape_calc.py
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
def split_at(string, char, n):
    """
    Splits string into two at the nth occurence of the character specified.

    Input
    ------------------------------------
    string - string to be split into two
    char - character to split at
    n - the occurrence of character at which splitting should occur.

    Returns
    -------------------------------------
    The two ends of the string split at the specified position.
    """
    words = string.split(char)
    return char.join(words[:n]), char.join(words[n:])