API Documentation
Implements a matplotlib plot consisting of multiple panels, with a timelapse from left to right and stacking the different maps atop one another.
- starforge_tools.plots.multipanel.multipanel_timelapse_map(output_dir='.', maps=('SurfaceDensity', 'VelocityDispersion', 'MassWeightedTemperature', 'MagneticEnergyFraction'), times=4, res=1024, box_frac=0.24, colorbar_frac=0.05, figsize=(8, 8), plot_stars=True, SFE_in_title=True, relative_times=True, cmap_limits={}, slice_thickness=None, supersample=1, cache_dir='.maps_cache')
Make a multi-panel map where rows plot a certain kind of coloarmap plot with colorbar, and each column is a certain simulation time.
- Parameters:
output_dir (string, optional) – Directory path where the simulation snapshots are
maps (iterable, optional) –
Iterable of which maps to plot in each row. Defaults to plotting surface density, velocity dispersion, temperature, and magnetic energy fraction.
Each entry must be an object defined in starforge_tools.plots.rendermaps with attributes plotlabel, required_datafields, colormap, render, and cmap_default_limits. See e.g. starforge_tools.plots.rendermaps.SurfaceDensity
times (optional) – Either an integer number of evenly-spaced simulation times for each column, or an array_like of simulation times in whatever units the snapshots are in, or as an astropy quantity. If the exact simulation times are not available, selects the closest possible time. (default: 4)
res (int, optional) – Resolution of the maps (default: 1024)
box_frac (float or array_like, optional) – Fraction of the total box size that the maps will plot
colorbar_frac (float, optional) – Width of the colorbar relative to panel size (default: 0.1)
figsize (tuple, optional) – Size of figure in inches (default: (8,8))
plot_stars (boolean, optional) – Whether to plot star markers (default: True)
SFE_in_title (boolean, optional) – Whether to plot SFE in the column titles in addition to the time (default: True)
relative_times (boolean, optional) – Whether specified times are relative to that of the first snapshot (default: True)
limits (dict, optional) – Dictionary wholes keys are the names of rendermaps and whose entries are shape (2,) tuples specifying the upper and lower limits of the colormap, overriding the default.
slice_thickness (float, optional) – If set, restrict all particle data to |line-of-sight coord| < slice_thickness/2 before rendering, so that each panel shows a thin slab through the projection axis (pdata index 2) instead of the full box. Units are the snapshot’s native length (pc for STARFORGE). Applies to gas and stars alike. (default: None)
supersample (int, optional) – Render each map at supersample*res internally, then block-average down to res for display. Provides anti-aliasing at the cost of supersample**2 more compute and memory per panel. (default: 1)
cache_dir (str or None, optional) – Directory for caching the post-downsample (res, res) rendered map arrays as .npy files. Cache keys include the snapshot path, map name, res, supersample, box_frac, and slice_thickness, so any of those changing produces a fresh render. Entries older than the snapshot’s mtime are ignored. Pass None to disable caching. (default: “.maps_cache”)
Microphysics routines