Skip to the content.

Tutorials

The tutorials below should give you a rough idea of what is Py-SPHViewer capable to do:

If you prefer to get started with Py-SPHViewer and come back to the tutorials later, please continue reading below:

Getting started

Getting started with Py-SPHViewer is easy. We show below a minimal example on how to obtain the projected density field of the distribution of dark matter particles in a cosmological simulation. After this example you should check the tutorials, which are useful to get started and understanding how Py-SPHViewer works.

The example below uses this hdf5 file, so please download it before running the code below:

import h5py
from sphviewer.tools import QuickView

with h5py.File('darkmatter_box.h5py','r') as f:
    pdrk = f['PartType1/Coordinates'].value

QuickView(pdrk, r='infinity')

which produces the following image:

First image with QuickView

High-resolution cosmological simulations might result in more impressive results, such us the one shown in the next video: