Data visualisation

To plot images you can download a script from 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 To run the plotting script you can use the following command:

$ python path/to/ 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 img
  • cmap : str or ~matplotlib.colors.Colormap, optional. The Colormap instance or registered colormap name used to map scalar data to colors.
  • norm : ~matplotlib.colors.Normalize, optional. The Normalize 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 use
  • vmin, vmax : scalar, optional When using scalar data and no explicit norm, vmin and vmax 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 the norm 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

Scroll Up