py21cmfast.AstroParams¶
- class py21cmfast.AstroParams¶
Bases:
InputStructAstrophysical parameters.
NB: All Mean scaling relations are defined in log-space, such that the lines they produce give exp(<log(property)>), this means that increasing the lognormal scatter in these relations will increase the <property> but not <log(property)>
- Parameters:
INHOMO_RECO (bool, optional) – Whether inhomogeneous recombinations are being calculated. This is not a part of the astro parameters structure, but is required by this class to set some default behaviour.
HII_EFF_FACTOR (float, optional) – The ionizing efficiency of high-z galaxies (zeta, from Eq. 2 of Greig+2015). Higher values tend to speed up reionization.
F_STAR10 (float, optional) – The fraction of galactic gas in stars for 10^10 solar mass haloes. Only used in the “new” parameterization, This is used along with F_ESC10 to determine HII_EFF_FACTOR (which is then unused). See Eq. 11 of Greig+2018 and Sec 2.1 of Park+2018. Given in log10 units.
F_STAR7_MINI (float, optional) – The fraction of galactic gas in stars for 10^7 solar mass minihaloes. Only used in the “minihalo” parameterization, i.e. when USE_MINI_HALOS is set to True (in
AstroOptions). If so, this is used along with F_ESC7_MINI to determine HII_EFF_FACTOR_MINI (which is then unused). See Eq. 8 of Qin+2020. If the MCG scaling relations are not provided explicitly, we extend the ACG ones by default. Given in log10 units.ALPHA_STAR (float, optional) – Power-law index of fraction of galactic gas in stars as a function of halo mass. See Sec 2.1 of Park+2018.
ALPHA_STAR_MINI (float, optional) – Power-law index of fraction of galactic gas in stars as a function of halo mass, for MCGs. See Sec 2 of Muñoz+21 (2110.13919). If the MCG scaling relations are not provided explicitly, we extend the ACG ones by default.
SIGMA_STAR (float, optional) – Lognormal scatter (dex) of the halo mass to stellar mass relation. Uniform across all masses and redshifts.
SIGMA_SFR_LIM (float, optional) – Lognormal scatter (dex) of the stellar mass to SFR relation above a stellar mass of 1e10 solar.
SIGMA_SFR_INDEX (float, optional) – index of the power-law between SFMS scatter and stellar mass below 1e10 solar.
F_ESC10 (float, optional) – The “escape fraction”, i.e. the fraction of ionizing photons escaping into the IGM, for 10^10 solar mass haloes. Only used in the “new” parameterization. This is used along with F_STAR10 to determine HII_EFF_FACTOR (which is then unused). See Eq. 11 of Greig+2018 and Sec 2.1 of Park+2018.
F_ESC7_MINI (float, optional) – The “escape fraction for minihalos”, i.e. the fraction of ionizing photons escaping into the IGM, for 10^7 solar mass minihaloes. Only used in the “minihalo” parameterization, i.e. when USE_MINI_HALOS is set to True (in
AstroOptions). If so, this is used along with F_ESC7_MINI to determine HII_EFF_FACTOR_MINI (which is then unused). See Eq. 17 of Qin+2020. If the MCG scaling relations are not provided explicitly, we extend the ACG ones by default. Given in log10 units.ALPHA_ESC (float, optional) – Power-law index of escape fraction as a function of halo mass. See Sec 2.1 of Park+2018.
M_TURN (float, optional) – Turnover mass (in log10 solar mass units) for quenching of star formation in halos, due to SNe or photo-heating feedback, or inefficient gas accretion. See Sec 2.1 of Park+2018.
R_BUBBLE_MAX (float, optional) – Mean free path in Mpc of ionizing photons within ionizing regions (Sec. 2.1.2 of Greig+2015). Default is 50 if INHOMO_RECO is True, or 15.0 if not.
ION_Tvir_MIN (float, optional) – Minimum virial temperature of star-forming haloes (Sec 2.1.3 of Greig+2015). Given in log10 units.
L_X (float, optional) – The specific X-ray luminosity per unit star formation escaping host galaxies. Cf. Eq. 6 of Greig+2018. Given in log10 units. For the double power-law used in the Halo Model This gives the low-z limite.
L_X_MINI (float, optional) – The specific X-ray luminosity per unit star formation escaping host galaxies for minihalos. Cf. Eq. 23 of Qin+2020. Given in log10 units. For the double power-law used in the Halo Model. This gives the low-z limite. If the MCG scaling relations are not provided explicitly, we extend the ACG ones by default.
NU_X_THRESH (float, optional) – X-ray energy threshold for self-absorption by host galaxies (in eV). Also called E_0 (cf. Sec 4.1 of Greig+2018). Typical range is (100, 1500).
X_RAY_SPEC_INDEX (float, optional) – X-ray spectral energy index (cf. Sec 4.1 of Greig+2018). Typical range is (-1, 3).
X_RAY_Tvir_MIN (float, optional) – Minimum halo virial temperature in which X-rays are produced. Given in log10 units. Default is ION_Tvir_MIN.
F_H2_SHIELD (float, optional) – Self-shielding factor of molecular hydrogen when experiencing LW suppression. Cf. Eq. 12 of Qin+2020. Consistently included in A_LW fit from sims. If used we recommend going back to Macachek+01 A_LW=22.86.
t_STAR (float, optional) – Fractional characteristic time-scale (fraction of hubble time) defining the star-formation rate of galaxies. See Sec 2.1, Eq. 3 of Park+2018.
A_LW, BETA_LW (float, optional) – Impact of the LW feedback on Mturn for minihaloes. Default is 22.8685 and 0.47 following Machacek+01, respectively. Latest simulations suggest 2.0 and 0.6. See Sec 2 of Muñoz+21 (2110.13919).
A_VCB, BETA_VCB (float, optional) – Impact of the DM-baryon relative velocities on Mturn for minihaloes. Default is 1.0 and 1.8, and agrees between different sims. See Sec 2 of Muñoz+21 (2110.13919).
UPPER_STELLAR_TURNOVER_MASS – The pivot mass associated with the optional upper mass power-law of the stellar-halo mass relation (see AstroOptions.USE_UPPER_STELLAR_TURNOVER)
UPPER_STELLAR_TURNOVER_INDEX – The power-law index associated with the optional upper mass power-law of the stellar-halo mass relation (see AstroOptions.USE_UPPER_STELLAR_TURNOVER)
SIGMA_LX (float, optional) – Lognormal scatter (dex) of the Xray luminosity relation (a function of stellar mass, star formation rate and redshift). This scatter is uniform across all halo properties and redshifts.
FIXED_VAVG (float, optional) – The fixed value of the average velocity used when AstroOptions.FIX_VCB_AVG is set to True.
POP2_ION (float, optional) – Number of ionizing photons per baryon produced by Pop II stars.
POP3_ION (float, optional) – Number of ionizing photons per baryon produced by Pop III stars.
CLUMPING_FACTOR (float, optional) – Clumping factor of the IGM used ONLY in the x-ray partial ionisations (not the reionsiation model). Default is 2.0.
ALPHA_UVB (float, optional) – The power-law index of the UVB spectrum. Used for Gamma12 in the recombination model
DELTA_R_HII_FACTOR (float, optional) – The factor by which to decrease the size of the HII filter when calculating the HII regions.
R_BUBBLE_MIN (float, optional) – Minimum size of ionized regions in Mpc. Default is 0.620350491.
MAX_DVDR (float, optional) – Maximum value of the gradient of the velocity field used in the RSD algorithm.
NU_X_BAND_MAX (float, optional) – The maximum frequency of the X-ray band used to calculate the X-ray Luminosity.
NU_X_MAX (float, optional) – The maximum frequency of the integrals over nu for the x-ray heating/ionisation rates.
- classmethod __init_subclass__()¶
Store each subclass for easy access.
- Return type:
None
- __str__()¶
Human-readable string representation of the object.
- Return type:
str
- asdict()¶
Return a dict representation of the instance.
Examples
This dict should be such that doing the following should work, i.e. it can be used exactly to construct a new instance of the same object:
>>> inp = InputStruct(**params) >>> newinp =InputStruct(**inp.asdict()) >>> inp == newinp
- Return type:
dict
- clone(**kwargs)¶
Make a fresh copy of the instance with arbitrary parameters updated.
- classmethod from_subdict(dct, safe=True)¶
Construct an instance of a parameter structure from a dictionary.
- classmethod new(x=None, **kwargs)¶
Create a new instance of the struct.
- Parameters:
x (dict | InputStruct | None) – Initial values for the struct. If x is a dictionary, it should map field names to their corresponding values. If x is an instance of this class, its attributes will be used as initial values. If x is None, the struct will be initialised with default values.
- Other Parameters:
All other parameters should be passed as if directly to the class constructor
(i.e. as parameter names).
- Parameters:
x (dict | Self | None)
Examples
>>> up = SimulationOptions({'HII_DIM': 250}) >>> up.HII_DIM 250 >>> up = SimulationOptions(up) >>> up.HII_DIM 250 >>> up = SimulationOptions() >>> up.HII_DIM 200 >>> up = SimulationOptions(HII_DIM=256) >>> up.HII_DIM 256
- ALPHA_ESC: float¶
- ALPHA_STAR: float¶
- ALPHA_STAR_MINI: float¶
- ALPHA_UVB: float¶
- A_LW: float¶
- A_VCB: float¶
- BETA_LW: float¶
- BETA_VCB: float¶
- CLUMPING_FACTOR: float¶
- DELTA_R_HII_FACTOR: float¶
- FIXED_VAVG: float¶
- F_ESC10: float¶
- F_ESC7_MINI: float¶
- F_H2_SHIELD: float¶
- F_STAR10: float¶
- F_STAR7_MINI: float¶
- HII_EFF_FACTOR: float¶
- ION_Tvir_MIN: float¶
- L_X: float¶
- L_X_MINI: float¶
- MAX_DVDR: float¶
- M_TURN: float¶
- NU_X_BAND_MAX: float¶
- NU_X_MAX: float¶
- NU_X_THRESH: float¶
- N_STEP_TS: float¶
- PHOTONCONS_CALIBRATION_END: float¶
- POP2_ION: float¶
- POP3_ION: float¶
- R_BUBBLE_MAX: float¶
- R_BUBBLE_MIN: float¶
- R_MAX_TS: float¶
- SIGMA_LX: float¶
- SIGMA_SFR_INDEX: float¶
- SIGMA_SFR_LIM: float¶
- SIGMA_STAR: float¶
- T_RE: float¶
- UPPER_STELLAR_TURNOVER_INDEX: float¶
- UPPER_STELLAR_TURNOVER_MASS: float¶
- X_RAY_SPEC_INDEX: float¶
- X_RAY_Tvir_MIN: float¶
- property cdict: dict¶
A python dictionary containing the properties of the wrapped C-struct.
The memory pointed to by this dictionary is not owned by the wrapped C-struct, but is rather just a python dict. However, in contrast to
asdict(), this method transforms the properties to what they should be in C (e.g. linear space vs. log-space) before putting them into the dict.This dict also contains only the properties of the wrapped C-struct, rather than all properties of the
InputStructinstance (some attributes of the python instance are there only to guide setting of defaults, and don’t appear in the C-struct at all).- Return type:
dict
- property cstruct: py21cmfast.wrapper.structs.StructWrapper¶
The object pointing to the memory accessed by C-code for this struct.
- Return type:
- property struct: py21cmfast.wrapper.structs.StructWrapper¶
The python-wrapped struct associated with this input object.
- Return type:
- t_STAR: float¶