ctaplot/plots/plots.py
def plot_angular_resolution_per_energy(reco_alt, reco_az, mc_alt, mc_az, reco_energy,
                                       percentile=68.27, confidence_level=0.95, bias_correction=False,
                                       ax=None, **kwargs):
    """
    Plot the angular resolution as a function of the reconstructed energy

    Parameters
    ----------
    reco_alt: `numpy.ndarray`
        reconstructed altitudes in radians
    reco_az: `numpy.ndarray`
        reconstructed azimuths in radians
    mc_alt: `numpy.ndarray`
        true altitudes in radians
    mc_az: `numpy.ndarray`
        true azimuths in radians
    reco_energy: `numpy.ndarray`
        energies in TeV
    ax: `matplotlib.pyplot.axes`
    kwargs: args for `matplotlib.pyplot.errorbar`

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

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

    try:
        e_bin, RES = ana.angular_resolution_per_energy(reco_alt, reco_az, mc_alt, mc_az, reco_energy,
                                                       percentile=percentile,
                                                       confidence_level=confidence_level,
                                                       bias_correction=bias_correction
                                                       )
    except Exception as e:
        print('Angular resolution ', e)
    else:
        # Angular resolution is traditionally presented in degrees
        RES = np.degrees(RES)

        E = ana.logbin_mean(e_bin)

        if 'fmt' not in kwargs:
            kwargs['fmt'] = 'o'

        ax.set_ylabel('Angular Resolution [deg]')
        ax.set_xlabel(r'$E_R$ [TeV]')
        ax.set_xscale('log')
        ax.set_title('Angular resolution')

        ax.errorbar(E, RES[:, 0], xerr=(e_bin[1:] - e_bin[:-1]) / 2.,
                    yerr=(RES[:, 0] - RES[:, 1], RES[:, 2] - RES[:, 0]), **kwargs)
        ax.grid('on', which='both')
    finally:
        return ax

    Plot the angular resolution as a function of the reconstructed energy

    Parameters
    ----------
    reco_alt: `numpy.ndarray`
        reconstructed altitudes in radians
    reco_az: `numpy.ndarray`
        reconstructed azimuths in radians
    mc_alt: `numpy.ndarray`
        true altitudes in radians
    mc_az: `numpy.ndarray`
        true azimuths in radians
    reco_energy: `numpy.ndarray`
        energies in TeV
    ax: `matplotlib.pyplot.axes`
    kwargs: args for `matplotlib.pyplot.errorbar`

    Returns
    -------
    ax: `matplotlib.pyplot.axes`
    
Plot the angular resolution as a function of the reconstructed energy
Parameters



Returns


Plot the angular resolution as a function of the reconstructed energy Parameters Returns
def plot_angular_resolution_per_energy(reco_alt, reco_az, mc_alt, mc_az, reco_energy,
                                       percentile=68.27, confidence_level=0.95, bias_correction=False,
                                       ax=None, **kwargs):
    ax = plt.gca() if ax is None else ax
    try:
        e_bin, RES = ana.angular_resolution_per_energy(reco_alt, reco_az, mc_alt, mc_az, reco_energy,
                                                       percentile=percentile,
                                                       confidence_level=confidence_level,
                                                       bias_correction=bias_correction
                                                       )
    except Exception as e:
        print('Angular resolution ', e)
    else:
        RES = np.degrees(RES)
        E = ana.logbin_mean(e_bin)
        if 'fmt' not in kwargs:
            kwargs['fmt'] = 'o'
        ax.set_ylabel('Angular Resolution [deg]')
        ax.set_xlabel(r'$E_R$ [TeV]')
        ax.set_xscale('log')
        ax.set_title('Angular resolution')
        ax.errorbar(E, RES[:, 0], xerr=(e_bin[1:] - e_bin[:-1]) / 2.,
                    yerr=(RES[:, 0] - RES[:, 1], RES[:, 2] - RES[:, 0]), **kwargs)
        ax.grid('on', which='both')
    finally:
        return ax
def plot_angular_resolution_per_energy ( reco_alt , reco_az , mc_alt , mc_az , reco_energy , percentile = 68.27 , confidence_level = 0.95 , bias_correction = False , ax = None , ** kwargs ) : ax = plt . gca ( ) if ax is None else ax try : e_bin , RES = ana . angular_resolution_per_energy ( reco_alt , reco_az , mc_alt , mc_az , reco_energy , percentile = percentile , confidence_level = confidence_level , bias_correction = bias_correction ) except Exception as e : print ( 'Angular resolution ' , e ) else : RES = np . degrees ( RES ) E = ana . logbin_mean ( e_bin ) if 'fmt' not in kwargs : kwargs [ 'fmt' ] = 'o' ax . set_ylabel ( 'Angular Resolution [deg]' ) ax . set_xlabel ( r'$E_R$ [TeV]' ) ax . set_xscale ( 'log' ) ax . set_title ( 'Angular resolution' ) ax . errorbar ( E , RES [ : , 0 ] , xerr = ( e_bin [ 1 : ] - e_bin [ : - 1 ] ) / 2. , yerr = ( RES [ : , 0 ] - RES [ : , 1 ] , RES [ : , 2 ] - RES [ : , 0 ] ) , ** kwargs ) ax . grid ( 'on' , which = 'both' ) finally : return ax
Plot the angular resolution as a function of the reconstructed energy
Parameters
Plot the angular resolution as a function of the reconstructed energy Parameters
"""
    Plot the angular resolution as a function of the reconstructed energy

    Parameters
    ----------
    reco_alt: `numpy.ndarray`
        reconstructed altitudes in radians
    reco_az: `numpy.ndarray`
        reconstructed azimuths in radians
    mc_alt: `numpy.ndarray`
        true altitudes in radians
    mc_az: `numpy.ndarray`
        true azimuths in radians
    reco_energy: `numpy.ndarray`
        energies in TeV
    ax: `matplotlib.pyplot.axes`
    kwargs: args for `matplotlib.pyplot.errorbar`

    Returns
    -------
    ax: `matplotlib.pyplot.axes`
    """ # Angular resolution is traditionally presented in degrees
reco_alt
reco_az
mc_alt
mc_az
reco_energy
percentile
confidence_level
bias_correction
ax