PSF

class simcado.psf.PSF(size, pix_res)[source]

Bases: object

Point spread function (single layer) base class

Parameters
sizeint

[pixel] the side length of the array

pix_resfloat

[arcsec] the pixel scale of the array

Methods Summary

convolve(self, kernel)

Convolve the PSF with another kernel.

resample(self, new_pix_res)

Resample the PSF array onto a new grid

resize(self, new_size)

Resize the PSF.

set_array(self, array[, threshold])

Set the spatial flux distribution array for the PSF

Methods Documentation

convolve(self, kernel)[source]

Convolve the PSF with another kernel. The PSF keeps its shape

Parameters
kernelnp.array, PSF

Either a numpy.ndarray or a PSF (sub)class

Returns
psf_newPSF
resample(self, new_pix_res)[source]

Resample the PSF array onto a new grid

Not perfect, but conserves flux

Parameters
new_pix_resfloat

[arcsec] the pixel resolution of the returned array

Returns
psf_newPSF

Examples

>>> new_PSF = old_PSF.resample(new_pix_res)
resize(self, new_size)[source]

Resize the PSF. The target shape is (new_size, new_size).

Parameters
new_sizeint

the new square dimensions of the PSF array in pixels

set_array(self, array, threshold=1e-15)[source]

Set the spatial flux distribution array for the PSF

Renormalise the array make sure there aren’t any negative values that will screw up the flux

Parameters
arraynp.ndarray

the array representing the PSF

thresholdfloat

by default set to 1E-15. Below this, the array is set to 0