xlens.simulator.perturbation
Lensing and astrometric perturbation models for simulated galaxies.
Submodules
Classes
Apply an astrometric position shift to simulate DCR effects. |
|
Shear and convergence field generated by an NFW halo lens. |
|
Flat-sky log-normal shear field generated from a CCL weak-lensing |
|
Constant shear in each redshift slice. |
Package Contents
- class DcrDistort(distort_func)[source]
Bases:
objectApply an astrometric position shift to simulate DCR effects.
- distort_func
- distort_galaxy(gso, shift, redshift)[source]
This function distorts the galaxy’s shape and position :param gso (galsim object): :type gso (galsim object): galsim galaxy :param shift (galsim.PositionD): :type shift (galsim.PositionD): position of the galaxy :param redshift (float): :type redshift (float): redshift of galaxy
- Returns:
distorted galaxy object and shift
- Return type:
gso, shift
- class ShearHalo(*, mass, conc, z_lens, halo_profile='NFW', cosmo=None, no_kappa=False, gmax=0.95)[source]
Bases:
objectShear and convergence field generated by an NFW halo lens.
- cosmo = None
- mass
- z_lens
- conc
- no_kappa = False
- lens
- lens_solver
- gmax = 0.95
- class ShearLogNormalFlat(z_source, field_size_deg=5.0, npix=2048, seed=None)[source]
Flat-sky log-normal shear field generated from a CCL weak-lensing power spectrum.
The constructor computes kappa, gamma1, and gamma2 maps and builds bivariate spline interpolators so that
distort_galaxycan evaluate the lensing fields at arbitrary sky positions.- Parameters:
z_source (float) – Source redshift for the weak-lensing tracer.
field_size_deg (float, optional) – Side length of the square field in degrees.
npix (int, optional) – Number of pixels per side used for the Fourier-space generation.
seed (int or None, optional) – Random seed for reproducible field realisations.
- cosmo
- z_source
- field_size_deg = 5.0
- npix = 2048
- seed = None
- ell
- cl_kappa
- kappa_G_map
- kappa_LN_map
- gamma1_map
- gamma2_map
- kappa_map
- kappa_interp
- gamma1_interp
- gamma2_interp
- class ShearRedshift(z_bounds, mode, g_dist='g1', shear_value=0.02, kappa_value=0.0)[source]
Bases:
objectConstant shear in each redshift slice.
The shear pattern across redshift bins is encoded as a ternary integer (
mode), where each base-3 digit maps to-shear_value,+shear_value, or0.0.- Parameters:
z_bounds (list[float]) – Redshift bin boundaries (length
nz_bins + 1).mode (int) – Ternary-encoded shear assignment (see class docstring).
g_dist ({'g1', 'g2'}) – Which shear component receives the test signal.
shear_value (float) – Absolute shear amplitude per bin.
kappa_value (float) – Constant convergence applied to all bins.
- nz_bins
- code
- z_bounds
- g_dist = 'g1'
- shear_value = 0.02
- shear_list
- kappa = 0.0