xlens.simulator.sim
Pipeline task that simulates multi-band LSST coadd images.
The MultibandSimTask task orchestrates drawing galaxy catalogs,
convolving them with PSF models, and optionally adding realistic noise and
pixel masks. The code mirrors the Rubin Science Pipelines interface while
providing a self-contained set of utilities that are convenient for unit
tests and tutorials bundled with xlens.
Attributes
Classes
Define the Butler datasets consumed and produced by |
|
Configuration options controlling the multi-band simulation task. |
|
Butler connections for |
|
Configuration for |
|
Task that draws coadds using intrinsic-alignment distortions. |
Module Contents
- class MultibandSimConnections(*, config=None)[source]
Bases:
lsst.pipe.base.PipelineTaskConnectionsDefine the Butler datasets consumed and produced by
MultibandSim.
- class MultibandSimConfig[source]
Bases:
lsst.pipe.base.PipelineTaskConfigConfiguration options controlling the multi-band simulation task.
- class MultibandSimTask(**kwargs: Any)[source]
Bases:
lsst.pipe.base.PipelineTask- simulate_images(*, galaxy_catalog, psf_obj, wcs, bbox_outer, band: str, mag_zero: float, draw_method: str = 'auto', **kwargs)[source]
Render a galaxy catalog into an image array.
- Parameters:
galaxy_catalog – Galaxy catalog object (e.g. from
from_array) to draw.psf_obj –
galsim.GSObjectdescribing the PSF to use when rendering.wcs – LSST
SkyWcsobject that provides the sky-to-pixel mapping.bbox_outer –
lsst.geom.Box2Igiving the outer bounding box of the patch.band – Name of the photometric band (
"r","i", …).mag_zero – Zeropoint magnitude used for converting fluxes.
draw_method – Rendering method passed to the
galsimdrawing routines.
- Returns:
Two-dimensional array with simulated pixel values for the requested patch.
- Return type:
numpy.ndarray
- draw_catalog(*, galaxy_catalog, wcs, bbox_outer, psf_obj, mag_zero: float, band: str, draw_method: str = 'auto', nn_trunc: None | int = None, **kwargs)[source]
Iterate over galaxies in the catalog and render them into an image.
- Parameters:
galaxy_catalog – Galaxy catalog with
dataarray andget_objmethod.wcs – LSST
SkyWcsfor the tangent-plane projection.bbox_outer –
lsst.geom.Box2Iouter bounding box of the patch.psf_obj – GalSim PSF object used for convolution.
mag_zero (float) – Zeropoint magnitude.
band (str) – Photometric band.
draw_method (str, optional) – GalSim rendering method.
nn_trunc (int or None, optional) – Stamp truncation size in pixels.
Nonemeans no truncation.
- Returns:
Two-dimensional pixel array.
- Return type:
numpy.ndarray
- run(*, tract_info, patch_id: int, band: str, seed: int, truthCatalog, psfArray: numpy.typing.NDArray | None = None, noiseCorrArray: numpy.typing.NDArray | None = None, mask: lsst.afw.image.MaskX | None = None, **kwargs)[source]
Simulate an LSST coadd exposure for a specific tract patch.
- Parameters:
tract_info –
TractInfodescribing the region of sky being simulated.patch_id – Identifier of the patch inside
tract_infoto draw.band – Photometric band label.
seed – Deterministic seed generated by the pipeline’s ID generator.
truthCatalog – Truth catalog produced by
CatalogTaskcontaining the galaxies to render.psfArray – Optional inputs that provide measured PSFs, noise correlation images, or systematics masks from real observations.
noiseCorrArray – Optional inputs that provide measured PSFs, noise correlation images, or systematics masks from real observations.
mask – Optional inputs that provide measured PSFs, noise correlation images, or systematics masks from real observations.
- Returns:
Struct with a single
simExposureattribute holding the simulatedExposureFobject.- Return type:
lsst.pipe.base.Struct
- class IASimConnections(*, config=None)[source]
Bases:
MultibandSimConnectionsButler connections for
IASimTask.The intrinsic-alignment simulator uses the same datasets as
MultibandSimTaskso this subclass only exists for clarity.
- class IASimConfig[source]
Bases:
MultibandSimConfigConfiguration for
IASimTaskincluding IA parameters.
- class IASimTask(**kwargs: Any)[source]
Bases:
MultibandSimTaskTask that draws coadds using intrinsic-alignment distortions.