To plot images you can download a script plot_images_pub.py
from http://apservice.icc.ru/tools. To run the script you should install required python packages h5py
, tqdm
, numpy
, matplotlib
. You can do it using the following command (in bash):
$ pip install h5py tqdm numpy matplotlib
An HDF5 sample can be downloaded from http://apservice.icc.ru/download_datasets. To run the plotting script you can use the following command:
$ python path/to/plot_images_pub.py path/to/your_hdf5_sample.h5
The script will draw images sequentially. To show the next event, close the current window. Progress is displayed in the standard output stream.
You can use and modify the script to plot hexagonal iact images using the iact_image_show
function, written in the script:
iact_image_show(img, x, y, cmap=None, norm=None, vmin=None, vmax=None, alpha=None, linewidths=None, edgecolors=None, axes=None,)
The function takes the following parameters:
img
: amplitudes of hexagonal pixels (1d array)x, y
: pixel coordinates with the same shape as imgcmap
: str or~matplotlib.colors.Colormap
, optional. TheColormap
instance or registered colormap name used to map scalar data to colors.norm
:~matplotlib.colors.Normalize
, optional. TheNormalize
instance used to scale scalar data to the [0, 1] range before mapping to colors using cmap. By default, a linear scaling mapping. For logarithmic scale you can usevmin, vmax
: scalar, optional When using scalar data and no explicitnorm
,vmin
andvmax
define the data range that the colormap covers. By default, the colormap covers the complete value range of the supplied data.vmin
,vmax
are ignored if thenorm
parameter is used.alpha
: scalar, optional. Transparency of the image.linewidths
: scalar, optional. Width of pixel edges.edgecolors
: scalar, optional. Color of pixel edges.- axes :
~matplotlib.axes.Axes
, optional/ Axes on which the image will be plotted. By current axis by default.
How to view the hdf5 file structure of the sample file you can find in https://astroparticle.online/file-structure-for-datasets