From 531084dbc189431e5be2a5b6402c6054b331d85b Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Fri, 5 Jan 2018 19:55:34 +0100 Subject: [PATCH] Add doc --- python/cosmotool/smooth.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/python/cosmotool/smooth.py b/python/cosmotool/smooth.py index a377ed6..a9a12f3 100644 --- a/python/cosmotool/smooth.py +++ b/python/cosmotool/smooth.py @@ -14,6 +14,7 @@ def smooth_particle_density( resolution=128,i center=None, tmpprefix=None ): """Use adaptive smoothing to produce density and momentum fields. + The algorithm is originally described in [1]. Parameters: position : numpy array NxQ @@ -36,6 +37,24 @@ def smooth_particle_density( prefix of the temporary directory that will be used. It needs to have a lot of space available. By default '/tmp/ will be typically used. + + + Returns + ------- + dictionnary + The dict has two entries: 'rho' for the density, and 'p' for the momenta. + Once the dictionary is garbage collected all temporary files and directories + will be cleared automatically. + + + Raises + ------ + ValueError + if arguments are invalid + + + .. [1] S. Colombi, M. Chodorowski, + "Cosmic velocity-gravity in redshift space", MNRAS, 2007, 375, 1 """ if len(position.shape) != 2: raise ValueError("Invalid position array shape")