Virtual Method

NumCosmoGalaxySDObsRedshiftgen1

Declaration [src]

gboolean
gen1 (
  NcGalaxySDObsRedshift* gsdor,
  NcGalaxySDObsRedshiftData* data,
  NcmRNG* rng
)

Description [src]

Attempts to generate a single redshift sample consistent with the observational constraints defined in gsdor. The result is stored in data.

This method is typically used in scenarios where the total number of galaxies is fixed, and we wish to construct a subsample that satisfies observational selection criteria (e.g., redshift cuts or survey limitations). For each galaxy in the total sample, a redshift is proposed, and if it violates the constraints, the galaxy is discarded from the final subsample.

This sampling approach avoids the need to compute the normalization or acceptance fraction analytically or numerically, which may involve complex or model-dependent integrals. It also offers flexibility for implementing more general or evolving selection functions.

Parameters

data

Type: NcGalaxySDObsRedshiftData

A pre-initialized NcGalaxySDObsRedshiftData.

The data is owned by the caller of the method.
rng

Type: NcmRNG

A NcmRNG random number generator.

The data is owned by the caller of the method.

Return value

Type: gboolean

TRUE if a valid redshift was generated; FALSE otherwise.