For ROOT users

Many previous VHE gamma-ray developers are familiar with the CERN ROOT library for data processing. ctapipe is intentionally not ROOT based, and we do not allow ROOT or pyroot as a required dependency of ctapipe due to its large and complex nature and maintenence issues. Fortunately nearly all ROOT-like functionality can be found in the scientific python stack, though the API is of course not the same.

To help developers familiar only with ROOT migrate to the scientific python stack, the following table can be helpful:

ROOT functionality

Recommended Python Equivalent

interactive interpreter

ipython, jupyter notebook

TH1D,TH2D,TH3D

numpy.ndarray + numpy.histogramdd()

TProfile

numpy.ndarray

TGraph

numpy.ndarray + matplotlib plots

TTree

astropy.table, pandas, pytables

ROOT File format (TFile)

HDF5 (pytables)

TMinuit

scipy.optimize or iminuit

2D/3D graphics

matplotlib or bokeh

TMVA

scikit-learn

GUI

various (wxwidgets, Qt,gtk)

AstroROOT

astropy.io.fits or fitsio

ROOFit

astropy.modelling or lmfit

Reflex, CINT

not needed

TMatrix, etc

numpy.ndarray + scipy.linalg

TMatrixTSparse

scipy.sparse

TList

list

TArray, TObjArray

list

TMap, THashList

dict

TRandom

numpy.random + scipy.stats

Math, MathMore

numpy + scipy

Script compilation

Numba, Cython

ROOT::Math::VirtualIntegrator

scipy.integrate

Access to external C++ code

cython, ctypes

astropy.coordinates

astropy.units

astropy.time

astropy.wcs (projections)

numpy.ndarray (n-dimensional tables)

scipy.interpolate.interpnd (n-dimensional interpolation)

scipy.signal (digital signal processing)