The Minimum Spanning Tree (MST) has been used in a broad range of scientific research including computer science, epidemiology, social sciences, particle physics, astronomy and cosmology. Its success in these field has been driven by its sensitivity to the spatial distribution of points and the patterns within. MiSTree, a public Python package, allows a user to construct the MST in a variety of coordinates systems, including Celestial coordinates used in astronomy. The package enables the MST to be constructed quickly by initially using a k-nearest neighbour graph (rather than a matrix of pairwise distances) which is then fed to Kruskal’s algorithm to construct the MST. MiSTree enables a user to measure the statistics of the MST and provides classes for binning the MST statistics (into histograms) and plotting the distributions. Including the MST in parameter estimation studies in cosmology will enable the inclusion of high-order statistics information from the cosmic web. This information has traditionally been unexploited due to the computational cost of calculating N-point statistics.
MiSTree will work on Python 2.7 or 3.4+ and requires the following Python modules:
MiSTree can be installed as follows:
pip install mistree [--user]
--user is optional and only required if you don’t have write permission. If you
want to work on the Github version you can clone the repository
and install it in place:
git clone https://github.com/knaidoo29/mistree.git cd mistree pip install -e . [--user]
mistree directory you can then test the install using
python setup.py test
python -m pytest
Once this is done you should be able to call MiSTree from python:
import mistree as mist
Constructing the MST of an input data set:
- 2D, 3D, tomographic or spherical polar coordinates.
- Apply scale cuts.
Analysis routines for the MST:
- Measures the degree, edge length, branch length and branch shape of the constructed MST.
Constructs random walk distribution with :
- Lévy flight.
- Adjusted Lévy flight.
- User defined random walk distribution.
- In 2D/3D and with/without periodic boundary conditions.
- Added binning (
HistMST) and plotting (
PlotHistMST) classes for handling the MST statistics.