ctaplot/plots/plots.py
def plot_theta2(reco_alt, reco_az, simu_alt, simu_az, bias_correction=False, ax=None, **kwargs):
    """
    Plot the theta2 distribution and display the corresponding angular resolution in degrees.
    The input must be given in radians.

    Parameters
    ----------
    reco_alt: `numpy.ndarray`
        reconstructed altitude angle in radians
    reco_az: `numpy.ndarray`
        reconstructed azimuth angle in radians
    simu_alt: `numpy.ndarray`
        true altitude angle in radians
    simu_az: `numpy.ndarray`
        true azimuth angle in radians
    ax: `matplotlib.pyplot.axes`
    **kwargs:
        options for `matplotlib.pyplot.hist`

    Returns
    -------
    ax: `matplotlib.pyplot.axes`
    """

    ax = plt.gca() if ax is None else ax

    if bias_correction:
        bias_alt = ana.bias(simu_alt, reco_alt)
        bias_az = ana.bias(simu_az, reco_az)
        reco_alt = reco_alt - bias_alt
        reco_az = reco_az - bias_az

    theta2 = (np.rad2deg(np.sqrt(ana.theta2(reco_alt, reco_az, simu_alt, simu_az))))** 2
    ang_res = np.rad2deg(ana.angular_resolution(reco_alt, reco_az, simu_alt, simu_az))

    ax.set_xlabel(r'$\theta^2 [deg^2]$')
    ax.set_ylabel('Count')

    ax.hist(theta2, **kwargs)
    ax.set_title(r'angular resolution: {:.3f}(+{:.2f}/-{:.2f}) deg'.format(ang_res[0], ang_res[2], ang_res[1]))

    return ax

    Plot the theta2 distribution and display the corresponding angular resolution in degrees.
    The input must be given in radians.

    Parameters
    ----------
    reco_alt: `numpy.ndarray`
        reconstructed altitude angle in radians
    reco_az: `numpy.ndarray`
        reconstructed azimuth angle in radians
    simu_alt: `numpy.ndarray`
        true altitude angle in radians
    simu_az: `numpy.ndarray`
        true azimuth angle in radians
    ax: `matplotlib.pyplot.axes`
    **kwargs:
        options for `matplotlib.pyplot.hist`

    Returns
    -------
    ax: `matplotlib.pyplot.axes`
    
Plot the theta2 distribution and display the corresponding angular resolution in degrees.
The input must be given in radians.

Parameters



Returns


Plot the theta2 distribution and display the corresponding angular resolution in degrees . The input must be given in radians . Parameters Returns
def plot_theta2(reco_alt, reco_az, simu_alt, simu_az, bias_correction=False, ax=None, **kwargs):
    ax = plt.gca() if ax is None else ax
    if bias_correction:
        bias_alt = ana.bias(simu_alt, reco_alt)
        bias_az = ana.bias(simu_az, reco_az)
        reco_alt = reco_alt - bias_alt
        reco_az = reco_az - bias_az
    theta2 = (np.rad2deg(np.sqrt(ana.theta2(reco_alt, reco_az, simu_alt, simu_az))))** 2
    ang_res = np.rad2deg(ana.angular_resolution(reco_alt, reco_az, simu_alt, simu_az))
    ax.set_xlabel(r'$\theta^2 [deg^2]$')
    ax.set_ylabel('Count')
    ax.hist(theta2, **kwargs)
    ax.set_title(r'angular resolution: {:.3f}(+{:.2f}/-{:.2f}) deg'.format(ang_res[0], ang_res[2], ang_res[1]))
    return ax
def plot_theta2 ( reco_alt , reco_az , simu_alt , simu_az , bias_correction = False , ax = None , ** kwargs ) : ax = plt . gca ( ) if ax is None else ax if bias_correction : bias_alt = ana . bias ( simu_alt , reco_alt ) bias_az = ana . bias ( simu_az , reco_az ) reco_alt = reco_alt - bias_alt reco_az = reco_az - bias_az theta2 = ( np . rad2deg ( np . sqrt ( ana . theta2 ( reco_alt , reco_az , simu_alt , simu_az ) ) ) ) ** 2 ang_res = np . rad2deg ( ana . angular_resolution ( reco_alt , reco_az , simu_alt , simu_az ) ) ax . set_xlabel ( r'$\theta^2 [deg^2]$' ) ax . set_ylabel ( 'Count' ) ax . hist ( theta2 , ** kwargs ) ax . set_title ( r'angular resolution: {:.3f}(+{:.2f}/-{:.2f}) deg' . format ( ang_res [ 0 ] , ang_res [ 2 ] , ang_res [ 1 ] ) ) return ax
Plot the theta2 distribution and display the corresponding angular resolution in degrees.
Plot the theta2 distribution and display the corresponding angular resolution in degrees .
"""
    Plot the theta2 distribution and display the corresponding angular resolution in degrees.
    The input must be given in radians.

    Parameters
    ----------
    reco_alt: `numpy.ndarray`
        reconstructed altitude angle in radians
    reco_az: `numpy.ndarray`
        reconstructed azimuth angle in radians
    simu_alt: `numpy.ndarray`
        true altitude angle in radians
    simu_az: `numpy.ndarray`
        true azimuth angle in radians
    ax: `matplotlib.pyplot.axes`
    **kwargs:
        options for `matplotlib.pyplot.hist`

    Returns
    -------
    ax: `matplotlib.pyplot.axes`
    """
reco_alt
reco_az
simu_alt
simu_az
bias_correction
ax