ctaplot/plots/plots.py
def plot_impact_map(impact_x, impact_y, tel_x, tel_y, tel_types=None,
                    ax=None,
                    Outfile="ImpactMap.png",
                    hist_kwargs={},
                    scatter_kwargs={},
                    ):
    """
    Map of the site with telescopes positions and impact points heatmap

    Parameters
    ----------
    impact_x: `numpy.ndarray`
    impact_y: `numpy.ndarray`
    tel_x: `numpy.ndarray`
    tel_y: `numpy.ndarray`
    tel_types: `numpy.ndarray`
    ax: `matplotlib.pyplot.axes`
    hist_kwargs: `kwargs` for `matplotlib.pyplot.hist`
    scatter_kwargs: `kwargs` for `matplotlib.pyplot.scatter`
    Outfile: string - name of the output file
    """
    ax = plt.gca() if ax is None else ax

    hist_kwargs['bins'] = 40 if 'bins' not in hist_kwargs else hist_kwargs['bins']
    ax.hist2d(impact_x, impact_y, **hist_kwargs)
    pcm = ax.get_children()[0]
    plt.colorbar(pcm, ax=ax)

    assert (len(tel_x) == len(tel_y)), "tel_x and tel_y should have the same length"

    scatter_kwargs['s'] = 50 if 's' not in scatter_kwargs else scatter_kwargs['s']

    if tel_types and 'color' not in scatter_kwargs and 'c' not in scatter_kwargs:
        scatter_kwargs['color'] = tel_types
        assert (len(tel_types) == len(tel_x)), "tel_types and tel_x should have the same length"
        ax.scatter(tel_x, tel_y, **scatter_kwargs)
    else:
        if 'color' not in scatter_kwargs and 'c' not in scatter_kwargs:
            scatter_kwargs['color'] = 'black'
        scatter_kwargs['marker'] = '+' if 'marker' not in scatter_kwargs else scatter_kwargs['marker']
        ax.scatter(tel_x, tel_y, **scatter_kwargs)

    ax.axis('equal')
    plt.savefig(Outfile, bbox_inches="tight", format='png', dpi=200)

    return ax

    Map of the site with telescopes positions and impact points heatmap

    Parameters
    ----------
    impact_x: `numpy.ndarray`
    impact_y: `numpy.ndarray`
    tel_x: `numpy.ndarray`
    tel_y: `numpy.ndarray`
    tel_types: `numpy.ndarray`
    ax: `matplotlib.pyplot.axes`
    hist_kwargs: `kwargs` for `matplotlib.pyplot.hist`
    scatter_kwargs: `kwargs` for `matplotlib.pyplot.scatter`
    Outfile: string - name of the output file
    
Map of the site with telescopes positions and impact points heatmap
Parameters


Map of the site with telescopes positions and impact points heatmap Parameters
def plot_impact_map(impact_x, impact_y, tel_x, tel_y, tel_types=None,
                    ax=None,
                    Outfile="ImpactMap.png",
                    hist_kwargs={},
                    scatter_kwargs={},
                    ):
    ax = plt.gca() if ax is None else ax
    hist_kwargs['bins'] = 40 if 'bins' not in hist_kwargs else hist_kwargs['bins']
    ax.hist2d(impact_x, impact_y, **hist_kwargs)
    pcm = ax.get_children()[0]
    plt.colorbar(pcm, ax=ax)
    assert (len(tel_x) == len(tel_y)), "tel_x and tel_y should have the same length"
    scatter_kwargs['s'] = 50 if 's' not in scatter_kwargs else scatter_kwargs['s']
    if tel_types and 'color' not in scatter_kwargs and 'c' not in scatter_kwargs:
        scatter_kwargs['color'] = tel_types
        assert (len(tel_types) == len(tel_x)), "tel_types and tel_x should have the same length"
        ax.scatter(tel_x, tel_y, **scatter_kwargs)
    else:
        if 'color' not in scatter_kwargs and 'c' not in scatter_kwargs:
            scatter_kwargs['color'] = 'black'
        scatter_kwargs['marker'] = '+' if 'marker' not in scatter_kwargs else scatter_kwargs['marker']
        ax.scatter(tel_x, tel_y, **scatter_kwargs)
    ax.axis('equal')
    plt.savefig(Outfile, bbox_inches="tight", format='png', dpi=200)
    return ax
def plot_impact_map ( impact_x , impact_y , tel_x , tel_y , tel_types = None , ax = None , Outfile = "ImpactMap.png" , hist_kwargs = { } , scatter_kwargs = { } , ) : ax = plt . gca ( ) if ax is None else ax hist_kwargs [ 'bins' ] = 40 if 'bins' not in hist_kwargs else hist_kwargs [ 'bins' ] ax . hist2d ( impact_x , impact_y , ** hist_kwargs ) pcm = ax . get_children ( ) [ 0 ] plt . colorbar ( pcm , ax = ax ) assert ( len ( tel_x ) == len ( tel_y ) ) , "tel_x and tel_y should have the same length" scatter_kwargs [ 's' ] = 50 if 's' not in scatter_kwargs else scatter_kwargs [ 's' ] if tel_types and 'color' not in scatter_kwargs and 'c' not in scatter_kwargs : scatter_kwargs [ 'color' ] = tel_types assert ( len ( tel_types ) == len ( tel_x ) ) , "tel_types and tel_x should have the same length" ax . scatter ( tel_x , tel_y , ** scatter_kwargs ) else : if 'color' not in scatter_kwargs and 'c' not in scatter_kwargs : scatter_kwargs [ 'color' ] = 'black' scatter_kwargs [ 'marker' ] = '+' if 'marker' not in scatter_kwargs else scatter_kwargs [ 'marker' ] ax . scatter ( tel_x , tel_y , ** scatter_kwargs ) ax . axis ( 'equal' ) plt . savefig ( Outfile , bbox_inches = "tight" , format = 'png' , dpi = 200 ) return ax
Map of the site with telescopes positions and impact points heatmap
Parameters
Map of the site with telescopes positions and impact points heatmap Parameters
"""
    Map of the site with telescopes positions and impact points heatmap

    Parameters
    ----------
    impact_x: `numpy.ndarray`
    impact_y: `numpy.ndarray`
    tel_x: `numpy.ndarray`
    tel_y: `numpy.ndarray`
    tel_types: `numpy.ndarray`
    ax: `matplotlib.pyplot.axes`
    hist_kwargs: `kwargs` for `matplotlib.pyplot.hist`
    scatter_kwargs: `kwargs` for `matplotlib.pyplot.scatter`
    Outfile: string - name of the output file
    """
impact_x
impact_y
tel_x
tel_y
tel_types
ax
Outfile
hist_kwargs
scatter_kwargs