pynbody.sph.render_spherical_image

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, qty=None)[source]#

Render an SPH image projected onto the sky around the origin.

At present, only projection is supported (i.e., there is no implementation for rendering on a spherical shell). For example, if rendering density, the results are in units of mass per solid angle. The image is returned in healpix format, with the specified nside.

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.

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)

  • 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