.. _physics-task: Tasks ===== Class providing general top-level tasks to be performed by Galacticus\---the primary unit of computation that the code executes when run. Each task implementation defines a self-contained operation, such as evolving a forest of merger trees to produce a galaxy catalogue, running a Bayesian parameter estimation, performing N-body analysis, or executing a radiative transfer calculation. The ``perform`` method carries out the task and optionally returns an exit status, while ``requiresOutputFile`` indicates whether HDF5 output should be opened beforehand. **Default implementation:** ``taskEvolveForests`` Methods ------- ``perform`` → ``void`` Perform the task. * ``integer, intent( out), optional :: status`` ``requiresOutputFile`` → ``logical`` Should return true if the task requires the main output file to be open. .. _physics-taskAGNSpectraHopkins2008BuildFile: ``taskAGNSpectraHopkins2008BuildFile`` -------------------------------------- A task which builds and caches a tabulation of AGN accretion disk spectra using the model of :cite:t:`hopkins_observational_2007`, computing the spectral energy distribution as a function of black hole mass and accretion rate for use in subsequent galaxy evolution calculations. .. _physics-taskBuildBroadbandLuminosityTabulations: ``taskBuildBroadbandLuminosityTabulations`` ------------------------------------------- A task which pre-builds and caches tabulations of stellar population broadband luminosities by evaluating the luminosity for a reference stellar population at solar metallicity. This pre-computation allows rapid lookup of broadband luminosities in photometric bands during galaxy evolution. .. _physics-taskBuildSEDTabulations: ``taskBuildSEDTabulations`` --------------------------- A task which pre-builds and caches tabulations of stellar spectral energy distributions (SEDs) by iterating over output times and computing SED properties for a representative galaxy node. This pre-computation avoids redundant calculations during full forest evolution, covering disk, spheroid, and nuclear star cluster components. .. _physics-taskBuildTableCIECloudy: ``taskBuildTableCIECloudy`` --------------------------- A task which builds collisional ionization equilibrium tables using Cloudy. **Parameters** * ``[fileNameCoolingFunction]`` (default ``inputPath(pathTypeDataDynamic)//'cooling/cooling_function_Atomic_CIE_Cloudy.hdf5'``) — The file name to which the cooling function table should be stored. * ``[fileNameChemicalState]`` (default ``inputPath(pathTypeDataDynamic)//'chemicalState/chemical_state_Atomic_CIE_Cloudy.hdf5'``) — The file name to which the chemical state table should be stored. * ``[metallicityLogarithmicMaximum]`` (real; default ``1.5d0``) — The maximum metallicity to tabulated, expressed as log-10 relative to Solar. * ``[includeContinuum]`` (boolean; default ``.true.``) — If true include the cumulative fraction of total power emitted in the continuum. .. _physics-taskBuildToolAxionCAMB: ``taskBuildToolAxionCAMB`` -------------------------- A task which downloads, compiles, and installs the AxionCAMB Boltzmann code---a modification of CAMB that supports ultralight axion dark matter---making it available for computing transfer functions and power spectra in axion cosmologies. **Methods** * ``checkRange`` — Check that the provided wavenumber is within the tabulated range of the transfer function. .. _physics-taskBuildToolCAMB: ``taskBuildToolCAMB`` --------------------- A task which downloads, compiles, and installs the CAMB (Code for Anisotropies in the Microwave Background) Boltzmann code, making it available for computing CMB power spectra, matter transfer functions, and linear matter power spectra. **Methods** * ``checkRange`` — Check that the provided wavenumber is within the tabulated range of the transfer function. .. _physics-taskBuildToolCLASS: ``taskBuildToolCLASS`` ---------------------- A task which downloads, compiles, and installs the CLASS (Cosmic Linear Anisotropy Solving System) Boltzmann code, making it available as an alternative to CAMB for computing CMB anisotropies, matter transfer functions, and linear power spectra. .. _physics-taskBuildToolCloudy: ``taskBuildToolCloudy`` ----------------------- A task which downloads, compiles, and installs the Cloudy photoionization and spectral synthesis code, making it available for computing cooling functions, chemical state tables, and emission line strengths of astrophysical plasmas. .. _physics-taskBuildToolFSPS: ``taskBuildToolFSPS`` --------------------- A task which downloads, compiles, and installs the FSPS (Flexible Stellar Population Synthesis) code, making it available for computing stellar population spectral energy distributions and broadband luminosities from star formation histories. .. _physics-taskBuildToolMangle: ``taskBuildToolMangle`` ----------------------- A task which downloads, compiles, and installs the ``mangle`` angular mask software, making it available for defining and manipulating survey angular geometries used in galaxy clustering and correlation function analyses. **Methods** * ``mangleDirectory`` — Return the directory containing :term:`mangle` files for this survey geometry. * ``mangleFiles`` — Return array of :term:`mangle` filenames for this survey geometry. * ``initialize`` — Initialize an instance of the :term:`mangle` survey geometry class. .. _physics-taskBuildToolRecFast: ``taskBuildToolRecFast`` ------------------------ A task which downloads, compiles, and installs the RecFast recombination code, making it available for computing the ionization history of the universe during hydrogen and helium recombination for use in Boltzmann solvers and CMB calculations. .. _physics-taskCatalogProjectedCorrelationFunction: ``taskCatalogProjectedCorrelationFunction`` ------------------------------------------- A task which reads a galaxy catalog from an IRATE-format N-body halo file, applies a survey geometry mask, shifts galaxies into redshift space, and computes the projected two-point correlation function :math:`w_\mathrm{p}(r_\mathrm{p})` by integrating the 3D correlation function along the line of sight to a maximum separation :math:`\pi_\mathrm{max}`. **Parameters** * ``[galaxyCatalogFileName]`` (string) — The file name from which the galaxy catalog should be read. * ``[massMinimum]`` (real; default ``0.0d0``) — The minimum mass galaxy to include in a mock catalog correlation function calculation. * ``[massMaximum]`` (real; default ``1.0d16``) — The maximum mass galaxy to include in a mock catalog correlation function calculation. * ``[separationMinimum]`` (real; default ``0.1d0``) — The minimum separation to compute in a mock catalog correlation function calculation. * ``[separationMaximum]`` (real; default ``30.0d0``) — The maximum separation to compute in a mock catalog correlation function calculation. * ``[separationCount]`` (integer; default ``15``) — The number of bins in separation to compute in a mock catalog correlation function calculation. * ``[randomSampleCount]`` (string; default ``*10``) — The number of random points to use when constructing random catalogs. Can be either a fixed number or, if prefixed with "``*``", a multiplicative factor. * ``[separationRadialMaximum]`` (real; default ``40.0d0``) — The maximum radial separation of galaxies to consider when computing projected correlation functions. * ``[halfIntegral]`` (boolean; default ``.false.``) — Set to ``true`` if the projected correlation function is computed as :math:`w_\mathrm{p}(r_\mathrm{p})=\int_0^{+\pi_\mathrm{max}} \xi(r_\mathrm{p},\pi) \mathrm{d} \pi`, instead of the usual :math:`w_\mathrm{p}(r_\mathrm{p})=\int_{-\pi_\mathrm{max}}^{+\pi_\mathrm{max}} \xi(r_\mathrm{p},\pi) \mathrm{d} \pi`. * ``[widthBuffer]`` (real; default ``30.0d0``) — The width of the buffer region around survey geometry to ensure galaxies are not lost when moving to redshift space. * ``[origin]`` (real; default ``[randomNumberGenerator_%uniformSample(),randomNumberGenerator_%uniformSample(),randomNumberGenerator_%uniformSample()]``) — The vector (in units of the box length) giving the origin of the coordinate system to use in mock catalog construction. * ``[vectorRotation]`` (real; default ``[acos(2.0d0*randomNumberGenerator_%uniformSample()-1.0d0),2.0d0*Pi*randomNumberGenerator_%uniformSample()]``) — The vector, in spherical coordinates :math:`(\theta,\phi)`, about which the mock catalog should be rotated. * ``[angleRotation]`` (real; default ``2.0d0*Pi*randomNumberGenerator_%uniformSample()``) — The angle through which the mock catalog should be rotated. .. _physics-taskComovingDistances: ``taskComovingDistances`` ------------------------- A task which computes and outputs the comoving distance to each output. .. _physics-taskConditionalMassFunction: ``taskConditionalMassFunction`` ------------------------------- A task which computes the conditional mass function in bins of mass for a fixed halo mass. **Methods** * ``binWeights`` — Compute weights for a halo in each bin of the mass function. * ``binWeights2D`` — Compute weights for a halo in each bin of a 2D mass function. **Parameters** * ``[outputGroupName]`` (string) — The name of the file to which the computed conditional mass function should be output. * ``[redshiftMinimum]`` (real; default ``0.0d0``) — The minimum redshift for which to compute the conditional mass function. * ``[redshiftMaximum]`` (real; default ``0.0d0``) — The maximum redshift for which to compute the conditional mass function. * ``[useSurveyLimits]`` (boolean; default ``.false.``) — Specifies whether the limiting redshifts for integrating over the halo mass function should be limited by those of a galaxy survey. * ``[massBinCenters]`` (real) — Logarithmic mass bins centers for conditional mass function calculations. * ``[massLogarithmDelta]`` (real) — Logarithmic widths of mass bins for conditional mass function calculations. * ``[massMinimum]`` (real; default ``1.0d8``) — The minimum mass for which to compute the conditional mass function. * ``[massMaximum]`` (real; default ``1.0d12``) — The maximum mass for which to compute the conditional mass function. * ``[countMass]`` (integer; default ``21``) — The number of bins for which to compute the conditional mass function. * ``[massHalo]`` (string; default ``all``) — The halo mass for which to compute the conditional mass function. A value of "all" will cause the conditional mass function to be integrated over the halo mass function, giving the mass function. * ``[massHaloMinimum]`` (real; default ``1.0d6``) — The minimum halo mass to use when integrating over the halo mass function. * ``[massHaloMaximum]`` (real; default ``1.0d16``) — The maximum halo mass to use when integrating over the halo mass function. .. _physics-taskEvolveForests: ``taskEvolveForests`` --------------------- A task which evolves galaxies within a set of merger tree forests. **(Default implementation)** **Methods** * ``tabulate`` — Tabulate the virial density contrast as a function of mass and time. * ``restoreTable`` — Restore a tabulated solution from file. * ``storeTable`` — Store a tabulated solution to file. **Parameters** * ``[countForestsMaximum]`` (integer; default ``-1_c_size_t``) — If set to a positive number, this is the maximum number of forests that will be evolved. * ``[walltimeMaximum]`` (integer; default ``-1_kind_int8``) — If set to a positive number, this is the maximum wall time for which forest evolution is allowed to proceed before the task gives up. * ``[tolerateFailures]`` (boolean; default ``.false.``) — If true then failures to evolve a forest are tolerated. The forest is evolved no further, but evolution of other forests continues. * ``[evolveForestsInParallel]`` (boolean; default ``.true.``) — If true then each forest is evolved by a separate OpenMP thread. Otherwise, a single thread evolves all forests. * ``[suspendToRAM]`` (boolean; default ``.true.``) — Specifies whether trees should be suspended to RAM (otherwise they are suspend to file). * ``[suspendPath]`` (string) — The path to which tree suspension files will be stored. * ``[timeIntervalCheckpoint]`` (integer; default ``-1_kind_int8``) — If positive, gives the time in seconds between storing of checkpoint files. If zero or negative, no checkpointing is performed.. * ``[fileNameCheckpoint]`` (string) — The path to which checkpoint data will be stored. .. _physics-taskExcursionSets: ``taskExcursionSets`` --------------------- A task which computes and outputs excursion set statistics over a grid of halo masses and cosmic times, including the variance of the density field, the excursion set barrier, the first-crossing probability and rate, the halo mass function, and the matter power spectrum. These quantities characterize the stochastic evolution of density perturbations in the extended Press-Schechter formalism. **Parameters** * ``[massMinimum]`` (real; default ``1.0d10``) — The minimum mass at which to tabulate excursion set solutions. * ``[massMaximum]`` (real; default ``1.0d15``) — The maximum mass at which to tabulate excursion set solutions. * ``[massesPerDecade]`` (integer; default ``10``) — The number of points per decade of mass at which to tabulate excursion set solutions. * ``[redshiftMinimum]`` (real; default ``0.0d0``) — The minimum redshift at which to tabulate excursion set solutions. * ``[redshiftMaximum]`` (real; default ``10.0d0``) — The maximum redshift at which to tabulate excursion set solutions. * ``[timesPerDecade]`` (integer; default ``10``) — The number of points per decade of time at which to tabulate excursion set solutions. * ``[outputGroup]`` (string; default ``excursionSets``) — The HDF5 output group within which to write excursion set solution data. .. _physics-taskHaloMassFunction: ``taskHaloMassFunction`` ------------------------ A task which computes and outputs the differential halo mass function :math:`\mathrm{d}n/\mathrm{d}\log M` and related quantities---including halo bias, concentration, scale radius, dark matter profile, virial density contrasts, and unevolved subhalo mass function---over a grid of halo masses and output times. **Methods** * ``descriptorSpecial`` — Handle adding special parameters to the descriptor. **Parameters** * ``[haloMassMinimum]`` (real; default ``1.0d10``) — The minimum mass at which to tabulate halo mass functions. * ``[haloMassMaximum]`` (real; default ``1.0d15``) — The maximum mass at which to tabulate halo mass functions. * ``[pointsPerDecade]`` (real; default ``10.0d0``) — The number of points per decade of halo mass at which to tabulate halo mass functions. * ``[outputGroup]`` (string; default ``.``) — The HDF5 output group within which to write mass function data. * ``[includeUnevolvedSubhaloMassFunction]`` (boolean; default ``.false.``) — If true then also compute and output the unevolved subhalo mass function. * ``[includeMassAccretionRate]`` (boolean; default ``.true.``) — If true then also compute and output the mass accretion rate of the halos. * ``[massesRelativeToHalfModeMass]`` (boolean; default ``.false.``) — If true then masses are interpreted (and output) relative to the half-mode mass. (If the half-mode mass is undefined an error will occur.) If false, masses are absolute. * ``[errorsAreFatal]`` (boolean; default ``.true.``) — If true then errors in evaluating the halo mass function are considered to be fatal. * ``[labels]`` (string) — Labels for virial density contrast mass definitions. * ``[fractionModeMasses]`` (real) — List of suppression fractions at which to compute the fractional mode mass. .. _physics-taskHaloModelGenerate: ``taskHaloModelGenerate`` ------------------------- A task which populates a dark matter halo catalog with galaxies using a halo occupation distribution (HOD) model, placing central and satellite galaxies within each halo according to the conditional stellar mass function and dark matter profile, producing a mock galaxy catalog with positions for use in clustering analyses. **Parameters** * ``[haloCatalogFileName]`` (string) — The file name of the halo catalog to populate. * ``[galaxyCatalogFileName]`` (string) — The file name to which the galaxy catalog should be output. * ``[massMinimum]`` (real) — The minimum mass galaxy to include in a mock halo model realization. * ``[massMaximum]`` (real; default ``1.0d16``) — The maximum mass galaxy to include in a mock halo model realization. .. _physics-taskHaloModelProjectedCorrelationFunction: ``taskHaloModelProjectedCorrelationFunction`` --------------------------------------------- A task which analytically computes the projected two-point correlation function :math:`w_\mathrm{p}(r_\mathrm{p})` using a halo occupation distribution (HOD) model, combining the one-halo term (galaxy pairs within the same halo, sourced from the dark matter profile) and the two-halo term (pairs in different halos, sourced from the linear power spectrum and halo bias), then convolves with the survey geometry and line-of-sight integral depth. **Parameters** * ``[separationMinimum]`` (real) — The minimum separation at which to compute the projected correlation function. * ``[separationMaximum]`` (real) — The maximum separation at which to compute the projected correlation function. * ``[countSeparations]`` (integer) — The number of separations at which to compute the projected correlation function. * ``[depthLineOfSight]`` (real) — The maximum line of sight depth to which to integrate when computing the projected correlation function. * ``[halfIntegral]`` (boolean; default ``.false.``) — Set to ``true`` if the projected correlation function is computed as :math:`w_\mathrm{p}(r_\mathrm{p})=\int_0^{+\pi_\mathrm{max}} \xi(r_\mathrm{p},\pi) \mathrm{d} \pi`, instead of the usual :math:`w_\mathrm{p}(r_\mathrm{p})=\int_{-\pi_\mathrm{max}}^{+\pi_\mathrm{max}} \xi(r_\mathrm{p},\pi) \mathrm{d} \pi`. * ``[massMinimum]`` (real; default ``1.0d8``) — The minimum mass of galaxies to include in the projected correlation function calculation. * ``[massMaximum]`` (real; default ``1.0d12``) — The maximum mass of galaxies to include in the projected correlation function calculation. * ``[massHaloMinimum]`` (real; default ``1.0d6``) — The minimum halo mass to use when integrating over the halo mass function. * ``[massHaloMaximum]`` (real; default ``1.0d16``) — The maximum halo mass to use when integrating over the halo mass function. * ``[outputGroup]`` (string; default ``projectedCorrelationFunction``) — The HDF5 output group within which to write the projected correlation function. .. _physics-taskHaloSpinDistribution: ``taskHaloSpinDistribution`` ---------------------------- A task which computes and outputs the differential distribution of dark matter halo spin parameters :math:`\mathrm{d}P/\mathrm{d}\lambda` over a specified range of spin values at each output time, for halos above a specified minimum mass. **Parameters** * ``[spinMinimum]`` (real; default ``3.0d-4``) — Minimum spin for which the distribution function should be calculated. * ``[spinMaximum]`` (real; default ``0.5d0``) — Maximum spin for which the distribution function should be calculated. * ``[spinPointsPerDecade]`` (real; default ``10.0d0``) — Number of points per decade of spin at which to calculate the distribution. * ``[haloMassMinimum]`` (real; default ``0.0d0``) — Minimum halo mass above which spin distribution should be averaged. * ``[outputGroup]`` (string; default ``.``) — The HDF5 output group within which to write spin distribution data. .. _physics-taskIntergalacticMediumState: ``taskIntergalacticMediumState`` -------------------------------- A task which computes and outputs the thermal and ionization state of the intergalactic medium (IGM) at each output time, including the IGM temperature, neutral fraction, and Jeans filtering mass that regulates gas accretion onto low-mass halos. **Parameters** * ``[outputGroup]`` (string; default ``.``) — The HDF5 output group within which to write intergalactic medium state data. .. _physics-taskLocalGroupDatabase: ``taskLocalGroupDatabase`` -------------------------- A task which updates the Local Group database, downloading and processing observational data on Local Group galaxies (such as stellar masses, star formation rates, and structural parameters) for use as constraints in galaxy formation models. **Methods** * ``operator(==)`` — Test equality of two 3D vectors. * ``operator(<)`` — Less than operator for two 3D vectors. * ``operator(>)`` — Greater than operator for two 3D vectors. * ``getProperty`` — Return an array of values of the named property for the current selection. * ``select`` — Select all galaxies in the current selection where the named property has the given value. * ``selectAll`` — Select all galaxies in the database. * ``update`` — Update the database. .. _physics-taskMassFunctionCovariance: ``taskMassFunctionCovariance`` ------------------------------ A task class which computes and stores covariance matrices for mass functions. In general, for constraints corresponding to mass functions (whether stellar mass or HI mass), the covariance matrix of the observational data is determined using the analytic model of :cite:t:`smith_how_2012`. This requires knowledge of both the survey geometry (angular mask and radial extent as a function of mass) and of the :term:`HOD` of the observed galaxies. Details of the survey geometry and depth are given for each individual constraints. Computing the large-scale structure contribution to the covariance function requires integration of the non-linear matter power spectrum over the Fourier transform of the survey window function. We use the method of :cite:t:`peacock_non-linear_1996` to determine the non-linear matter power spectrum, because of its simplicity and speed. We have checked that using a more accurate non-linear matter power spectrum (e.g. :cite:author:`lawrence_coyote_2010` :cite:year:`lawrence_coyote_2010`) makes negligible difference to our results. If the angular power spectrum of the survey mask is available\footnoteTypically if the survey geometry is defined by :term:`mangle` polygons, allowing the angular power spectrum to be found using the :term:`mangle` ``harmonize`` utility., this is used to compute the relation .. math:: \sigma^2(M_\mu,M_\nu) = {2 \over \pi V_\mu V_\nu}\int_0^\infty \mathrm{d} k\, k^{-4} P(k) \sum_i \sum_j \sum_{\ell=0}^\infty (2\ell+1) C^{ij}_\ell R^i_{\ell}(kr_{\mu 0},kr_{\mu 1}) R^j_{\ell}(kr_{\nu 0},kr_{\nu 1}), where :math:`(2\ell+1) C^{ij}_\ell = \sum_{m=-\ell}^{+\ell} \Psi^i_{\ell m} \Psi^{j*}_{\ell m}`, :math:`\Psi^i_{\ell m}` are the spherical harmonic coefficients of the :math:`i^\mathrm{th}` field of the survey, :math:`V` is the maximum distance to which a galaxy of mass :math:`M` can be seen, :math:`P(k)` is the nonlinear power spectrum and .. math:: R_{\ell}(x_0,x_1) \equiv \int_{x_0}^{x_1} x^2 j_\ell(x) \mathrm{d}x = \sqrt{\pi} 2^{-2-\ell} \Gamma\left({1\over 2}[3+\ell]\right) \left[ x^{3+\ell} \tensor*[_1]{\stackrel{\sim}{F}}{_2} \left({1\over 2}[3+\ell]; \ell+{3\over 2},{1\over 2}(5+\ell);-{x^2\over 4}\right)\right]_{x_0}^{x_1}, where :math:`\tensor*[_1]{\stackrel{\sim}{F}}{_2}` is the regularized generalized hypergeometric function. In other cases, where the angular power spectrum is not available, the survey geometry is realized on a grid which is when Fourier transformed to obtain the appropriate window function. To find a suitable :term:`HOD` to describe the observed galaxies we adopt the model of :cite:t:`behroozi_comprehensive_2010`. This is an 11 parameter model which describes separately the numbers of satellite and central galaxies occupying a halo of given mass---the reader is referred to :cite:t:`behroozi_comprehensive_2010` for a complete description of the functional form of this parametric :term:`HOD`. An :term:`MCMC` approach is used to to constrain the :term:`HOD` parameters to fit the observational data. We use a likelihood .. math:: \ln \mathcal{L} = -{1\over 2} \Delta\cdot \mathcal{C}^{-1}\cdot \Delta^\mathrm{T} - {N \over 2} \ln(2\pi) - {\ln |\mathcal{C}| \over 2}, where :math:`N` is the number of bins in the mass function, :math:`\mathcal{C}` is the covariance matrix of the observed mass function, and :math:`\Delta_i = \phi_i^\mathrm{(HOD)} - \phi_i^\mathrm{(observed)}`. Of course, it is precisely this covariance matrix, :math:`\mathcal{C}`, that we are trying to compute. We therefore adopt an iterative approach as follows: #. make an initial estimate of the covariance matrix, assuming that only Poisson errors contribute (the covariance matrix is therefore diagonal, and the terms are easily computed from the measured mass function and the survey volume as a function of stellar mass); #. find the maximum likelihood parameters of the :term:`HOD` given the observed mass function and the current estimate of the covariance matrix; #. using this :term:`HOD` and the framework of :cite:t:`smith_how_2012`, compute a new estimate of the covariance matrix, including all three contributions; #. repeat steps 2 and 3 until convergence in the covariance matrix is achieved. In practice we find that this procedure often leads to an :term:`HOD` and covariance matrix which oscillate between two states in successive iterations. The differences in the covariance matrix are relatively small however, so we choose to conservatively adopt the covariance matrix with the larger values. **Parameters** * ``[massFunctionFileName]`` (string) — The name of the file to which the covariance matrix should be written. * ``[surveyRedshiftMinimum]`` (real; default ``0.0d0``) — The minimum redshift at which calculations of the mass function covariance should be carried out. * ``[surveyRedshiftMaximum]`` (real; default ``0.1d0``) — The maximum redshift at which calculations of the mass function covariance should be carried out. * ``[countMassBins]`` (integer; default ``10``) — The number of bins in the mass function for covariance calculations. * ``[massMinimum]`` (real; default ``1.0d08``) — The minimum mass in the mass function for covariance calculations. * ``[massMaximum]`` (real; default ``1.0d13``) — The maximum mass in the mass function for covariance calculations. * ``[includePoisson]`` (boolean; default ``.true.``) — Specifies whether or not to include the Poisson contribution to mass function covariance matrices. * ``[includeHalo]`` (boolean; default ``.true.``) — Specifies whether or not to include the halo contribution to mass function covariance matrices. * ``[includeLSS]`` (boolean; default ``.true.``) — Specifies whether or not to include the large-scale structure contribution to mass function covariance matrices. * ``[massHaloMinimum]`` (real; default ``1.0d10``) — The minimum halo mass to use when computing mass function covariance matrices. * ``[massHaloMaximum]`` (real; default ``1.0d15``) — The minimum halo mass to use when computing mass function covariance matrices. * ``[sizeGridFFT]`` (integer; default ``64``) — The size of the FFT grid to use in computing window functions for mass function covariance matrices. .. _physics-taskMergerTreeFileBuilder: ``taskMergerTreeFileBuilder`` ----------------------------- This task will build a merger tree file in the format described `here `_ from merger tree descriptions in other formats, such as ASCII output from an SQL database. An example of how the builder can be used can be found in this `tutorial `_. The builder is flexible, and therefore requires many parameters to control how it processes input files, all of which are described below. The builder reads from an ASCII file containing one halo per line. The ``[property]`` sub-parameters allow specification of which properties are present in the file, and in which column. The builder can optionally also read a file of associated particle data---this can be used to assign positions to orphan halos if desired. The merger tree file builder can currently export in one of two formats: ``galacticus`` merger trees are exported in Galacticus's native format described in detail `here `_; ``irate`` merger trees are exported in the `IRATE `_ format. Properties to read from the file are specified through multiple ``property`` sub-parameter sections, which take the form: .. code-block:: none where ``[name]`` is the property name (see below), ``[column]`` is the column number (starting from 1) from which to read the property, and the optional ``[conversionFactor]`` specifies an additional factor by which the property should be multiplied to place it into the correct internal units for Galacticus\footnoteThe units for masses, lengths, and velocities in the input file are specified in their own parameter sub-sections. Conversion from these units to Galacticus's internal units is performed automatically. However, sometimes the input data may have inconsistent units between columns (e.g. positions in units of Mpc, but scale radii in units of kpc). In such cases this additional conversion factor can be applied to bring all quantities into a consistent unit system.. Recognized property names are ``treeIndex`` A unique ID number for the tree to which this node belongs; ``nodeIndex`` An ID (unique within the tree) for this node; ``descendantIndex`` The ID of the node's descendant node; ``hostIndex`` The ID of the larger halo in which this node is hosted (equal to the node's own ID if the node is self-hosting); ``redshift`` The redshift of the node; ``nodeMass`` The mass of the node; ``particleCount`` The number of particles in the node; ``positionX`` The :math:`x`-position of the node (if present, both :math:`y` and :math:`z` components must also be present); ``positionY`` The :math:`y`-position of the node (if present, both :math:`x` and :math:`z` components must also be present); ``positionZ`` The :math:`z`-position of the node (if present, both :math:`x` and :math:`y` components must also be present); ``velocityX`` The :math:`x`-velocity of the node (if present, both :math:`y` and :math:`z` components must also be present); ``velocityY`` The :math:`y`-velocity of the node (if present, both :math:`x` and :math:`z` components must also be present); ``velocityZ`` The :math:`z`-velocity of the node (if present, both :math:`x` and :math:`y` components must also be present); ``spinX`` The :math:`x` component of the node's spin parameter (if present, both :math:`y` and :math:`z` components must also be present; cannot be present if spin magnitude is given); ``spinY`` The :math:`y` component of the node's spin parameter (if present, both :math:`x` and :math:`z` components must also be present; cannot be present if spin magnitude is given); ``spinZ`` The :math:`z` component of the node's spin parameter (if present, both :math:`x` and :math:`y` components must also be present; cannot be present if spin magnitude is given); ``spin`` The magnitude of the node's spin parameter (cannot be present if spin vector components are given); ``angularMomentumX`` The :math:`x`-component of the node's angular momentum (if present, both :math:`y` and :math:`z` components must also be present; cannot be present if angular momentum magnitude is given); ``angularMomentumY`` The :math:`y`-component of the node's angular momentum (if present, both :math:`x` and :math:`z` components must also be present; cannot be present if angular momentum magnitude is given); ``angularMomentumZ`` The :math:`z`-component of the node's angular momentum (if present, both :math:`x` and :math:`y` components must also be present; cannot be present if angular momentum magnitude is given); ``angularMomentum`` The magnitude of the node's angular momentum (cannot be present if angular momentum vector components are given); ``halfMassRadius`` The half-mass radius of the node; ``mostBoundParticleIndex`` The index of the most bound particle in this node. Not all properties must be specified---any required properties that are not specified will result in an error. Likewise, some properties, if present, require that other properties also be present. For example, if any of the position properties is given then all three positions are required. Properties of particles to read from the (optional) particle data file are specified through multiple ``particleProperty`` sub-parameter sections, which take the form: .. code-block:: none where ``[name]`` is the particle property name (see below), ``[column]`` is the column number (starting from 1) from which to read the particle property. Recognized particle property names are ``particleIndex`` A unique ID for the particle; ``redshift`` The redshift of the particle; ``nodeMass`` The mass of the particle; ``particleCount`` The number of particles in the particle; ``positionX`` The :math:`x`-position of the particle (if present, both :math:`y` and :math:`z` components must also be present); ``positionY`` The :math:`y`-position of the particle (if present, both :math:`x` and :math:`z` components must also be present); ``positionZ`` The :math:`z`-position of the particle (if present, both :math:`x` and :math:`y` components must also be present); ``velocityX`` The :math:`x`-velocity of the particle (if present, both :math:`y` and :math:`z` components must also be present); ``velocityY`` The :math:`y`-velocity of the particle (if present, both :math:`x` and :math:`z` components must also be present); ``velocityZ`` The :math:`z`-velocity of the particle (if present, both :math:`x` and :math:`y` components must also be present). The units used in the files are specified via the ``unitsMass``, ``unitsLength``, and ``unitsVelocity`` sub-parameter sections. These have the following form: .. code-block:: none where ``[name]`` is a human-readable name for the units, ``[unitsInSI]`` gives the units in the SI system, ``[hubbleExponent]`` specifies the power to which :math:`h` appears in the units and ``[scaleFactorExponent]`` specifies the number of powers of the expansion factor by which the quantity should be multiplied to place it into physical units. Finally, arbitrary metadata can be added to the file (which can be useful to record, for example, the origin of the data, or details of the simulation, or halo finder used). Metadata is specified via ``metaData`` sub-parameter sections. These have the following form: .. code-block:: none where ``[name]`` is a name for this metadatum, ``[content]`` is the value for the metadatum (integer, floating point, and text content is allowed), and ``[type]`` specifies the type of metadatum, and must be one of: ``generic`` Add to the generic ``metaData`` group; ``cosmology`` Add to the ``cosmology`` group; ``simulation`` Add to the ``simulation`` group; ``groupFinder`` Add to the ``groupFinder`` group; ``treeBuilder`` Add to the ``treeBuilder`` group; ``provenance`` Add to the ``provenance`` group. **Methods** * ``descriptorSpecial`` — Handle adding special parameters to the descriptor. **Parameters** * ``[inputFileName]`` (string) — The name of the file from which to read merger tree data. * ``[particlesFileName]`` (string) — The name of the file from which to read particle data. * ``[outputFileName]`` (string) — The name of the file to which to write merger tree data. * ``[outputFormat]`` (string; one of ``galacticus``, ``irate``) — The format to use for merger tree output. * ``[columnHeaders]`` (boolean; default ``.false.``) — If true, the file is assumed to contain a single line of column headers, which will be skipped. * ``[columnSeparator]`` (string; default ``,``) — The separator for columns. * ``[massParticle]`` — The mass of the simulation particle. * ``[dummyHostId]`` — If present, specifies the dummy host ID for self-hosting halos. Otherwise, self-hosting halos have ``hostIndex == nodeIndex``. * ``[haloMassesIncludeSubhalos]`` — Specifies whether or not halo masses include the masses of their subhalos. * ``[includesHubbleFlow]`` — Specifies whether or not Hubble flow is included in velocities. * ``[positionsArePeriodic]`` — Specifies whether or not positions are periodic. * ``[name]`` (string) — A human-readable name for the units of velocity. * ``[column]`` (integer) — The column from which to read the particle property. * ``[conversionFactor]`` (real) — An additional conversion factor to apply to the property to get it into the correct units. * ``[content]`` (string) — The value of the metadata. * ``[type]`` (string; one of ``generic``, ``cosmology``, ``simulation``, ``groupFinder``, ``treeBuilder``, ``provenance``) — The metadata type. * ``[unitsInSI]`` (real) — The velocity unit in the SI system. * ``[hubbleExponent]`` (integer) — The exponent of the "little-:math:`h`" Hubble parameter needed to convert the velocities to little-:math:`h`-free units. * ``[scaleFactorExponent]`` (integer) — The exponent of the cosmological scale factor needed to convert the velocities to physical units. .. _physics-taskMergingHaloOrbitDistribution: ``taskMergingHaloOrbitDistribution`` ------------------------------------ A task which tabulates the joint distribution of orbital parameters (velocity at virial radius and tangential-to-total velocity ratio) for halos merging into host halos, sampled from the virial orbit model weighted by the merger tree branching probability and halo mass function, and outputs the resulting distribution for analysis. **Parameters** * ``[velocityMinimum]`` (real) — The minimum velocity (in units of the host virial velocity) for which to compute velocity distributions. * ``[velocityMaximum]`` (real) — The maximum velocity (in units of the host virial velocity) for which to compute velocity distributions. * ``[countVelocitiesPerUnit]`` (real) — The number of points per unit of velocity (in units of the host virial velocity) for which to compute velocity distributions. * ``[massMinimum]`` (real) — The minimum mass halo for which to compute mergingHaloOrbitDistribution properties. * ``[massMaximum]`` (real) — The maximum mass halo for which to compute mergingHaloOrbitDistribution properties. * ``[countMassesPerDecade]`` (real) — The number of points per decade of mass for which to compute mergingHaloOrbitDistribution properties. * ``[redshift]`` (real) — The redshift. .. _physics-taskMulti: ``taskMulti`` ------------- A task which sequentially performs multiple other tasks, iterating through a linked list of :galacticus-class:`taskClass` objects and calling each one's ``perform`` method in order. This allows combining several independent computations (e.g., evolving forests plus computing a power spectrum) into a single Galacticus run. **Methods** * ``columnDescriptions`` — Return a description of the columns. * ``elementCount`` — Return the number of properties in the tuple. * ``extractDouble`` — Extract the double properties from the given ``node``. * ``extractInteger`` — Extract the integer properties from the given ``node``. * ``names`` — Return the names of the properties extracted. * ``descriptions`` — Return descriptions of the properties extracted. * ``unitsInSI`` — Return the units of the properties extracted in the SI system. * ``units`` — Return an object containing units metadata for the properties. * ``ranks`` — Return the ranks of the properties extracted. * ``metaData`` — Populate a hash with meta-data for the property. .. _physics-taskNBodyAnalyze: ``taskNBodyAnalyze`` -------------------- A task which imports particle or halo data from an N-body simulation using a configurable importer, applies a chain of operators (e.g., computing density profiles, identifying substructure, computing statistics), and optionally writes the processed data back to the imported format. **Parameters** * ``[storeBackToImported]`` (boolean; default ``.true.``) — If true, computed properties and results will be stored back to the file from which a simulation was imported (assuming it is of HDF5 type). .. _physics-taskPosteriorSample: ``taskPosteriorSample`` ----------------------- A task which performs Bayesian inference by sampling from the posterior distribution of model parameters given observational constraints. Delegates to a :galacticus-class:`posteriorSampleSimulationClass` object that implements the specific sampling algorithm (e.g., MCMC, differential evolution, or particle swarm optimization). **Parameters** * ``[initializeNodeClassHierarchy]`` (boolean; default ``.true.``) — If true then initialize the node class hierarchy in the posterior sampling class. This should be set to false if the likelihood function will instead perform this action. .. _physics-taskPostprocessForests: ``taskPostprocessForests`` -------------------------- A task which postprocesses galaxies within a set of merger tree forests. This task assumes that a prior model was run, with raw forest data written to file using the :galacticus-class:`mergerTreeOutputterFullState` merger tree outputter class. The name of that file is specified via the ``fileName`` parameter. Forests data will be re-read, and re-output. Note that you should use the *exact same* parameter file (other than changing the ``task``, and possibly removing the use of the :galacticus-class:`mergerTreeOutputterFullState` outputter) as was used to run the original model. This ensures that the raw data structures read from the file follow the same format as was used to write them. Also note that forests are not guaranteed to be output in the same order as in the original model if OpenMP parallelism is used. If the same order is required, it is recommend to run the postprocessing after setting the environment variable ``OMP_NUM_THREADS=1``. **Parameters** * ``[fileName]`` (string) — The name of the file from which forests should be read. .. _physics-taskPowerSpectra: ``taskPowerSpectra`` -------------------- A task which computes and outputs the power spectrum and related quantities. **Parameters** * ``[pointsPerUnit]`` (real) — The number of points per unit wavenumber at which to tabulate power spectra. * ``[pointsPerDecade]`` (real; default ``10.0d0``) — The number of points per decade of wavenumber at which to tabulate power spectra. * ``[wavenumberMinimum]`` (real; default ``1.0d-3``) — The minimum wavenumber at which to tabulate power spectra. * ``[wavenumberMaximum]`` (real; default ``1.0d+3``) — The maximum wavenumber at which to tabulate power spectra. * ``[includeNonLinear]`` (boolean; default ``.false.``) — If true the nonlinear power spectrum is also computed and output. * ``[massSmoothingWindowFunction]`` (real; default ``-1.0d0``) — If positive, the window function evaluated at this smoothing mass will be output. * ``[outputGroup]`` (string; default ``.``) — The HDF5 output group within which to write power spectrum data. .. _physics-taskRadiativeTransfer: ``taskRadiativeTransfer`` ------------------------- A task which performs radiative transfer. **Parameters** * ``[wavelengthMinimum]`` (real; default ``0.3d4``) — The minimum wavelength at which to sample photon packets. * ``[wavelengthMaximum]`` (real; default ``10.0d4``) — The maximum wavelength at which to sample photon packets. * ``[wavelengthCountPerDecade]`` (integer; default ``10``) — The number of wavelengths per decade at which to sample photon packets. * ``[countPhotonsPerWavelength]`` (integer; default ``10_c_size_t``) — The number of photon packets to generate at each wavelength. * ``[countPhotonsPerWavelengthFinalIteration]`` (integer; default ``countPhotonsPerWavelength``) — The number of photon packets to generate at each wavelength on the final iteration. * ``[countIterationsMinimum]`` (integer; default ``1_c_size_t``) — The minimum number of iterations. * ``[countIterationsMaximum]`` (integer; default ``10_c_size_t``) — The maximum number of iterations. * ``[outputGroupName]`` (string; default ``radiativeTransferModel``) — The name of the group to which results should be output. * ``[outputIterations]`` (boolean; default ``.false.``) — If true, output data for all iterations, not just the final iteration. .. _physics-taskReport: ``taskReport`` -------------- A task which reports on version and build information. .. _physics-taskVelocityField: ``taskVelocityField`` --------------------- A task which computes and outputs the cosmological velocity field. **Parameters** * ``[massMinimum]`` (real; default ``1.0d10``) — The minimum mass scale at which to tabulate the velocity field. * ``[massMaximum]`` (real; default ``1.0d+3``) — The maximum mass scale at which to tabulate the velocity field. * ``[pointsPerDecade]`` (integer; default ``10``) — The number of points per decade of mass at which to tabulate the velocity field. * ``[outputGroup]`` (string; default ``.``) — The HDF5 output group within which to write velocity field data.