Skip to content

shine.psf_utils

PSF modeling utilities.

Factory functions for creating GalSim and JAX-GalSim PSF objects from configuration, supporting Gaussian and Moffat profiles.

psf_utils

PSF modeling utilities.

get_psf(psf_config)

Create a GalSim PSF object from configuration.

Parameters:

Name Type Description Default
psf_config PSFConfig

PSF configuration specifying type and parameters.

required

Returns:

Type Description
GSObject

GalSim PSF object.

Raises:

Type Description
NotImplementedError

If the PSF type is not supported.

Source code in shine/psf_utils.py
def get_psf(psf_config: PSFConfig) -> galsim.GSObject:
    """Create a GalSim PSF object from configuration.

    Args:
        psf_config: PSF configuration specifying type and parameters.

    Returns:
        GalSim PSF object.

    Raises:
        NotImplementedError: If the PSF type is not supported.
    """
    return _build_psf(psf_config, galsim)

get_jax_psf(psf_config, gsparams=None)

Create a JAX-GalSim PSF object from configuration.

Parameters:

Name Type Description Default
psf_config PSFConfig

PSF configuration specifying type and parameters.

required
gsparams Optional[Any]

Optional GSParams for controlling rendering.

None

Returns:

Type Description
GSObject

JAX-GalSim PSF object.

Raises:

Type Description
NotImplementedError

If the PSF type is not supported.

Source code in shine/psf_utils.py
def get_jax_psf(
    psf_config: PSFConfig, gsparams: Optional[Any] = None
) -> jax_galsim.GSObject:
    """Create a JAX-GalSim PSF object from configuration.

    Args:
        psf_config: PSF configuration specifying type and parameters.
        gsparams: Optional GSParams for controlling rendering.

    Returns:
        JAX-GalSim PSF object.

    Raises:
        NotImplementedError: If the PSF type is not supported.
    """
    return _build_psf(psf_config, jax_galsim, gsparams=gsparams)