autolens.SimulatorImaging#

class SimulatorImaging[source]#

Bases: SimulatorImaging

Simulations observations of imaging data, including simulation of the image, noise-map, PSF, etc. as an Imaging object.

The simulation of an Imaging dataset uses the following steps:

  1. Receive as input the raw image which is simulated via the steps below.

  2. Convolve the image with the Point Spread Function of the simulated dataset.

  3. Use input values of the background sky level in every pixel of the image to add the background sky to the PSF convolved image.

  4. Add Poisson noise to the image, which represents noise due to whether photons hits the CCD and are converted to photo-electrons which are succcessfully detected by the CCD and converted to counts.

  5. Subtract the background sky from the image, so that the returned simulated dataset is background sky subtracted.

The inputs of the SimulatorImaging object can toggle these steps on and off, for example if psf=None the PSF convolution step is omitted.

Parameters:
  • exposure_time (float) – The exposure time of the simulated imaging.

  • background_sky_level (float) – The level of the background sky of the simulated imaging.

  • psf (Optional[Kernel2D]) – An array describing the PSF kernel of the image.

  • normalize_psf (bool) – If True, the PSF kernel is normalized so all values sum to 1.0.

  • add_poisson_noise (bool) – Whether Poisson noise corresponding to photon count statistics on the imaging observation is added.

  • noise_if_add_noise_false (float) – If noise is not added to the simulated dataset a noise_map must still be returned. This value gives the value of noise assigned to every pixel in the noise-map.

  • noise_seed (int) – The random seed used to add random noise, where -1 corresponds to a random seed every run.

Methods

via_deflections_and_galaxies_from

Simulate an Imaging dataset from an input deflection angle map and list of galaxies.

via_galaxies_from

Simulate an Imaging dataset from an input list of galaxies and grid.

via_image_from

Simulate an Imaging dataset from an input image.

via_source_image_from

Simulate an Imaging dataset from an input image of a source galaxy.

via_tracer_from

Simulate an Imaging dataset from an input tracer and grid.

via_tracer_from(tracer, grid)[source]#

Simulate an Imaging dataset from an input tracer and grid.

The tracer is used to perform ray-tracing and generate the image of the strong lens galaxies (e.g. the lens light, lensed source light, etc) which is simulated.

The steps of the SimulatorImaging simulation process (e.g. PSF convolution, noise addition) are described in the SimulatorImaging __init__ method docstring.

Parameters:
  • tracer (Tracer) – The tracer, which describes the ray-tracing and strong lens configuration used to simulate the imaging dataset.

  • grid (Union[ndarray, Grid2D, Grid2DIterate, Grid2DIrregular]) – The image-plane grid which the image of the strong lens is generated on.

Return type:

Imaging

via_galaxies_from(galaxies, grid)[source]#

Simulate an Imaging dataset from an input list of galaxies and grid.

The galaxies are used to create a tracer, which performs ray-tracing and generate the image of the strong lens galaxies (e.g. the lens light, lensed source light, etc) which is simulated.

The steps of the SimulatorImaging simulation process (e.g. PSF convolution, noise addition) are described in the SimulatorImaging __init__ method docstring.

Parameters:
  • galaxies (List[Galaxy]) – The galaxies used to create the tracer, which describes the ray-tracing and strong lens configuration used to simulate the imaging dataset.

  • grid (Union[ndarray, Grid2D, Grid2DIterate, Grid2DIrregular]) – The image-plane grid which the image of the strong lens is generated on.

Return type:

Imaging

via_deflections_and_galaxies_from(deflections, galaxies)[source]#

Simulate an Imaging dataset from an input deflection angle map and list of galaxies.

The input deflection angle map ray-traces the image-plane coordinates from the image-plane to source-plane, via the lens equation.

This traced grid is then used to evaluate the light of the list of galaxies, which therefore simulate the image of the strong lens.

This function is used in situations where one has access to a deflection angle map which does not suit being ray-traced using a Tracer object (e.g. deflection angles from a cosmological simulation of a galaxy).

The steps of the SimulatorImaging simulation process (e.g. PSF convolution, noise addition) are described in the SimulatorImaging __init__ method docstring.

Parameters:
  • galaxies (List[Galaxy]) – The galaxies used to create the tracer, which describes the ray-tracing and strong lens configuration used to simulate the imaging dataset.

  • grid – The image-plane grid which the image of the strong lens is generated on.

Return type:

Imaging

via_source_image_from(tracer, grid, source_image)[source]#

Simulate an Imaging dataset from an input image of a source galaxy.

This input image is on a uniform and regular 2D array, meaning it can simulate the source’s irregular and assymetric source galaxy morphological features.

The typical use case is inputting the image of an irregular galaxy in the source-plane (whose values are on a uniform array) and using this function computing the lensed image of this source galaxy.

The tracer is used to perform ray-tracing and generate the image of the strong lens galaxies (e.g. the lens light, lensed source light, etc) which is simulated.

The source galaxy light profiles are ignored in favour of the input source image, but the emission of other galaxies (e.g. the lems galaxy’s light) are included.

The steps of the SimulatorImaging simulation process (e.g. PSF convolution, noise addition) are described in the SimulatorImaging __init__ method docstring.

Parameters:
  • tracer (Tracer) – The tracer, which describes the ray-tracing and strong lens configuration used to simulate the imaging dataset.

  • grid (Union[ndarray, Grid2D, Grid2DIterate, Grid2DIrregular]) – The image-plane grid which the image of the strong lens is generated on.

  • source_image (Array2D) – The image of the source-plane and source galaxy which is interpolated to compute the lensed image.

Return type:

Imaging