py21cmfast.drivers.Coeval

class py21cmfast.drivers.Coeval

A full coeval box with all associated data.

__eq__(other)

Determine if this is equal to another object.

__getattr__(name)

Get underlying Array objects as attributes.

This method allows accessing arrays from OutputStruct objects within the Coeval instance as if they were direct attributes of the Coeval object.

Parameters:

name (str) – The name of the attribute being accessed.

Returns:

Any – The value of the requested array from the appropriate OutputStruct object.

Raises:

AttributeError – If the requested attribute is not found in any of the OutputStruct objects.

apply_rsds(field='brightness_temp', axis='z', periodic=True, n_rsd_subcells=4)

Apply redshift-space distortions to a particular field of the coeval box.

Parameters:
  • field (str, optional) – The field onto which redshift-space distortions shall be applied. Default is “brightness_temp”.

  • axis (str, optioanl) – The assumed axis of the line-of-sight. Options are “x”, “y”, or “z”. Default is “z”.

  • periodic (bool, optioanl) – Whether to assume periodic boundary conditions along the line-of-sight. Default is True.

  • n_rsd_subcells (int, optional) – The number of subcells into which each cell is divided when redshift space distortions are applied. Default is 4.

Returns:

field_with_rsds – A box of the field, with redshift space distortions.

Parameters:
  • field (str)

  • axis (str)

  • periodic (bool)

  • n_rsd_subcells (int)

apply_velocity_corrections(axis='z', periodic=True, n_rsd_subcells=4)

Apply velocity gradient corrections and redshift-space distortions to the brightness temperature field.

Parameters:
  • axis (str, optioanl) – The assumed axis of the line-of-sight. Options are “x”, “y”, or “z”. Default is “z”.

  • periodic (bool, optioanl) – Whether to assume periodic boundary conditions along the line-of-sight. Default is True.

  • n_rsd_subcells (int, optional) – The number of subcells into which each cell is divided when redshift space distortions are applied. Default is 4.

Returns:

field_with_rsds – A box of the brightness temperature, with velocity gradient corrections and redshift-space distortions.

Parameters:
  • axis (str)

  • periodic (bool)

  • n_rsd_subcells (int)

classmethod from_file(path, safe=True)

Read the Coeval object from disk and return it.

Parameters:
  • path (str | pathlib.Path)

  • safe (bool)

Return type:

Self

classmethod get_fields(ignore_structs=())

Obtain a list of name of simulation boxes saved in the Coeval object.

Parameters:

ignore_structs (tuple[str])

Return type:

list[str]

include_dvdr_in_tau21(axis='z', periodic=True)

Include velocity gradient corrections to the brightness temperature field.

Parameters:
  • axis (str, optioanl) – The assumed axis of the line-of-sight. Options are “x”, “y”, or “z”. Default is “z”.

  • periodic (bool, optioanl) – Whether to assume periodic boundary conditions along the line-of-sight. Default is True.

Returns:

tb_with_dvdr – A box of the brightness temperature, with velocity gradient corrections.

Parameters:
  • axis (str)

  • periodic (bool)

save(path, clobber=False)

Save the Coeval object to disk.

Parameters:

path (str | pathlib.Path)

property astro_options

Flag Options shared by all datasets.

property astro_params

Astro params shared by all datasets.

brightness_temperature: py21cmfast.wrapper.outputs.BrightnessTemp
property cosmo_params

Cosmo params shared by all datasets.

halobox: py21cmfast.wrapper.outputs.HaloBox
initial_conditions: py21cmfast.wrapper.outputs.InitialConditions
property inputs: py21cmfast.wrapper.inputs.InputParameters

An InputParameters object associated with the coeval box.

Return type:

py21cmfast.wrapper.inputs.InputParameters

ionized_box: py21cmfast.wrapper.outputs.IonizedBox
property matter_options

Matter Flags shared by all datasets.

property output_structs: dict[str, py21cmfast.wrapper.outputs.OutputStruct]

Get a dictionary of OutputStruct objects contained in this Coeval instance.

This property method returns a dictionary containing all the OutputStruct objects that are attributes of the Coeval instance. It filters out any non-OutputStruct attributes.

Returns:

dict[str, OutputStruct] – A dictionary where the keys are attribute names and the values are the corresponding OutputStruct objects.

Return type:

dict[str, py21cmfast.wrapper.outputs.OutputStruct]

perturbed_field: py21cmfast.wrapper.outputs.PerturbedField
photon_nonconservation_data: dict
property random_seed

Random seed shared by all datasets.

property redshift: float

The redshift of the coeval box.

Return type:

float

property simulation_options

Matter Params shared by all datasets.

ts_box: py21cmfast.wrapper.outputs.TsBox