class darkmappy.forward_models.PlanarForwardModel(n, mask=None, ngal=None, supersample=1, sigma_e=0.37)

Weak Gravitational Lensing planar Forward model

Supports additional complexity which should simply be appended to the dir_op and adj_op objects appropriately (e.g. psf degridding step, psf deconvolution etc.)

__init__(n, mask=None, ngal=None, supersample=1, sigma_e=0.37)

Construct class to hold the spherical forward and forward adjoint operators.

Parameters
  • n (int) – Pixel count along each axis (square images)

  • mask (int array) – Map of realspace masking.

  • ngal (int array) – Map of galaxy observation count.

  • supersample (float) – Degree of supersampling.

  • sigma_e (float) – intrinsic ellipticity dispersion

Raises
  • ValueError – Raised if map is of size 0.

  • ValueError – Raised if mask is the wrong shape.

  • ValueError – Raised if ngal is the wrong shape.

  • WarningLog – Raised if L is very large.

adj_op(gamma)

Planar weak lensing adjoint measurement operator

Parameters

gamma (complex array) – Shear Observations (cov weighted)

compute_fourier_kernels()

Computes fourier space kernel mappings.

Returns as a tuple {forward, inverse}.

cov_weight(x)

Applies covariance weighting to observations.

Assumes no intrinsic correlation between pixels.

Parameters

x (array) – pixel space map to be inverse covariance weighted.

dir_op(kappa)

Planar weak lensing measurement operator

Parameters

kappa (complex array) – Convergence signal

ks_estimate(gamma)

Computes Kaiser-Squires estimator (as a first estimate)

Parameters

gamma (complex array) – Shear Observations (patch)

mask_adjoint(x)

Applies given mask adjoint to observations

Parameters

x (complex array) – Set of observations.

Raises

ValueError – Raised if signal is nan

mask_forward(f)

Applies given mask to a field.

Parameters

f (complex array) – Realspace Signal

Raises
  • ValueError – Raised if signal is nan

  • ValueError – Raised if signal is of incorrect shape.

ngal_to_inv_cov(ngal)

Converts galaxy number density map to data covariance.

Assumes no intrinsic correlation between pixels.

Parameters

ngal (real array) – pixel space map of observation counts per pixel.

class darkmappy.forward_models.SphericalForwardModel(L, mask=None, ngal=None, sigma_e=0.37)

Weak Gravitational Lensing spherical Forward model

Supports additional complexity which should simply be appended to the dir_op and adj_op objects appropriately (e.g. psf degridding step, psf deconvolution etc.)

__init__(L, mask=None, ngal=None, sigma_e=0.37)

Construct class to hold the spherical forward and forward adjoint operators.

Parameters
  • L (int) – Spherical harmonic bandlimit

  • mask (int array) – Map of realspace masking.

  • ngal (int array) – Map of galaxy observation count.

  • sigma_e (float) – intrinsic ellipticity dispersion

Raises
  • ValueError – Raised if L is not positive

  • ValueError – Raised if mask is the wrong shape.

  • WarningLog – Raised if L is very large.

adj_op(gamma)

Spherical weak lensing adjoint measurement operator

Parameters

gamma (complex array) – Shear Observations (cov weighted)

compute_harmonic_kernel()

Compuptes harmonic space kernel mapping

Returns

Harmonic space weak lensing kernel

cov_weight(x)

Applies covariance weighting to observations.

Assumes no correlation between pixels.

Parameters

x (array) – pixel space map to be inverse covariance weighted.

Returns

Inverse covariance weighted observations y’ = y * sigma^-1/2

dir_op(kappa)

Spherical weak lensing measurement operator

Parameters

kappa (complex array) – Convergence signal

harmonic_inverse_mapping(flm)

Applys harmonic space inverse mapping.

Parameters

flm (complex array) – harmonic coefficients.

Returns

Inverse mapped harmonic coefficients glm = flm / K

harmonic_mapping(flm)

Applys harmonic space mapping.

Parameters

flm (complex array) – harmonic coefficients.

Returns

Mapped harmonic coefficients glm = flm * K

mask_adjoint(x)

Applies given mask adjoint to observations

Parameters

x (complex array) – Set of observations.

Raises

ValueError – Raised if signal is nan

Returns

Gridded full-sky map of observations

mask_forward(f)

Applies given mask to a field.

Parameters

f (complex array) – Realspace Signal

Raises
  • ValueError – Raised if signal is nan

  • ValueError – Raised if signal is of incorrect shape.

Returns

Array of observations only.

ngal_to_inv_cov(ngal)

Converts galaxy number density map to data covariance.

Assumes no correlation between pixels.

Parameters

ngal (real array) – pixel space map of number of observations per pixel

Returns

Data covariance, assuming no correlations and Gaussian noise

sks_estimate(gamma)

Computes spherical Kaiser-Squires estimator (as a first estimate)

Parameters

gamma (complex array) – Shear Observations (full-sky)