get_scene

Contents

get_scene#

get_scene(source, background='zodi', host={}, **kwargs)[source]#

Get a scene configuration.

This function generates a dictionary that defines a scene containing a point source, a background, and a host galaxy. The scene can then be used to generate a simulation.

Parameters:
  • source (str, tuple or None) –

    The kind of point source, optionally followed by the model to use, separated by “-” ("{kind}-{model}"). For instance, "snia-salt" means a SN Ia modeled with SALT, "kilonova-bulla19" a kilonova modeled with the Bulla (2019) POSSIS model. Available kinds and models are:

    Hence "snia" is equivalent to "snia-salt" and "kilonova" to "kilonova-bulla23". Alternatively, source can be a (lbda, flux) tuple (or list) defining a tabulated spectrum, with lbda in Angstrom (see from_spectrum). If None, the scene has no point source: it is a galaxy alone, given by host (e.g. Galaxy).

  • background (str or dict, optional) – The background configuration (see from_config). "zodi" is a shortcut for the Aldering (2001) zodiacal light model ("Aldering01.BB5800", scaled by 2). Default is "zodi".

  • host (str, dict or None, optional) – The host galaxy, as a model name "spatial:spectral" (e.g. "ngc0628" or "sersic:bb-5000", see parse_modelname) or a configuration dict (model name as "refmodel"). Missing entries take the defaults of get_host_config, and the host takes the redshift of the point source. An empty dict or None means no host. If source is None, the host entries are completed by kwargs, and a host without model name is the default "sersic:bb-5000" galaxy. Default is an empty dict.

  • **kwargs – Additional parameters of the point source configuration (e.g. redshift, phase, position, or model specific parameters such as x1 and c for SALT, theta and magabs for kilonovae, mag and band for blackbody, power-law or CalSpec sources). If source is None, they are galaxy (host) parameters instead (e.g. redshift, magabs, position, r_kpc).

Returns:

dict – A dictionary {"scene": {"pointsource": ..., "background": ..., "host": ...}} defining the scene.

Raises:

NotImplementedError – If source is a str of unknown kind, or neither a str nor a (lbda, flux) tuple or list.

Examples

>>> scene = get_scene("kilonova-bulla23", redshift=0.05, theta=30)
>>> scene["scene"]["pointsource"]["source"]
'bulla23'

A supernova in NGC 0628, and a galaxy alone:

>>> scene = get_scene("snia", redshift=0.9, host="ngc0628")
>>> scene["scene"]["host"]
'ngc0628'
>>> scene = get_scene(None, host="sersic:bb-6000", redshift=0.5, r_kpc=3)
>>> scene["scene"]["pointsource"] is None, scene["scene"]["host"]["refmodel"]
(True, 'sersic:bb-6000')