Diffsky Code Demos

For a pedagogical introduction to the differentiable / probabilistic methods used in Diffsky (soft histograms, PDF-weighted histograms, etc.), see the Background on differentiable methods section.

Reading and analyzing Diffsky mocks

Diffsky generates mock galaxy catalogs by populating simulated cosmological lightcones of halos with synthetic galaxies. The tutorials below show how to load Diffsky mock data using OpenCosmo (recommended), or alternatively using the flat hdf5 files natively produced by Diffsky.

Generating synthetic lightcones

Diffsky includes code to generate galaxy samples by populating synthetic lightcones of dark matter halos, an alternative to using halos in an N-body simulation. The tutorials in this section demonstrate how to make cosmological populations of Diffsky galaxies using synthetic halo lightcones generated by Diffhalos.

There are two kinds of lightcone generators. First, in the Monte Carlo approach, the generator will supply a Monte Carlo realization of a complete sample of dark matter halos down to some lower mass limit. Calculating SEDs and photometry for very large cosmological populations can be computationally expensive, and/or memory intensive. To deal with this challenge using the Monte Carlo approach, the halo/galaxy sampling can be done in smaller batches, concatenating results at the end. The alternative is to use the weighted lightcone approach, in which halos are distributed in a uniform grid across mass and redshift, and a weight is attached to each grid point specifying the number density of the halo. The weighted lightcone generator can be (much) more computationally efficient than a straight Monte Carlo realization, particularly when generating populations with small values of the halo mass resolution. There is a tutorial for each form of generator below.