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:
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:snia:salt[default],twin, or anysncosmoSALT source name (seeget_snia_pointsource).kilonova:bulla23[default],bulla19(seeget_kilonova_pointsource).calspec: any HST CalSpec star name (e.g.bd_17,gd71,p177d). No default (seeget_calspec_pointsource).blackbody: temperature in K (e.g."blackbody-6000","blackbody-10000"), seeget_blackbody_flux.powerlaw: power-law indexalphaof F_lambda (e.g."powerlaw--2"for alpha=-2,"powerlaw-0.5"for alpha=0.5), seeget_powerlaw_flux.
Hence
"snia"is equivalent to"snia-salt"and"kilonova"to"kilonova-bulla23". Alternatively,sourcecan be a(lbda, flux)tuple (or list) defining a tabulated spectrum, withlbdain Angstrom (seefrom_spectrum). If None, the scene has no point source: it is a galaxy alone, given byhost(e.g.Galaxy).background (
strordict, optional) – The background configuration (seefrom_config)."zodi"is a shortcut for the Aldering (2001) zodiacal light model ("Aldering01.BB5800", scaled by 2). Default is"zodi".host (
str,dictorNone, optional) – The host galaxy, as a model name"spatial:spectral"(e.g."ngc0628"or"sersic:bb-5000", seeparse_modelname) or a configuration dict (model name as"refmodel"). Missing entries take the defaults ofget_host_config, and the host takes the redshift of the point source. An empty dict or None means no host. Ifsourceis None, the host entries are completed bykwargs, 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 asx1andcfor SALT,thetaandmagabsfor kilonovae,magandbandfor blackbody, power-law or CalSpec sources). Ifsourceis 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
sourceis 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')