py21cmfast.wrapper.inputs.SimulationOptions =========================================== .. py:class:: py21cmfast.wrapper.inputs.SimulationOptions Bases: :py:obj:`InputStruct` Structure containing broad simulation options. :Parameters: * **HII_DIM** (*int, optional*) -- Number of cells for the low-res box (after smoothing the high-resolution matter field). Default 256. * **HIRES_TO_LOWRES_FACTOR** (*float, optional*) -- The ratio of the high-resolution box dimensionality to the low-resolution box dimensionality (i.e. DIM/HII_DIM). Use this parameter to define the size as a fixed ratio, instead of specifying DIM explicitly. This is useful if the parameters will be later evolved, so that specifying a new HII_DIM keeps the fixed resolution. By default, this is None, and a default of DIM=3*HII_DIM is used. This should be at least 3, and generally an integer (though this is not enforced). * **DIM** (*int, optional*) -- Number of cells for the high-res box (sampling ICs) along a principal axis. In general, prefer setting HIRES_TO_LOWRES_FACTOR instead of DIM directly. Setting both will raise an error. * **LOWRES_CELL_SIZE_MPC** (*float, optional*) -- The cell size of the low-resolution boxes (i.e. after smoothing the high-resolution matter field). Use either this parameter or BOX_LEN, setting both will raise an error. This parameter is generally preferrable, as it allows you to evolve the HII_DIM later, and keep the same resolution (automatically scaling up BOX_LEN). Default is None, falling back on a cell size of 1.5 Mpc. * **BOX_LEN** (*float, optional*) -- Length of the box, in Mpc. Prefer setting LOWRES_CELL_SIZE_MPC, which automatically defines this setting. Specifying both will result in an error. By default, the BOX_LEN will be calculated as 1.5 * HII_DIM. * **NON_CUBIC_FACTOR** (*float, optional*) -- Factor which allows the creation of non-cubic boxes. It will shorten/lengthen the line of sight dimension of all boxes. NON_CUBIC_FACTOR * DIM/HII_DIM must result in an integer. * **N_THREADS** (*int, optional*) -- Sets the number of processors (threads) to be used for performing 21cmFAST. Default 1. * **SAMPLER_MIN_MASS** (*float, optional*) -- The minimum mass to sample in the halo sampler when SOURCE_MODEL is "CHMF-SAMPLER", decreasing this can drastically increase both compute time and memory usage. * **SAMPLER_BUFFER_FACTOR** (*float, optional*) -- The arrays for the halo sampler will have size of SAMPLER_BUFFER_FACTOR multiplied by the expected number of halos in the box. Ideally this should be close to unity but one may wish to increase it to test alternative scenarios * **N_COND_INTERP** (*int, optional*) -- The number of condition bins in the inverse CMF tables. * **N_PROB_INTERP** (*int, optional*) -- The number of probability bins in the inverse CMF tables. * **MIN_LOGPROB** (*float, optional*) -- The minimum log-probability of the inverse CMF tables. * **HALOMASS_CORRECTION** (*float, optional*) -- This provides a corrective factor to the mass-limited (SAMPLE_METHOD==0) sampling, which multiplies the expected mass from a condition by this number. The default value of 0.9 is calibrated to the mass-limited sampling on a timestep of ZPRIME_STEP_FACTOR=1.02. If ZPRIME_STEP_FACTOR is increased, this value should be set closer to 1. This factor is also used in the partition (SAMPLE_METHOD==2) sampler, dividing nu(M) of each sample drawn. * **PARKINSON_G0** (*float, optional*) -- Only used when SAMPLE_METHOD==3, sets the normalisation of the correction to the extended press-schecter used in Parkinson et al. 2008. * **PARKINSON_y1** (*float, optional*) -- Only used when SAMPLE_METHOD==3, sets the index of the sigma power-law term of the correction to the extended Press-Schechter mass function used in Parkinson et al. 2008. * **PARKINSON_y2** (*float, optional*) -- Only used when SAMPLE_METHOD==3, sets the index of the delta power-law term of the correction to the extended Press-Schechter mass function used in Parkinson et al. 2008. * **Z_HEAT_MAX** (*float, optional*) -- Maximum redshift used in the Tk and x_e evolution equations. Temperature and x_e are assumed to be homogeneous at higher redshifts. Lower values will increase performance. * **ZPRIME_STEP_FACTOR** (*float, optional*) -- Logarithmic redshift step-size used in the z' integral. Logarithmic dz. Decreasing (closer to unity) increases total simulation time for lightcones, and for Ts calculations. * **INITIAL_REDSHIFT** (*float, optional*) -- Initial redshift used to perturb field from * **DELTA_R_FACTOR** (*float, optional*) -- The factor by which to decrease the size of the filter in DexM when creating halo catalogues. * **DENSITY_SMOOTH_RADIUS** (*float, optional*) -- The radius of the smoothing kernel in Mpc. * **DEXM_OPTIMIZE_MINMASS** (*float, optional*) -- The minimum mass of a halo for which to use the DexM optimization if DEXM_OPTIMIZE is True. * **DEXM_R_OVERLAP** (*float, optional*) -- The factor by which to multiply the halo radius to determine the distance within which smaller halos are excluded. * **CORR_STAR** (*float, optional*) -- Self-correlation length used for updating halo properties. To model the correlation in the SHMR between timesteps, we sample from a conditional bivariate gaussian with correlation factor given by exp(-dz/CORR_STAR). This value is placed in SimulationOptions since it is used in the halo sampler, and not in the ionization routines. * **CORR_SFR** (*float, optional*) -- Self-correlation length used for updating star formation rate, see "CORR_STAR" for details. * **CORR_LX** (*float, optional*) -- Self-correlation length used for updating xray luminosity, see "CORR_STAR" for details. * **K_MAX_FOR_CLASS** (*float, optional*) -- Maximum wavenumber to run CLASS, in 1/Mpc. Becomes relevant only if matter_options.POWER_SPECTRUM = "CLASS". .. !! processed by numpydoc !! .. py:method:: __init_subclass__() :classmethod: Store each subclass for easy access. .. !! processed by numpydoc !! .. py:method:: __str__() Human-readable string representation of the object. .. !! processed by numpydoc !! .. py:method:: asdict() Return a dict representation of the instance. .. rubric:: 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 .. !! processed by numpydoc !! .. py:method:: clone(**kwargs) Make a fresh copy of the instance with arbitrary parameters updated. .. !! processed by numpydoc !! .. py:method:: from_subdict(dct, safe=True) :classmethod: Construct an instance of a parameter structure from a dictionary. .. !! processed by numpydoc !! .. py:method:: new(x = None, **kwargs) :classmethod: 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).** .. rubric:: 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 .. !! processed by numpydoc !! .. py:property:: BOX_LEN :type: float The size of the box along a side, in Mpc. If not given explicitly, it is auto-calculated via ``HII_DIM * LOWRES_CELL_SIZE_MPC``. .. !! processed by numpydoc !! .. py:attribute:: CORR_LX :type: float .. py:attribute:: CORR_SFR :type: float .. py:attribute:: CORR_STAR :type: float .. py:attribute:: DELTA_R_FACTOR :type: float .. py:attribute:: DENSITY_SMOOTH_RADIUS :type: float .. py:attribute:: DEXM_OPTIMIZE_MINMASS :type: float .. py:attribute:: DEXM_R_OVERLAP :type: float .. py:property:: DIM :type: int The number of cells on a side of the hi-res box used for ICs. If not given explicitly, it is auto-calculated via ``HII_DIM * HIRES_TO_LOWRES_FACTOR``. .. !! processed by numpydoc !! .. py:attribute:: HALOMASS_CORRECTION :type: float .. py:attribute:: HII_DIM :type: int .. py:property:: HII_tot_num_pixels Total number of pixels in the low-res box. .. !! processed by numpydoc !! .. py:property:: HIRES_TO_LOWRES_FACTOR :type: float The downsampling factor from high to low-res. .. !! processed by numpydoc !! .. py:attribute:: INITIAL_REDSHIFT :type: float .. py:attribute:: K_MAX_FOR_CLASS :type: float | None .. py:property:: LOWRES_CELL_SIZE_MPC :type: float The cell size (in Mpc) of the low-res grids. .. !! processed by numpydoc !! .. py:attribute:: MIN_LOGPROB :type: float .. py:attribute:: NON_CUBIC_FACTOR :type: float .. py:attribute:: N_COND_INTERP :type: int .. py:attribute:: N_PROB_INTERP :type: int .. py:attribute:: N_THREADS :type: int .. py:attribute:: PARKINSON_G0 :type: float .. py:attribute:: PARKINSON_y1 :type: float .. py:attribute:: PARKINSON_y2 :type: float .. py:attribute:: SAMPLER_BUFFER_FACTOR :type: float .. py:attribute:: SAMPLER_MIN_MASS :type: float .. py:attribute:: ZPRIME_STEP_FACTOR :type: float .. py:attribute:: Z_HEAT_MAX :type: float .. py:property:: cdict :type: 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 :meth:`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 :class:`InputStruct` instance (some attributes of the python instance are there only to guide setting of defaults, and don't appear in the C-struct at all). .. !! processed by numpydoc !! .. py:property:: cell_size :type: astropy.units.Quantity[astropy.units.Mpc] The resolution of a low-res cell. .. !! processed by numpydoc !! .. py:property:: cell_size_hires :type: astropy.units.Quantity[astropy.units.Mpc] The resolution of a hi-res cell. .. !! processed by numpydoc !! .. py:property:: cstruct :type: py21cmfast.wrapper.structs.StructWrapper The object pointing to the memory accessed by C-code for this struct. .. !! processed by numpydoc !! .. py:property:: struct :type: py21cmfast.wrapper.structs.StructWrapper The python-wrapped struct associated with this input object. .. !! processed by numpydoc !! .. py:property:: tot_fft_num_pixels Total number of pixels in the high-res box. .. !! processed by numpydoc !!