furry_parakeet.pyimcom_lakernel

Linear algebra kernel for PyIMCOM.

Functions

BruteForceKernel

Brute force version of the kernel. Slow and useful only for comparisons.

CKernel

PyIMCOM kernel wrapped around C routines.

CKernelMulti

PyIMCOM kernel, generating multiple images.

get_coadd_matrix_discrete

PyIMCOM kernel, but built out of a basis of discrete choices in the Lagrange multiplier.

Functions

BruteForceKernel(A, mBhalf, C, targetleak[, kCmin, ...])

Brute force version of the kernel. Slow and useful only for comparisons.

CKernel(A, mBhalf, C, targetleak[, kCmin, kCmax, nbis])

PyIMCOM kernel wrapped around C routines.

CKernelMulti(A, mBhalf, C, targetleak[, kCmin, kCmax, ...])

PyIMCOM kernel, generating multiple images.

get_coadd_matrix_discrete(A, mBhalf, C, kappa_array, ucmin)

PyIMCOM kernel, but built out of a basis of discrete choices in the Lagrange multiplier.

Module Contents

BruteForceKernel(A, mBhalf, C, targetleak, kCmin=1e-16, kCmax=1e+16, nbis=53)[source]

Brute force version of the kernel. Slow and useful only for comparisons.

Implements PyIMCOM operations with a for loop (hence slow).

Parameters:
  • A (np.array) – System matrix, shape = (n, n)

  • mBhalf (np.array) – The matrix -0.5*B: target overlap matrix, shape = (m, n)

  • C (float) – Target normalization.

  • targetleak (float) – Allowable leakage of target PSF.

  • kCmin (float, optional) – Minimum value of kappa/C to test.

  • kCmax (float, optional) – Maximum value of kappa/C to test.

  • nbis (int, optional) – Number of bisections to use in search for the best kappa. (These are done in log kappa space.)

Returns:

  • kappa (np.array) – Lagrange multiplier per output pixel, shape=(m,)

  • Sigma (np.array) – Output noise amplification, shape=(m,)

  • UC (np.array) – Fractional squared error in PSF, shape=(m,)

  • T (np.array) – Coaddition matrix, shape=(m, n)

CKernel(A, mBhalf, C, targetleak, kCmin=1e-16, kCmax=1e+16, nbis=53)[source]

PyIMCOM kernel wrapped around C routines.

Parameters:
  • A (np.array) – System matrix, shape = (n, n)

  • mBhalf (np.array) – The matrix -0.5*B: target overlap matrix, shape = (m, n)

  • C (float) – Target normalization.

  • targetleak (float) – Allowable leakage of target PSF.

  • kCmin (float, optional) – Minimum value of kappa/C to test.

  • kCmax (float, optional) – Maximum value of kappa/C to test.

  • nbis (int, optional) – Number of bisections to use in search for the best kappa. (These are done in log kappa space.)

Returns:

  • kappa (np.array) – Lagrange multiplier per output pixel, shape=(m,)

  • Sigma (np.array) – Output noise amplification, shape=(m,)

  • UC (np.array) – Fractional squared error in PSF, shape=(m,)

  • T (np.array) – Coaddition matrix, shape=(m, n)

CKernelMulti(A, mBhalf, C, targetleak, kCmin=1e-16, kCmax=1e+16, nbis=53, smax=100000000.0)[source]

PyIMCOM kernel, generating multiple images.

There are nt target PSFs. If mBhalf is a 2D array, assumes nt=1.

Parameters:
  • A (np.array) – System matrix, shape = (n, n)

  • mBhalf (np.array) – The matrix -0.5*B: target overlap matrix, shape = (nt, m, n)

  • C (np.array) – Target normalization, shape = (nt,)

  • targetleak (np.array) – Allowable leakage of target PSF, shape = (nt,)

  • kCmin (float, optional) – Minimum value of kappa/C to test.

  • kCmax (float, optional) – Maximum value of kappa/C to test.

  • nbis (int, optional) – Number of bisections to use in search for the best kappa. (These are done in log kappa space.)

  • smax (float, optional) – Maximum allowed noise metric Sigma.

Returns:

  • kappa (np.array) – Lagrange multiplier per output pixel, shape = (nt, m)

  • Sigma (np.array) – Output noise amplification, shape = (nt, m)

  • UC (np.array) – Fractional squared error in PSF, shape = (nt, m)

  • T (np.array) – Coaddition matrix, shape = (nt, m, n)

See also

CKernel

Similar but with only one target PSF.

get_coadd_matrix_discrete(A, mBhalf, C, kappa_array, ucmin, smax=0.5)[source]

PyIMCOM kernel, but built out of a basis of discrete choices in the Lagrange multiplier.

Parameters:
  • A (np.array) – System matrix, shape = (n, n)

  • mBhalf (np.array) – The matrix -0.5*B: target overlap matrix, shape = (n_out, m, n)

  • C (np.array) – Target normalization, shape = (n_out,)

  • kappa_array (np.array) – Lagrange multiplier nodes in ascending order, shape = (nv,)

  • ucmin (float) – Target leakage U/C

  • smax (float, optional) – Maximum allowed noise metric Sigma.

Returns:

  • kappa (np.array) – Lagrange multiplier per output pixel, shape = (n_out, m)

  • Sigma (np.array) – Output noise amplification, shape = (n_out, m)

  • UC (np.array) – Fractional squared error in PSF, shape = (n_out, m)

  • T (np.array) – Coaddition matrix, shape = (n_out, m, n)