The Cookbook¶
Here, we provide a set of recipes detailing a broad selection of the functionality available in nbodykit. Ranging from simple tasks to more complex work flows, we hope that these recipes help users become acclimated with nbodykit as well as illustrate the power of nbodykit for large-scale structure data analysis.
For users who wish to dive right into the examples, an interactive environment containing the cookbook recipes is available to users via the BinderHub service. Just click the launch button below to get started!
The (static) recipes below are provided as Jupyter notebooks and are available for download by clicking the “Source” link in the navigation bar at the top of the page.
Data Recipes¶
- Demonstrates how to use the
LogNormalCatalog
class, which Poisson samples a log-normal density field and applies the Zel’dovich approximation. - Demonstrates how to use the
HODCatalog
, which uses thehalotools
package to populate a halo catalog with objects.
Painting Recipes¶
- Demonstrates how to create a mesh object from a catalog and paint the overdensity field to the mesh.
- Demonstrates how to paint mass-weighted quantities (in this case, the line-of-sight momentum field) to a mesh.
- Demonstrates how to paint the combined overdensity field from different types of particles to the same mesh.
Algorithm Recipes¶
- Demonstrates how to use
FFTPower
to compute the power spectrum of objects in a simulation box. - Demonstrates the use and effects of the interlacing technique when painting density fields to a mesh.
- Demonstrates the different interpolation windows available to use when painting and their accuracy.
- Demonstrates how to use
ConvolvedFFTPower
to compute the power spectrum multipoles of observational data. - Computes the power spectrum multipoles of the DR12 BOSS LOWZ galaxy sample.
- Demonstrates how to use
AngularPairCount
to compute the angular correlation function.
Contributing¶
If you have an application of nbodykit that is concise and interesting, please consider adding it to our cookbook. We also welcome feedback and improvements for these recipes. Users can submit issues or open a pull request on the nbodykit cookbook repo on GitHub.
Cookbook recipes should be in the form of Jupyter notebooks. See the existing recipes for examples. The recipes are designed to illustrate interesting uses of nbodykit for other users to learn from.
We appreciate any and all contributions!