Examples
The repository contains a number of examples under examples. Each of these illustrates
a different feature of SLUG. Examples that are intended to be run from the command line
contain a README.md file that describes the test and how to run it, while examples
that are intended to be run from Python provide a .py file that is a
marimo notebook, which contains documentation and comments
explaining the example.
The examples currently available are:
examples/cloudy: demonstrates how to perform cloudy post-processing (see Cloudy Nebular Processing) on SLUG outputsexamples/cluster_slug: demonstrates Bayesian inference of star cluster properties withcluster_slug(see cluster_slug: Inference for Star Clusters), inferring the masses and ages of 50 star clusters in NGC 628 from their HST photometry in the LEGUS cluster catalog of Adamo et al. (2017, ApJ, 841, 131). It illustrates setting a prior, checking the library’s coverage of the observations with nearest neighbors, computing marginal percentiles, and plotting a cluster’s full posterior withconditional_sample. The notebook requires the defaultcluster_sluglibrary, which must be downloaded separately (see The Default cluster_slug Library).examples/clusterlib: demonstrates using the command line to carry out a large Monte Carlo simulation of star clusters, a simplified version of the library used in Tang, Grasha, & Krumholz (2024, MNRAS, 532, 4583)examples/QHIFUVstats: demonstrates how to use SLUG to study the statistics of the ratio of ionizing photons to FUV luminosity, a simplified version of the calculation in da Silva, Fumagalli, & Krumholz (2014, MNRAS, 444, 3275)examples/QHIstats: demonstrates how to use SLUG to study the distribution of ionizing luminosity per unit mass for star clusters of different masses; a simplified version of the calculation in the appendix of Kim, Kim, & Ostriker (2016, ApJ, 819, 137)examples/yieldslib: demonstrates nucleosynthetic yield output (see Yields) from a small galaxy-type simulation using MIST tracks and blackbody spectra, with yields from both theccsnandmassive_star_windschannels of thesukhbold16yield model, reported separately for each channel. The directory also contains a pre-computed output file,yieldslib.h5, which is useful for testing software that reads yield output.