How to display the results?

What you will learn

You will learn how to display results using some example scripts written in Python.

Please not that these scripts need the matplotlib Python module installed.

The ctools package does not contain any tools or scripts for graphical display of results since results are generally written into standard FITS files that are readily displayed by existing astronomical tools.

Nevertheless, for your convenience several scripts for graphical display are included in the ctools package that rely on the matplotlib Python module. You can find these scripts in the $CTOOLS/share/examples/python folder. The following scripts are available:

Script Usage
show_butterfly.py Display butterfly diagram
show_irf.py Display Instrument Response Function
show_lightcurve.py Display light curve
show_obs.py Display observation summary
show_pha.py Display Pulse High Analyser File
show_phases.py Display event phases
show_pointings.py Display pointing directions
show_residuals.py Display spectral residuals
show_response.py Display response components
show_rmf.py Display Redistribution Matrix File
show_significance_distribution.py Display significance distribution
show_spectrum.py Display spectrum

Do not hesitate to copy and adapt these scripts to your needs.

Below some usage examples and the expected output.

show_butterfly.py

$ $CTOOLS/share/examples/python/show_butterfly.py butterfly.txt
../../../_images/howto_display_butterfly.png

Butterfly diagram displayed with show_butterfly.py

show_irf.py

$ $CTOOLS/share/examples/python/show_irf.py prod2 South_50h
../../../_images/howto_display_irf.png

Instrument Response Function displayed with show_irf.py

show_lightcurve.py

$ $CTOOLS/share/examples/python/show_lightcurve.py lightcurve.fits
../../../_images/howto_lightcurve.png

Light curve displayed with show_lightcurve.py

show_obs.py

$ $CTOOLS/share/examples/python/show_obs.py obs.xml
../../../_images/howto_display_obs.png

Observation summary displayed with show_obs.py

show_pha.py

$ $CTOOLS/share/examples/python/show_pha.py pha.fits
../../../_images/howto_display_pha.png

Pulse Hight Analyser File displayed with show_pha.py

show_phases.py

$ $CTOOLS/share/examples/python/show_phases.py -n 50 events_phased.fits
../../../_images/howto_display_phases.png

Event phases displayed with show_phases.py

show_pointings.py

$ $CTOOLS/share/examples/python/show_pointings.py obs.xml
../../../_images/howto_display_pointings.png

Pointings displayed with show_pointings.py (zoomed in)

show_residuals.py

$ $CTOOLS/share/examples/python/show_residuals.py residual.fits
../../../_images/howto_display_residuals.png

Spectral residuals displayed with show_residuals.py

show_response.py

$ $CTOOLS/share/examples/python/show_response.py
../../../_images/howto_display_rsp_aeff.png ../../../_images/howto_display_rsp_bkg.png ../../../_images/howto_display_rsp_sens.png

show_rmf.py

$ $CTOOLS/share/examples/python/show_rmf.py rmf.fits
../../../_images/howto_display_rmf.png

Redistribution Matrix File displayed with show_rmf.py

show_significance_distribution.py

$ $CTOOLS/share/examples/python/show_significance_distribution.py skymap.fits --exclude skymap.fits[EXCLUSION]
../../../_images/howto_display_significance.png

Significance distribution displayed with show_significance_distribution.py

show_spectrum.py

$ $CTOOLS/share/examples/python/show_spectrum.py spectrum.fits
../../../_images/howto_display_spectrum.png

Spectrum displayed with show_spectrum.py