VariablePSF

class romanisim.psf.VariablePSF(corners, psf)

Bases: object

Spatially variable PSF wrapping GalSim profiles.

Linearly interpolates between four corner PSF profiles by summing weighted GalSim PSF profiles.

Methods Summary

at_position(x, y)

Instantiate a PSF profile at (x, y).

build_epsf_interpolator(image[, ...])

Build the spatial Taylor expansions for an ePSF profile.

draw_epsf(x, y[, fluxfactor])

Draw an ePSF at (x, y) using a Taylor expansion.

Methods Documentation

at_position(x, y)

Instantiate a PSF profile at (x, y).

Linearly interpolate between the four corners to obtain the PSF at this location.

Parameters:
xfloat

x position

yfloat

y position

Returns:
GalSim profile representing PSF at (x, y).
build_epsf_interpolator(image, oversamp_render=8, oversamp_taylor=50, order=1, max_radius=100, epsf=False)

Build the spatial Taylor expansions for an ePSF profile.

Parameters:
imagegalsim.Image

image within which we will inject PSFs

oversamp_renderint

Oversampling with which to render ePSFs using galsim. Should probably be an integer multiple of the native oversampling if using CRDS PSFs. Default 8

oversamp_taylorint

Oversampling for the Taylor expansion. Total RAM requirements will be ~oversamp_taylor**2*4*nterms*PSFstampsize times 4 bytes where nterms is 1, 3, or 6 depending on the desired order. For a 100x100 PSF, order=1, and oversampling of 50, this is about 1.2 GB. Default 50

orderint

Order of the Taylor expansion. Must be 0, 1, or 2. The number of terms in the Taylor expansion is 1, 3, or 6, respectively. Higher order = more RAM, more computational cost, but gives a higher accuracy at fixed oversamp_taylor. Default 1

max_radiusint

Maximum half-width of the box for the ePSF in pixels. A very large box will be expensive in compute time and memory for the Taylor expansion. Default 100

epsfboolean

Has the input PSF already been convolved with the pixel response function (is it an ePSF)? If True, use no_pixel to render with galsim. Default False

Returns:
None
This routine builds the bounds and Taylor expansion arrays needed for
draw_epsf; they are stored as self.bounds and self.psfinterpolators
draw_epsf(x, y, fluxfactor=1)

Draw an ePSF at (x, y) using a Taylor expansion.

Linearly interpolate between the four corners to obtain the PSF at this location.

Parameters:
xfloat

x position

yfloat

y position

fluxfactorfloat

factor by which to multiply the ePSF Default 1

Returns:
GalSim image representing the ePSF at (x, y), including bounds.