fpfs.image#

class fpfs.image.measure_base(psf_data, pix_scale, sigma_arcsec, sigma_detect=None, nnord=4)[source]#

Bases: object

A base class for measurement, which is extended to measure_source and measure_noise_cov :param psf_data: an average PSF image used to initialize the task :type psf_data: ndarray :param pix_scale: pixel scale in arcsec :type pix_scale: float :param sigma_arcsec: Shapelet kernel size :type sigma_arcsec: float :param sigma_detect: detection kernel size :type sigma_detect: float :param nnord: the highest order of Shapelets radial

components [default: 4]

deconvolve(data, prder=1.0, frder=1.0)[source]#

Deconvolves input data with the PSF or PSF power

Parameters:
  • data (ndarray) – galaxy power or galaxy Fourier transfer, origin is set to [ngrid//2,ngrid//2]

  • prder (float) – deconvlove order of PSF FT power

  • frder (float) – deconvlove order of PSF FT

Returns:

out (ndarray) – Deconvolved galaxy power [truncated at klim]

class fpfs.image.measure_noise_cov(psf_data, pix_scale, sigma_arcsec, sigma_detect=None, nnord=4)[source]#

Bases: measure_base

A class to measure FPFS noise covariance of basis modes

Parameters:
  • psf_data (ndarray) – an average PSF image used to initialize the task

  • pix_scale (float) – pixel scale in arcsec

  • sigma_arcsec (float) – Shapelet kernel size

  • sigma_detect (float) – detection kernel size

  • nnord (int) – the highest order of Shapelets radial components [default: 4]

measure(noise_pf)[source]#

Estimate covariance of measurement error in impt form

Parameters:

noise_pf (ndarray) – power spectrum (assuming homogeneous) of noise

Returns:

cov_matrix (ndarray) – covariance matrix of FPFS basis modes

class fpfs.image.measure_source(psf_data, pix_scale, sigma_arcsec, sigma_detect=None, nnord=4)[source]#

Bases: measure_base

A class to measure FPFS shapelet mode estimation

Parameters:
  • psf_data (ndarray) – an average PSF image used to initialize the task

  • pix_scale (float) – pixel scale in arcsec

  • sigma_arcsec (float) – Shapelet kernel size

  • sigma_detect (float) – detection kernel size

  • nnord (int) – the highest order of Shapelets radial components [default: 4]

detect_sources(img_data, psf_data, thres, thres2, bound=None)[source]#

Returns the coordinates of detected sources

Parameters:
  • img_data (ndarray) – observed image

  • psf_data (ndarray) – PSF image [must be well-centered]

  • thres (float) – detection threshold

  • thres2 (float) – peak identification difference threshold

  • bound (int) – remove sources at boundary

Returns:

coords (ndarray) – peak values and the shear responses

get_results(out)[source]#
measure(exposure, coords=None)[source]#

Measures the FPFS moments

Parameters:
  • exposure (ndarray) – galaxy image

  • psf_fourier (ndarray) – PSF’s Fourier transform

Returns:

out (ndarray) – FPFS moments

measure_coord(cc, image)[source]#

Measures the FPFS moments from a coordinate (jitted)

Parameters:
  • cc (ndarray) – galaxy peak coordinate

  • image (ndarray) – exposure

Returns:

mm (ndarray) – FPFS moments

measure_stamp(data)[source]#

Measures the FPFS moments from a stamp (jitted)

Parameters:

data (ndarray) – galaxy image array

Returns:

mm (ndarray) – FPFS moments

prepare_chi(chi)[source]#

Prepares the basis to estimate shapelet modes

Parameters:

chi (ndarray) – 2d shapelet basis

prepare_psi(psi)[source]#

Prepares the basis to estimate detection modes

Parameters:

psi (ndarray) – 2d detection basis

fpfs.image.results_coords(dd)[source]#