fpfs.imgutil#
- fpfs.imgutil.convolve2gausspsf(img_data, psf_data, sigmaf, klim)[source]#
This function convolves an image to transform the PSF to a Gaussian
- fpfs.imgutil.cut_img(img, rcut)[source]#
Cuts img into postage stamp with width=2rcut
- Parameters:
img (ndarray) – input image
rcut (int) – cutout radius
- Returns:
out (ndarray) – image in a stamp
- fpfs.imgutil.detlets2d(ngrid, sigma, klim)[source]#
Generates shapelets function in Fourier space, chi00 are normalized to 1. This function only supports square stamps: ny=nx=ngrid.
- fpfs.imgutil.find_peaks(img_conv, img_conv_det, thres, thres2=0.0, bound=20.0)[source]#
Detects peaks and returns the coordinates (y,x) This function does the pre-selection in Li & Mandelbaum (2023)
- Parameters:
- Returns:
coord_array (ndarray) – ndarray of coordinates [y,x]
- fpfs.imgutil.fit_noise_pf(ngrid, gal_pow, noise_mod, rlim)[source]#
Fit the noise power from observed galaxy power
- Parameters:
ngrid (int) – number of pixels in x and y direction
gal_pow (ndarray) – galaxy Fourier power function
- Returns:
out (ndarray) – noise power to be subtracted
- fpfs.imgutil.fpfs_bases(ngrid, nord, sigma, sigma_det=None, klim=3.15)[source]#
Returns the FPFS bases (shapelets and detectlets)
- fpfs.imgutil.get_fourier_pow_fft(input_data)[source]#
Gets Fourier power function
- Parameters:
input_data (ndarray) – image array, centroid does not matter.
- Returns:
out (ndarray) – Fourier Power
- fpfs.imgutil.get_fourier_pow_rfft(input_data)[source]#
Gets Fourier power function
- Parameters:
input_data (ndarray) – image array. The centroid does not matter.
- Returns:
galpow (ndarray) – Fourier Power
- fpfs.imgutil.get_klim(psf_array, sigma, thres=1e-20)[source]#
Gets klim, the region outside klim is supressed by the shaplet Gaussian kernel in FPFS shear estimation method; therefore we set values in this region to zeros
- fpfs.imgutil.pcaimages(xdata, nmodes)[source]#
Estimates the principal components of array list xdata
- Parameters:
xdata (ndarray) – input data array
nmodes (int) – number of pcs to keep
- Returns:
out (ndarray) – pc images,
stds (ndarray) – stds on the axis
coeffs (ndarray) – projection coefficient
- fpfs.imgutil.shapelets2d(ngrid, nord, sigma, klim)[source]#
Generates complex shapelets function in Fourier space, chi00 are normalized to 1 [only support square stamps: ny=nx=ngrid]
- fpfs.imgutil.shapelets2d_real(ngrid, nord, sigma, klim)[source]#
Generates real shapelets function in Fourier space, chi00 are normalized to 1 [only support square stamps: ny=nx=ngrid]
- Parameters:
- Returns:
chi_2 (ndarray) – 2d shapelet basis w/ shape [n,ngrid,ngrid]
name_s (list) – A list of shaplet names w/ shape [n]