{ "cells": [ { "cell_type": "markdown", "id": "45059532", "metadata": {}, "source": [ "# Quickstart\n", "\n", "This quickstart guide gives an overview of the core features of Diffhalos,\n", "and demonstrates how to use the primary functions of the library.\n", "\n", "The cell below shows how to generate a lightcone of halos and subhalos, and their mass assembly histories." ] }, { "cell_type": "code", "execution_count": null, "id": "4581335b-aaaa-4d62-8292-60e4a76945bd", "metadata": {}, "outputs": [], "source": [ "from diffhalos import weighted_lc\n", "\n", "from jax import random as jran\n", "ran_key = jran.key(0)\n", "\n", "n_host_halos = 200\n", "z_min, z_max = 0.4, 2.5\n", "lgmp_min, lgmp_max = 10.5, 15.5\n", "sky_area_degsq = 500.0\n", "\n", "args = (ran_key, n_host_halos, z_min, z_max, lgmp_min, lgmp_max, sky_area_degsq)\n", "halopop = weighted_lc(*args)\n", "print(halopop._fields)" ] }, { "cell_type": "markdown", "id": "d24ad2fe-b244-4c8b-8ec6-bbc198c5760d", "metadata": {}, "source": [ "### mass-function weighting\n", "\n", "Every halo and subhalo in the returned lightcone has a _weight_ that encodes the multiplicity of the halo. For any input choice of the number of returned halos, the weights are determined according to the halo and subhalo mass functions..." ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.13.11" } }, "nbformat": 4, "nbformat_minor": 5 }