Class

NumCosmoGalaxyShapeFactor

Description [src]

abstract class NumCosmo.GalaxyShapeFactor : GObject.Object
{
  /* No available fields */
}

Shape likelihood-factor calculator for the weak-lensing pipeline.

The calculator owns the whole HSM measurement engine: the intrinsic ellipticity $\chi_I$ is drawn from the NcGalaxyShapePop resolved from the NcmMSet, mapped deterministically by the reduced-shear transformation with calibration bias $\tilde g = (1+m)\,g + c$, and observed with additive per-galaxy Gaussian pixel noise, $\epsilon_\mathrm{obs} = f_{\tilde g}(\chi_I) + n$, $n \sim N_2(0, \sigma_\mathrm{noise}^2)$.

The likelihood factor is the marginal over the latent intrinsic shape, $$P(\epsilon_\mathrm{obs} \mid z, \ldots) = \int_{|\chi_I| < 1} d^2\chi_I\, P_\mathrm{pop}(\chi_I)\, N_2!\big(\epsilon_\mathrm{obs} - f_{\tilde g}(\chi_I); \sigma_\mathrm{noise}^2\big),$$ evaluated per galaxy at each source redshift $z$ (the outer $z$-integral belongs to the orchestrator). How this two-dimensional marginal is computed is the only axis subclasses vary: each subclass is one evaluation strategy implementing the eval_marginal / eval_ln_marginal hooks. Everything else - generation, per-galaxy geometry caches (projected radius, optzs, critical surface-density nodes), frame bookkeeping and data IO - lives here, written once.

This is a calculator, not a model: it holds no fitted parameters and does not live in the NcmMSet; the models it needs (cosmology, halo position and profile, surface mass density, shape population) are resolved from the mset passed to each method.

Ancestors

Functions

nc_galaxy_shape_factor_clear

Decreases the reference count of gsf by one, and sets the pointer *gsf to NULL.

Instance methods

nc_galaxy_shape_factor_apply_shear

Applies the reduced shear g to the intrinsic ellipticity E, storing the resulting observed ellipticity in E_obs. The transformation depends on the NcGalaxyWLObsEllipConv configured in gsf.

nc_galaxy_shape_factor_apply_shear_inv

Applies the inverse shear transformation using g to recover the intrinsic ellipticity E from the observed ellipticity E_obs. The transformation depends on the NcGalaxyWLObsEllipConv configured in gsf.

nc_galaxy_shape_factor_check_obs

Checks that obss ellipticity convention matches gsfs own NcGalaxyWLObsEllipConv. Validation the shape factor owns (it is the one that knows what convention it expects), not its callers.

nc_galaxy_shape_factor_data_get

Gets the observed ellipticity and the per-galaxy measurement quantities.

nc_galaxy_shape_factor_data_set

Sets the observed ellipticity and the per-galaxy measurement quantities.

nc_galaxy_shape_factor_direct_estimate

Computes the inverse-variance-weighted direct estimate of the reduced shear from the observed ellipticities. The per-galaxy intrinsic scatter enters through the population model’s rms (see nc_galaxy_shape_pop_e_rms()).

nc_galaxy_shape_factor_eval_at_nodes

Evaluates the shape likelihood P(epsilon_obs | z_j, data) at every node, writing the result into out. Requires a prior call to nc_galaxy_shape_factor_prepare_data_array_at_nodes().

nc_galaxy_shape_factor_eval_ln_marginal

Logarithmic counterpart of nc_galaxy_shape_factor_eval_marginal().

nc_galaxy_shape_factor_eval_marginal

Evaluates the intrinsic-ellipticity marginal P(epsilon_obs | g) = int d^2chi_I P_pop(chi_I) N_2(epsilon_obs - f_g(chi_I); std_noise^2) using the subclass evaluation strategy. The shear and the observed ellipticity must be expressed in the same frame; data supplies the per-galaxy noise (std_noise) and the population fragment (pop_data).

nc_galaxy_shape_factor_free

Decreases the reference count of gsf by one.

nc_galaxy_shape_factor_gen

Generates a galaxy shape: the intrinsic ellipticity is drawn from the NcGalaxyShapePop in mset, sheared with the reduced shear at the galaxy’s (ra, dec, z) with the calibration bias applied, and observed with additive Gaussian noise. The per-galaxy measurement quantities (std_noise, c1, c2, m) and the frame data->coord must be set beforehand (see nc_galaxy_shape_factor_data_set()). The shape is generated in the celestial frame and mapped to data->coord (see NcWLEllipticityFrame); since the intrinsic shape and noise are isotropic the generation is frame-symmetric, while the additive bias (c1, c2) is taken to be already expressed in data->coord.

nc_galaxy_shape_factor_get_crit_hash

Hash of the models the critical surface mass density depends on: the cosmology, the surface-mass-density model and the lens redshift (halo_position).

nc_galaxy_shape_factor_get_ellip_conv

Gets the ellipticity convention of gsf.

nc_galaxy_shape_factor_get_optzs_hash
No description available.

nc_galaxy_shape_factor_get_pop_hash
No description available.

nc_galaxy_shape_factor_get_radius_hash
No description available.

nc_galaxy_shape_factor_integ

Creates a new shape integrand P(epsilon_obs | z, data). The marginalization hook (eval_marginal or eval_ln_marginal) is resolved once here, out of the per-evaluation path.

nc_galaxy_shape_factor_lndet_jac

Computes the natural logarithm of the absolute value of the Jacobian determinant of the transformation from intrinsic to observed ellipticity.

nc_galaxy_shape_factor_prepare

Factory-level prepare: refreshes the geometry/profile caches shared by every galaxy (only recomputing whichever half actually went stale, judged by hashing the models each half depends on), refreshes the cached model references NcGalaxyShapeFactors own per-Data updates use (nc_galaxy_shape_factor_update_data_radius(), nc_galaxy_shape_factor_update_data_optzs(), nc_galaxy_shape_factor_update_data_pop()), then calls the subclass’s own prepare hook. Cheap/no-op when nothing relevant changed — safe and correct to call unconditionally every orchestrator prepare() cycle.

nc_galaxy_shape_factor_prepare_data_array

Prepares the per-galaxy caches used by the integrand: lens geometry (projected radius, tangential-frame rotation of the observed ellipticity and calibration bias) and the reduced-shear optimization cache. Also prepares the population fragments and runs the subclass prepare hook.

nc_galaxy_shape_factor_prepare_data_array_at_nodes

Pre-computes cached quantities (Sigma_crit per node, Sigma(R)) for the fixed quadrature path. This unconditionally (re)computes every per-galaxy node cache: deciding when a recompute is needed is the caller’s responsibility.

nc_galaxy_shape_factor_ref

Increases the reference count of gsf by one.

nc_galaxy_shape_factor_update_data_at_nodes_crit

Refreshes datas per-node critical surface density cache, using the lens context cached by the last nc_galaxy_shape_factor_prepare() call. This cache depends only on self->lens_ctx/self->cosmo/ self->surface_mass_density (not on density_profile or the projected radius), and lens_ctx is refreshed whenever nc_galaxy_shape_factor_get_optzs_hash() changes (see prepare()’s own doc comment) — so call this whenever that hash changed, or whenever the node grid itself was rebuilt (different/resized z_nodes).

nc_galaxy_shape_factor_update_data_at_nodes_sigma

Refreshes datas cached surface mass density Sigma(R) used by the fixed-nodes path, using datas own cached projected radius as an input. Unconditional: call only when nc_galaxy_shape_factor_get_radius_hash() or nc_galaxy_shape_factor_get_optzs_hash() changed, and only after nc_galaxy_shape_factor_update_data_radius() in the same cycle if that one also needs to run — this assumes datas cached projected radius is already current (same ordering contract as update_data_optzs()).

nc_galaxy_shape_factor_update_data_optzs

Refreshes datas cached reduced-shear optimization context, using the profile cache from the last nc_galaxy_shape_factor_prepare() call. Unconditional: call only when nc_galaxy_shape_factor_get_optzs_hash() actually changed, and only after nc_galaxy_shape_factor_update_data_radius() in the same cycle if that one also needs to run — this assumes datas cached projected radius is already current.

nc_galaxy_shape_factor_update_data_pop

Resolves the NcGalaxyShapePop model’s current parameters into datas population fragment. Unconditional: call only when nc_galaxy_shape_factor_get_pop_hash() actually changed.

nc_galaxy_shape_factor_update_data_radius

Refreshes datas cached projected radius, tangential-frame rotation of the observed ellipticity, and rotated calibration bias, using the geometry cache from the last nc_galaxy_shape_factor_prepare() call. Unconditional: call only when nc_galaxy_shape_factor_get_radius_hash() actually changed.

Methods inherited from GObject (43)

Please see GObject for a full list of methods.

Properties

NumCosmo.GalaxyShapeFactor:ellip-conv

Weak lensing observables ellipticity convention NcGalaxyWLObsEllipConv.

Signals

Signals inherited from GObject (1)
GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

Class structure

struct NumCosmoGalaxyShapeFactorClass {
  void (* data_init) (
    NcGalaxyShapeFactor* gsf,
    NcmMSet* mset,
    NcGalaxyShapeFactorData* data
  );
  void (* prepare) (
    NcGalaxyShapeFactor* gsf,
    NcmMSet* mset
  );
  gdouble (* eval_marginal) (
    NcGalaxyShapeFactor* gsf,
    NcGalaxyShapePop* pop,
    NcGalaxyShapeFactorData* data,
    const gdouble g_1,
    const gdouble g_2,
    const gdouble epsilon_obs_1,
    const gdouble epsilon_obs_2
  );
  gdouble (* eval_ln_marginal) (
    NcGalaxyShapeFactor* gsf,
    NcGalaxyShapePop* pop,
    NcGalaxyShapeFactorData* data,
    const gdouble g_1,
    const gdouble g_2,
    const gdouble epsilon_obs_1,
    const gdouble epsilon_obs_2
  );
  
}

No description available.

Class members
data_init: void (* data_init) ( NcGalaxyShapeFactor* gsf, NcmMSet* mset, NcGalaxyShapeFactorData* data )

No description available.

prepare: void (* prepare) ( NcGalaxyShapeFactor* gsf, NcmMSet* mset )

No description available.

eval_marginal: gdouble (* eval_marginal) ( NcGalaxyShapeFactor* gsf, NcGalaxyShapePop* pop, NcGalaxyShapeFactorData* data, const gdouble g_1, const gdouble g_2, const gdouble epsilon_obs_1, const gdouble epsilon_obs_2 )

No description available.

eval_ln_marginal: gdouble (* eval_ln_marginal) ( NcGalaxyShapeFactor* gsf, NcGalaxyShapePop* pop, NcGalaxyShapeFactorData* data, const gdouble g_1, const gdouble g_2, const gdouble epsilon_obs_1, const gdouble epsilon_obs_2 )

No description available.

Virtual methods

NumCosmo.GalaxyShapeFactorClass.data_init
No description available.

NumCosmo.GalaxyShapeFactorClass.eval_ln_marginal

Logarithmic counterpart of nc_galaxy_shape_factor_eval_marginal().

NumCosmo.GalaxyShapeFactorClass.eval_marginal

Evaluates the intrinsic-ellipticity marginal P(epsilon_obs | g) = int d^2chi_I P_pop(chi_I) N_2(epsilon_obs - f_g(chi_I); std_noise^2) using the subclass evaluation strategy. The shear and the observed ellipticity must be expressed in the same frame; data supplies the per-galaxy noise (std_noise) and the population fragment (pop_data).

NumCosmo.GalaxyShapeFactorClass.prepare

Factory-level prepare: refreshes the geometry/profile caches shared by every galaxy (only recomputing whichever half actually went stale, judged by hashing the models each half depends on), refreshes the cached model references NcGalaxyShapeFactors own per-Data updates use (nc_galaxy_shape_factor_update_data_radius(), nc_galaxy_shape_factor_update_data_optzs(), nc_galaxy_shape_factor_update_data_pop()), then calls the subclass’s own prepare hook. Cheap/no-op when nothing relevant changed — safe and correct to call unconditionally every orchestrator prepare() cycle.