pynbody.sph.render_spherical_image#
- pynbody.sph.render_spherical_image(snap, quantity='rho', nside=None, kernel=None, denoise=None, out_units=None, threaded=None, weight=None, distance=None, qty=None)[source]#
Render an SPH image onto the sky around the origin, in healpix format with the specified nside.
By default the image is projected onto the sky, i.e. integrated along the line of sight. For example, if rendering density, the results are then in units of mass per solid angle.
Alternatively, if
distanceis provided, a thin spherical shell is sampled at that radius using the full 3D kernel. The result then carries volumetric units (e.g. a density, if rendering density) rather than a per-solid-angle column.Weighted projections are supported, e.g. one may look at the projected temperature, weighted by density, by passing ‘temp’ as the qty and ‘rho’ as the weight.
Changed in version 2.5.0: The parameter distance has been added. If provided, the quantity is sampled on a thin spherical shell at this radius (in position units).
- Parameters:
snap (snapshot.simsnap.SimSnap) – The snapshot to render
quantity (str | np.ndarray) – The name of the array within the simulation to render, or an actual array. Default ‘rho’
weight (str, bool, optional) – The name of the array within the simulation to use as a weight for averaging down the line of sight; or True to use volume weighting.
nside (int) – The healpix nside resolution to use (must be power of 2)
distance (float, str, units.UnitBase, optional) – If provided, render a thin spherical shell at this radius (in position units) using the full 3D kernel, instead of the default line-of-sight projection. The result then carries volumetric units.
kernel (str, kernels.KernelBase, optional) – The Kernel object to use (defaults to 3D spline kernel)
denoise (bool, optional) – if True, divide through by an estimate of the discreteness noise. The returned image is then not strictly an SPH estimate, but this option can be useful to reduce noise.
out_units (str, optional) – The units to convert the output image into
threaded (bool, optional) – Whether to render the image across multiple threads. Yes if true; no if false. The number of threads to be used is determined by the configuration file. If None, the use of threading is also determined by the configuration file.
qty (str, optional) – Deprecated - use ‘quantity’ instead