autolens.SimulatorInterferometer#
- class SimulatorInterferometer[source]#
Bases:
SimulatorInterferometerSimulates observations of Interferometer data, including transforming a real-space image to complex-valued visibilities in Fourier space and optionally adding complex Gaussian noise.
The simulation of an Interferometer dataset uses the following steps:
Receive as input a real-space image (e.g. a model galaxy or lens system) and a set of UV-plane baselines (uv_wavelengths) describing the interferometer configuration.
Fourier transform the real-space image to the UV-plane using the configured transformer class (DFT or NUFFT) to produce model visibilities.
Optionally add complex Gaussian noise to the visibilities, with the noise level controlled by noise_sigma. The noise is added independently to the real and imaginary parts.
Create a constant noise map with value noise_sigma for every visibility. If noise is not added (noise_sigma=None), the noise map is filled with noise_if_add_noise_false instead.
The returned Interferometer dataset contains the simulated visibilities, noise map, uv_wavelengths and real-space mask, and can be used directly with FitInterferometer.
- Parameters:
uv_wavelengths – The (u, v) baseline coordinates of the interferometer in units of wavelengths. This is a 2D array of shape (total_visibilities, 2) where each row is a (u, v) baseline pair. These define the Fourier-space sampling of the observation.
exposure_time (
float) – The exposure time of the simulated interferometer observation in seconds.transformer_class – The class used to perform the Fourier transform between real space and the UV-plane. The default TransformerDFT is suitable for small datasets (fewer than ~10,000 visibilities). For larger datasets use TransformerNUFFT for efficiency.
noise_sigma – The standard deviation of the complex Gaussian noise added to each visibility. Noise is added independently to the real and imaginary components. If None, no noise is added to the visibilities but a noise map is still created using noise_if_add_noise_false.
noise_if_add_noise_false – The noise value assigned to every visibility in the noise map when noise_sigma=None (i.e. when no noise is added to the data). This gives the noise map a non-zero value so that downstream fits remain well-defined.
noise_seed – The random seed used for noise generation. A value of -1 uses a different random seed on every run, producing different noise realisations each time.
use_jax (
bool) – IfTrue,via_image_fromdefaultsxptojax.numpyand the simulator’s internal complex-Gaussian noise generation routes throughjax.random. The returnedInterferometercarriesjax.Arrayvisibilities. Mirror ofSimulatorImaging.use_jax.
- __init__(uv_wavelengths, exposure_time, transformer_class=<class 'autoarray.operators.transformer.TransformerDFT'>, noise_sigma=0.1, noise_if_add_noise_false=0.1, noise_seed=-1, use_jax=False)[source]#
Simulates observations of Interferometer data, including transforming a real-space image to complex-valued visibilities in Fourier space and optionally adding complex Gaussian noise.
The simulation of an Interferometer dataset uses the following steps:
Receive as input a real-space image (e.g. a model galaxy or lens system) and a set of UV-plane baselines (uv_wavelengths) describing the interferometer configuration.
Fourier transform the real-space image to the UV-plane using the configured transformer class (DFT or NUFFT) to produce model visibilities.
Optionally add complex Gaussian noise to the visibilities, with the noise level controlled by noise_sigma. The noise is added independently to the real and imaginary parts.
Create a constant noise map with value noise_sigma for every visibility. If noise is not added (noise_sigma=None), the noise map is filled with noise_if_add_noise_false instead.
The returned Interferometer dataset contains the simulated visibilities, noise map, uv_wavelengths and real-space mask, and can be used directly with FitInterferometer.
- Parameters:
uv_wavelengths – The (u, v) baseline coordinates of the interferometer in units of wavelengths. This is a 2D array of shape (total_visibilities, 2) where each row is a (u, v) baseline pair. These define the Fourier-space sampling of the observation.
exposure_time (
float) – The exposure time of the simulated interferometer observation in seconds.transformer_class – The class used to perform the Fourier transform between real space and the UV-plane. The default TransformerDFT is suitable for small datasets (fewer than ~10,000 visibilities). For larger datasets use TransformerNUFFT for efficiency.
noise_sigma – The standard deviation of the complex Gaussian noise added to each visibility. Noise is added independently to the real and imaginary components. If None, no noise is added to the visibilities but a noise map is still created using noise_if_add_noise_false.
noise_if_add_noise_false – The noise value assigned to every visibility in the noise map when noise_sigma=None (i.e. when no noise is added to the data). This gives the noise map a non-zero value so that downstream fits remain well-defined.
noise_seed – The random seed used for noise generation. A value of -1 uses a different random seed on every run, producing different noise realisations each time.
use_jax (
bool) – IfTrue,via_image_fromdefaultsxptojax.numpyand the simulator’s internal complex-Gaussian noise generation routes throughjax.random. The returnedInterferometercarriesjax.Arrayvisibilities. Mirror ofSimulatorImaging.use_jax.
Methods
__init__(uv_wavelengths, exposure_time[, ...])Simulates observations of Interferometer data, including transforming a real-space image to complex-valued visibilities in Fourier space and optionally adding complex Gaussian noise.
Simulate an Imaging dataset from an input deflection angle map and list of galaxies.
via_galaxies_from(galaxies, grid[, xp])Simulate imaging data for this data, as follows:
via_image_from(image[, xp])Simulate an Interferometer dataset from an input real-space image.
via_source_image_from(tracer, grid, source_image)Simulate an Interferometer dataset from an input image of a source galaxy.
via_tracer_from(tracer, grid[, xp])Returns a realistic simulated image by applying effects to a plain simulated image.
- via_tracer_from(tracer, grid, xp=None)[source]#
Returns a realistic simulated image by applying effects to a plain simulated image.
- Parameters:
image – The image before simulating (e.g. the lens and source galaxies before optics blurring and Imaging read-out).
pixel_scales – The scale of each pixel in arc seconds
exposure_time_map – An arrays representing the effective exposure time of each pixel.
psf (PSF) – An arrays describing the PSF the simulated image is blurred with.
add_poisson_noise_to_data (Bool) – If True poisson noise_maps is simulated and added to the image, based on the total counts in each image pixel
noise_seed (int) – A seed for random noise_maps generation
- via_galaxies_from(galaxies, grid, xp=None)[source]#
Simulate imaging data for this data, as follows:
Setup the image-plane grid of the Imaging arrays, which defines the coordinates used for the ray-tracing.
Use this grid and the lens and source galaxies to setup a tracer, which generates the image of the simulated imaging data.
Simulate the imaging data, using a special image which ensures edge-effects don’t degrade simulator of the telescope optics (e.g. the PSF convolution).
Plot the image using Matplotlib, if the plot_imaging bool is True.
Output the dataset to .fits format if a dataset_path and data_name are specified. Otherwise, return the simulated imaging data instance.
- 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.
- via_source_image_from(tracer, grid, source_image)[source]#
Simulate an Interferometer 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 asymmetric 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 to compute 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 SimulatorInterferometer simulation process (e.g. PSF convolution, noise addition) are described in the SimulatorInterferometer __init__ method docstring.
- Parameters:
tracer (
Tracer) – The tracer, which describes the ray-tracing and strong lens configuration used to simulate the Interferometer dataset.grid (
Union[ndarray,Grid2D,Grid2DIrregular]) – The image-plane 2D grid of (y,x) coordinates 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.