.. _physics-outputAnalysisWeightOperator: Output Analysis Weight Operator =============================== Class providing operators on statistical weights for on-the-fly output analysis---transformations applied to the per-galaxy weight (e.g.\ :math:`1/V_\mathrm{max}` or merger tree weight) before accumulating it into binned statistics such as mass functions or luminosity functions. Weight operators can implement survey completeness corrections, volume corrections for non-representative samples, or reweighting by derived galaxy properties. The operator receives the current weight, the property value, its intrinsic value, the property type and quantity, and the output index. **Default implementation:** ``outputAnalysisWeightOperatorIdentity`` Methods ------- ``operate`` → ``double precision`` Operate on the given weight. * ``double precision , intent(in ) :: weightValue`` * ``type (treeNode ), intent(inout) :: node`` * ``double precision , intent(in ) :: propertyValue , propertyValueIntrinsic`` * ``type (enumerationOutputAnalysisPropertyTypeType ), intent(in ) :: propertyType`` * ``type (enumerationOutputAnalysisPropertyQuantityType), intent(in ) :: propertyQuantity`` * ``integer (c_size_t ), intent(in ) :: outputIndex`` .. _physics-outputAnalysisWeightOperatorCsmlgyVolume: ``outputAnalysisWeightOperatorCsmlgyVolume`` -------------------------------------------- An output analysis weight operator class which corrects weights for the difference in cosmological volume between true and assumed (i.e. in the observational analysis) cosmologies. Typically the observational data will have been analyzed assuming some specific set of cosmological parameters which will differ from that in the current model. Therefore, the comoving volume occupied by a population of galaxies must be adjusted to match what would be inferred if they were assessed using the same cosmological parameters as were used for the observational data. Typically, this will mean that weights are scaled in proportion to :math:`V_\mathrm{max} / V^\prime_\mathrm{max}`, where :math:`V_\mathrm{max}` and :math:`V^\prime_\mathrm{max}` are the maximum volumes within which the galaxy would have been detected in the true and assumed cosmologies respectively. .. _physics-outputAnalysisWeightOperatorFilterHighPass: ``outputAnalysisWeightOperatorFilterHighPass`` ---------------------------------------------- An output analysis weight operator that multiplies galaxy weights by a high-pass filter function, suppressing contributions from galaxies with properties below ``filterThreshold`` (with transition sharpness controlled by ``filterWidth``) during statistical comparisons. **Parameters** * ``[filterThreshold]`` — Threshold for the high-pass filter distribution operator. * ``[filterWidth]`` (default ``0.0d0``) — The width of the filter (0 for a sharp transition; :math:`>0` for a smoothed transition). * ``[normalized]`` (default ``.false.``) — If true, the property value is set to the filter value, otherwise it is multiplied by it. * ``[filterThreshold]`` — Threshold for the high-pass filter distribution operator. * ``[filterWidth]`` (default ``0.0d0``) — The width of the filter (0 for a sharp transition; :math:`>0` for a smoothed transition). * ``[threshold]`` — The threshold value above which to pass. .. _physics-outputAnalysisWeightOperatorIdentity: ``outputAnalysisWeightOperatorIdentity`` ---------------------------------------- Returns a weight of unity for every node without modification, serving as a no-op weight operator in output analysis pipelines where uniform weighting is desired. **(Default implementation)** **Parameters** * ``[redshift]`` (default ``0.0d0``) — The redshift at which the transfer function is defined. .. _physics-outputAnalysisWeightOperatorNbodyMass: ``outputAnalysisWeightOperatorNbodyMass`` ----------------------------------------- An output analysis weight operator that multiplies the galaxy weight by an integral over the N-body halo mass distribution between ``rangeLower`` and ``rangeUpper``, accounting for the dispersion in N-body halo masses when comparing model predictions to simulation data. **Parameters** * ``[rangeLower]`` — Lower integration limit for the nbodyMass distribution weight operator. * ``[rangeUpper]`` — Upper integration limit for the nbodyMass distribution weight operator. .. _physics-outputAnalysisWeightOperatorNormal: ``outputAnalysisWeightOperatorNormal`` -------------------------------------- An output analysis weight operator that multiplies galaxy weights by the integral of a normal distribution (with specified ``rootVariance``) over the range [``rangeLower``, ``rangeUpper``], for incorporating Gaussian selection uncertainties in statistical comparisons. **Methods** * ``calculationReset`` — Reset memoized calculations. **Parameters** * ``[rangeLower]`` — Lower integration limit for the normal distribution weight operator. * ``[rangeUpper]`` — Upper integration limit for the normal distribution weight operator. * ``[rootVariance]`` — Root variance for the normal distribution weight operator. * ``[extentLower]`` (default ``-huge(0.0d0)``) — Lower extent for the normal distribution weight operator. * ``[extentUpper]`` (default ``+huge(0.0d0)``) — Upper extent for the normal distribution weight operator. * ``[rangeLower]`` — Lower integration limit for the normal distribution weight operator. * ``[rangeUpper]`` — Upper integration limit for the normal distribution weight operator. * ``[rootVariance]`` — Root variance for the normal distribution weight operator. * ``[mean]`` — The mean :math:`\mu` of the normal (Gaussian) distribution, specifying the location of the peak of the probability density function; optionally constrained within :math:`[x_\mathrm{l}, x_\mathrm{u}]`. * ``[variance]`` — The variance :math:`S = \sigma^2 > 0` of the normal distribution, controlling the width of the Gaussian bell curve; the standard deviation is :math:`\sigma = \sqrt{S}` and the FWHM is :math:`2\sqrt{2\ln 2}\,\sigma`. * ``[limitLower]`` — The lower truncation limit :math:`x_\mathrm{l}` of the normal distribution; when set, the distribution is renormalized over :math:`[x_\mathrm{l}, x_\mathrm{u}]` rather than :math:`(-\infty, +\infty)`. * ``[limitUpper]`` — The upper truncation limit :math:`x_\mathrm{u}` of the normal distribution; when set, the distribution is renormalized over :math:`[x_\mathrm{l}, x_\mathrm{u}]` rather than :math:`(-\infty, +\infty)`. * ``[massEnvironment]`` (default ``1.0d15``) — The mass within the sphere sphere used to determine the variance in the environmental density. * ``[radiusEnvironment]`` (default ``7.0d0``) — The radius of the sphere used to determine the variance in the environmental density. * ``[redshift]`` (default ``0.0d0``) — The redshift at which the large-scale environmental overdensity is defined; the linear density variance and growth factor are evaluated at the corresponding cosmic time to normalize the Gaussian environmental PDF. .. _physics-outputAnalysisWeightOperatorProperty: ``outputAnalysisWeightOperatorProperty`` ---------------------------------------- Weights each node's contribution to an output analysis by the value of a specified node property, enabling property-weighted statistics such as mass-weighted quantities or luminosity-weighted distributions. .. _physics-outputAnalysisWeightOperatorSequence: ``outputAnalysisWeightOperatorSequence`` ---------------------------------------- Applies a sequence of :galacticus-class:`outputAnalysisWeightOperatorClass` objects in order to a weight value, enabling construction of complex multi-step weighting schemes from composable weight operators. **Methods** * ``prepend`` — Prepend an operator to a sequence of weight operators. .. _physics-outputAnalysisWeightOperatorSubsampling: ``outputAnalysisWeightOperatorSubsampling`` ------------------------------------------- Applies a subsampling weight to each node, upweighting the nodes to preserve correct number statistics after merger tree branches have been subsampled. **Methods** * ``samplingRate`` — Compute the sampling rate. **Parameters** * ``[samplingMassThreshold]`` (default ``0.0d0``) — The satellite halo mass below which subsampling is applied; satellites more massive than this threshold are always retained with probability 1. * ``[samplingInfallTimeThreshold]`` (default ``huge(0.0d0)``) — The infall time (in Gyr) below which subsampling is applied; satellites that fell in more recently than this threshold are always retained with probability 1. * ``[samplingPericenterThreshold]`` (default ``0.0d0``) — Pericenter distance threshold above which satellites are subsampled in units of the distance to the host halo at infall. This criterion will be ignored if the ``virialOrbit`` of satellite is not gettable. * ``[samplingFunctionSlope]`` (default ``0.0d0``) — The power-law slope :math:`\beta` of the satellite subsampling function :math:`f = \alpha (M_\mathrm{sat}/M_0)^\beta`, controlling how rapidly the sampling probability varies with satellite mass. * ``[samplingFunctionNormalization]`` (default ``1.0d0``) — The normalization coefficient :math:`\alpha` of the satellite subsampling function :math:`f = \alpha (M_\mathrm{sat}/M_0)^\beta`, setting the overall sampling probability at the reference mass :math:`M_0`.