py21cmfast.drivers.lightcone¶
Module containing a driver function for creating lightcones.
Attributes¶
Classes¶
An angular lightcone. |
|
A full Lightcone with all associated evolved data. |
Functions¶
|
Create a generator function for a lightcone run. |
|
Run a lightcone simulation and return the final lightcone object. |
|
Return a LightCone instance given a lightconer as input. |
Module Contents¶
- py21cmfast.drivers.lightcone.generate_lightcone(*, lightconer, inputs, initial_conditions=None, include_dvdr_in_tau21=True, apply_rsds=False, n_rsd_subcells=4, cleanup=True, write=_cache, cache=_ocache, regenerate=True, progressbar=False, lightcone_filename=None)[source]¶
Create a generator function for a lightcone run.
This is generally the easiest and most efficient way to generate a lightcone, though it can be done manually by using the lower-level functions which are called by this function.
- Parameters:
lightconer (
Lightconer) – This object specifies the dimensions, redshifts, and quantities required by the lightcone runinputs (
InputParameters) – This object specifies the input parameters for the run, including the random seedinitial_conditions (
InitialConditions, optional) – If given, the user and cosmo params will be set from this object, and it will not be re-calculated.include_dvdr_in_tau21 (bool, optional) – If True, velocity gradient corrections to the 21cm optical depth will be applied. See Mao+ 2012. Default is True.
apply_rsds (bool, optional) – If True, all output lightcones will be transformed from real space to redshift space, according to the peculiar velocity fields. See Mao+ 2012. Default is False.
n_rsd_subcells (int, optional) – The number of subcells into which each cell is divided when redshift space distortions are applied. Becomes relevant only if apply_rsds is True. Default is False.
cleanup (bool, optional) – A flag to specify whether the C routine cleans up its memory before returning. Typically, if spin_temperature is called directly, you will want this to be true, as if the next box to be calculate has different shape, errors will occur if memory is not cleaned. Note that internally, this is set to False until the last iteration.
progressbar (bool, optional) – If True, a progress bar will be displayed throughout the simulation. Defaults to False.
lightcone_filename – The filename to which to save the lightcone. The lightcone is returned in memory, and can be saved manually later, but including this filename will save the lightcone on each iteration, which can be helpful for checkpointing.
- Returns:
lightcone (
LightCone) – The lightcone object.coeval_callback_output (list) – Only if coeval_callback in not None.
- Other Parameters:
regenerate, write, direc, hooks – See docs of
initial_conditions()for more information.- Parameters:
lightconer (py21cmfast.lightconers.Lightconer)
initial_conditions (py21cmfast.wrapper.outputs.InitialConditions | None)
include_dvdr_in_tau21 (bool)
apply_rsds (bool)
n_rsd_subcells (int)
cleanup (bool)
cache (py21cmfast.io.caching.OutputCache | None)
regenerate (bool)
progressbar (bool)
lightcone_filename (str | pathlib.Path | None)
- py21cmfast.drivers.lightcone.run_lightcone(**kwargs)[source]¶
Run a lightcone simulation and return the final lightcone object.
This simply wraps
generate_lightcone()and returns the final lightcone object after the generator has been exhausted. All parameters are passed directly togenerate_lightcone().- Return type:
- py21cmfast.drivers.lightcone.setup_lightcone_instance(lightconer, scrollz, inputs, include_dvdr_in_tau21, apply_rsds, photon_nonconservation_data, lightcone_filename=None)[source]¶
Return a LightCone instance given a lightconer as input.
- Parameters:
lightconer (py21cmfast.lightconers.Lightconer)
scrollz (collections.abc.Sequence[float])
include_dvdr_in_tau21 (bool)
apply_rsds (bool)
photon_nonconservation_data (dict)
lightcone_filename (pathlib.Path | None)
- Return type: