Esempio n. 1
0
# imaging dataset.
imaging = simulator.from_tracer_and_grid(tracer=tracer, grid=grid)

# Lets plot the simulated imaging dataset before we output it to fits.
aplt.Imaging.subplot_imaging(imaging=imaging)

# Finally, lets output our simulated dataset to the dataset path as .fits files.
imaging.output_to_fits(
    image_path=dataset_path + "image.fits",
    psf_path=dataset_path + "psf.fits",
    noise_map_path=dataset_path + "noise_map.fits",
    overwrite=True,
)

plotter = aplt.Plotter(
    labels=aplt.Labels(title="Image"),
    output=aplt.Output(path=dataset_path, filename="image", format="png"),
)

aplt.Imaging.image(imaging=imaging, plotter=plotter)

plotter = aplt.Plotter(
    labels=aplt.Labels(title="Noise-Map"),
    output=aplt.Output(path=dataset_path, filename="noise_map", format="png"),
)

aplt.Imaging.noise_map(imaging=imaging, plotter=plotter)

plotter = aplt.Plotter(
    labels=aplt.Labels(title="PSF"),
    output=aplt.Output(path=dataset_path, filename="psf", format="png"),
Esempio n. 2
0
aplt.Galaxy.image(galaxy=fit.tracer.source_plane.galaxies[0], grid=source_plane_grid)

# %%
"""
As our fit and ray-tracing becomes more complex, it is useful to know how to decompose their different attributes to 
extract different things about them. For example, we made our source-galaxy above with two `LightProfile`'s, a 
`bulge` and `disk. We can plot the image of each component individually, if we know how to break-up the different 
components of the fit and `Tracer`.
"""

# %%
aplt.LightProfile.image(
    light_profile=fit.tracer.source_plane.galaxies[0].bulge,
    grid=source_plane_grid,
    plotter=aplt.Plotter(labels=aplt.Labels(title="Bulge image")),
)

aplt.LightProfile.image(
    light_profile=fit.tracer.source_plane.galaxies[0].disk,
    grid=source_plane_grid,
    plotter=aplt.Plotter(labels=aplt.Labels(title="Disk image")),
)

# %%
"""
And, we're done, not just with the tutorial, but the chapter!

To end, I want to quickly talk about code-design and structure. Yeah, I know, as a scientist, you don't like code 
and certainly don't want to think about code! However, the point is, with **PyAutoLens**, you don't need to!
                                        effective_radius=0.2),
    mass=al.mp.SphericalIsothermal(centre=(1.0, 0.0), einstein_radius=0.4),
)

print(lens_satellite)

# %%
"""
Lets have a quick look at the appearance of our lens galaxy and its satellite.
"""

# %%
aplt.Galaxy.image(
    galaxy=lens_galaxy,
    grid=grid,
    plotter=aplt.Plotter(labels=aplt.Labels(title="Lens Galaxy")),
)

aplt.Galaxy.image(
    galaxy=lens_satellite,
    grid=grid,
    plotter=aplt.Plotter(labels=aplt.Labels(title="Lens Satellite")),
)

# %%
"""
And their deflection angles - note that the satellite doesn`t contribute as much to the deflections.
"""

# %%
aplt.Galaxy.deflections_y(
Esempio n. 4
0
dataset_label = "slacs"
dataset_name = "slacs1430+4105"

# Create the path where the dataset will be loaded from, which in this case is
# '/autolens_workspace/dataset/imaging/slacs1430+4105/'
dataset_path = af.path_util.make_and_return_path_from_path_and_folder_names(
    path=workspace_path, folder_names=["dataset", dataset_label, dataset_name]
)
image_path = dataset_path + "image.fits"

# Now, lets load this arrays as a hyper arrays. A hyper arrays is an ordinary NumPy arrays, but it also includes a pixel
# scale which allows us to convert the axes of the arrays to arc-second coordinates.
image = al.array.from_fits(file_path=image_path, hdu=0, pixel_scales=0.03)

# We can now use an arrays plotter to plotters the image. Lets first plotters it using the default PyAutoLens setup.
plotter = aplt.Plotter(labels=aplt.Labels(title="SLACS1430+4105 Image"))
aplt.array(array=image, plotter=plotter)

# For a lens like SLACS1430+4105, the lens galaxy's light outshines the background source, making it appear faint.
# we can use a symmetric logarithmic colorbar normalization to better reveal the source galaxy (due to negative values
# in the image, we cannot use a logirithmic colorbar normalization).
plotter = aplt.Plotter(
    labels=aplt.Labels(title="SLACS1430+4105 Image"),
    cmap=aplt.ColorMap(norm="symmetric_log", linthresh=0.05, linscale=0.02),
)
aplt.array(array=image, plotter=plotter)

# Alternatively, we can use the default linear colorbar normalization and customize the limits over which the colormap
# spans its dynamic range.
plotter = aplt.Plotter(
    labels=aplt.Labels(title="SLACS1430+4105 Image"),
Esempio n. 5
0
    redshift=1.0,
    light=al.lp.EllipticalSersic(
        centre=(0.1, 0.1),
        axis_ratio=0.8,
        phi=60.0,
        intensity=0.3,
        effective_radius=1.0,
        sersic_index=2.5,
    ),
)

# Use these galaxies to setup a tracer, which will generate the image for the simulated interferometer dataset.
tracer = al.Tracer.from_galaxies(galaxies=[lens_galaxy, source_galaxy])

plotter = aplt.Plotter(
    labels=aplt.Labels(title="Image Before Fourier Transform"),
    output=aplt.Output(path=plot_path, filename="image_pre_ft", format="png"),
)

aplt.Tracer.profile_image(
    tracer=tracer, grid=masked_interferometer.grid, plotter=plotter
)

fit = al.FitInterferometer(masked_interferometer=masked_interferometer, tracer=tracer)

plotter = aplt.Plotter(
    labels=aplt.Labels(title="Model Visibilities"),
    output=aplt.Output(path=plot_path, filename="model_visibilities", format="png"),
)

aplt.FitInterferometer.model_visibilities(fit=fit, plotter=plotter)
# Lets look at a few contribution maps, generated using hyper-galaxy's with different contribution factors.

source_contribution_factor_1 = al.Galaxy(
    redshift=1.0,
    hyper_galaxy=al.HyperGalaxy(contribution_factor=1.0),
    hyper_galaxy_image=hyper_image,
    hyper_model_image=hyper_image,
)

contribution_map = source_contribution_factor_1.hyper_galaxy.contribution_map_from_hyper_images(
    hyper_model_image=hyper_image, hyper_galaxy_image=hyper_image)

aplt.array(
    array=contribution_map,
    mask=mask,
    plotter=aplt.Plotter(labels=aplt.Labels(title="Contribution Map")),
)

source_contribution_factor_3 = al.Galaxy(
    redshift=1.0,
    hyper_galaxy=al.HyperGalaxy(contribution_factor=3.0),
    hyper_galaxy_image=hyper_image,
    hyper_model_image=hyper_image,
)

contribution_map = source_contribution_factor_3.hyper_galaxy.contribution_map_from_hyper_images(
    hyper_model_image=hyper_image, hyper_galaxy_image=hyper_image)

aplt.array(
    array=contribution_map,
    mask=mask,
Esempio n. 7
0
    folder_names=["dataset", dataset_label, dataset_name, pipeline_name, phase_name],
)
residual_map_path = result_path + "/image/fits/fit_residual_map.fits"
chi_squared_map_path = result_path + "/image/fits/fit_chi_squared_map.fits"

# Now, lets load this arrays as a hyper arrays. A hyper arrays is an ordinary NumPy arrays, but it also includes a pixel
# scale which allows us to convert the axes of the arrays to arc-second coordinates.
image = al.array.from_fits(file_path=image_path, hdu=0, pixel_scales=0.03)

# Now, lets load this image as a hyper arrays. A hyper arrays is an ordinary NumPy arrays, but it also includes a pixel
# scale which allows us to convert the axes of the image to arc-second coordinates.
residual_map = al.array.from_fits(file_path=residual_map_path, hdu=0, pixel_scales=0.03)

# We can now use an arrays plotter to plotters the residual map.

plotter = aplt.Plotter(labels=aplt.Labels(title="SLACS1430+4105 Residual Map"))

aplt.array(array=residual_map, plotter=plotter)

# A useful way to really dig into the residuals is to set upper and lower limits on the normalization of the colorbar.

plotter = aplt.Plotter(
    labels=aplt.Labels(title="SLACS1430+4105 Residual Map"),
    cmap=aplt.ColorMap(norm_min=-0.02, norm_max=0.02),
)

aplt.array(array=residual_map, plotter=plotter)

# Or, alternatively, use a symmetric logarithmic colormap

plotter = aplt.Plotter(
Esempio n. 8
0
        centre=(0.1, 0.1),
        axis_ratio=0.8,
        phi=60.0,
        intensity=0.6,
        effective_radius=1.0,
        sersic_index=2.5,
    ),
)

# Use these galaxies to setup a tracer, which will generate the image for the simulated imaging dataset.
tracer = al.Tracer.from_galaxies(galaxies=[lens_galaxy, source_galaxy])

fit = al.FitImaging(masked_imaging=masked_imaging, tracer=tracer)

plotter = aplt.Plotter(
    labels=aplt.Labels(title="Residual Map"),
    output=aplt.Output(path=plot_path, filename="residual_map", format="png"),
)

aplt.FitImaging.residual_map(fit=fit, plotter=plotter)

plotter = aplt.Plotter(
    labels=aplt.Labels(title="Normalized Residual Map"),
    output=aplt.Output(path=plot_path,
                       filename="normalized_residual_map",
                       format="png"),
)

aplt.FitImaging.normalized_residual_map(fit=fit, plotter=plotter)

plotter = aplt.Plotter(
    hyper_image_source,  # <- The source get its own hyper-galaxy image.
)

fit = fit_masked_imaging_with_lens_and_source_galaxy(
    masked_imaging=masked_imaging,
    lens_galaxy=lens_galaxy,
    source_galaxy=source_magnification,
)

lens_contribution_map = lens_galaxy_hyper.hyper_galaxy.contribution_map_from_hyper_images(
    hyper_model_image=hyper_image, hyper_galaxy_image=hyper_image_lens)

aplt.array(
    array=lens_contribution_map,
    mask=mask,
    plotter=aplt.Plotter(labels=aplt.Labels(title="Lens Contribution Map")),
)

source_contribution_map = source_magnification_hyper.hyper_galaxy.contribution_map_from_hyper_images(
    hyper_model_image=hyper_image, hyper_galaxy_image=hyper_image_source)

aplt.array(
    array=source_contribution_map,
    mask=mask,
    plotter=aplt.Plotter(labels=aplt.Labels(title="Source Contribution Map")),
)

# The contribution maps decomposes the image into its different components. Next, we  use each contribution
# map to scale different regions of the noise-map. From the fit above it was clear that both the lens and source
# required the noise to be scaled, but their different chi-squared values ( > 150 and ~ 30) means they require different
# levels of noise-scaling. Lets see how much our fit improves and Bayesian evidence increases.
    for instance in instances
]

fits = [
    al.fit(masked_dataset=masked_imaging, tracer=tracer)
    for masked_imaging, tracer in zip(masked_imagings, tracers)
]

[aplt.fit_imaging.subplot_fit_imaging(fit=fit) for fit in fits]

# The benefit of inspecting fits using the aggregator, rather than the files outputs to the hard-disk, is that
# we can customize the plots using the PyAutoLens plotters.

plotter = aplt.Plotter(
    figure=aplt.Figure(figsize=(12, 12)),
    labels=aplt.Labels(title="Custom Image", titlesize=24, ysize=24, xsize=24),
    ticks=aplt.Ticks(ysize=24, xsize=24),
    cmap=aplt.ColorMap(norm="log", norm_max=1.0, norm_min=1.0),
    cb=aplt.ColorBar(ticksize=20),
    units=aplt.Units(in_kpc=True),
)

[
    aplt.fit_imaging.normalized_residual_map(fit=fit, plotter=plotter)
    for fit in fits
]

# Making this plot for a paper? You can output it to hard disk.

plotter = aplt.Plotter(output=aplt.Output(
    path=workspace_path + "/output/path/of/file/",
If not, you can customize a number of matplotlib setup options using a Plotter object in **PyAutoLens**.
"""

# %%
imaging = al.Imaging.from_fits(
    image_path=path.join(dataset_path, "image.fits"),
    noise_map_path=path.join(dataset_path, "noise_map.fits"),
    psf_path=path.join(dataset_path, "psf.fits"),
    pixel_scales=0.1,
)

plotter = aplt.Plotter(
    figure=aplt.Figure(figsize=(7, 7)),
    ticks=aplt.Ticks(ysize=8, xsize=8),
    labels=aplt.Labels(ysize=6, xsize=6, titlesize=12),
)

aplt.Imaging.image(imaging=imaging, plotter=plotter)

# %%
"""
Many matplotlib options can be customized, but for now we're only concerned with making sure figures display cleanly in 
your Jupter Notebooks. However, for future reference, a descrition of all options can be found in the file 
`autolens_workspace/plot/mat_objs.py`.

Ideally, we wouldn't need to specify a new `Plotter` every time we plot an image we make, especially as you'll be 
changing the same option to the same value over and over again (e.g. the figsize). Fortunately, the default values 
used by **PyAutoLens** can be fully customized.

Checkout the the file `autolens_workspace/config/visualize/figures.ini`.
Esempio n. 12
0
import autolens as al
import autolens.plot as aplt

### LENSING ####

# Strong lens modeling uses grids of (y,x) coordinates (e.g. in arc-seconds) to trace light-rays that are deflected by
# a strong lens galaxy. Before light is deflected, the grid of coordinates is the 'image-plane' grid.

# To begin, we make an image-plane grid with PyAutoLens. The grid below grid consists of 100 x 100 coordinates and has
# a pixel-to-arcsecond conversion scale of 0.05".

grid = al.grid.uniform(shape_2d=(100, 100), pixel_scales=0.05, sub_size=1)

aplt.grid(
    grid=grid,
    plotter=aplt.Plotter(labels=aplt.Labels(title="Image-Plane Uniform Grid")),
)

# To perform ray-tracing, we create a 'mass-profile'. A mass-profile is an analytic function that describes a
# distribution of mass and is used to derive its convergence, gravitational potential and most importantly its
# deflection angles, which describe how light is bent by the mass-profile's curvature of space-time.

sis_mass_profile = al.mp.EllipticalIsothermal(centre=(0.0, 0.0),
                                              axis_ratio=0.9,
                                              phi=45.0,
                                              einstein_radius=1.6)

mass_profile_deflections = sis_mass_profile.deflections_from_grid(grid=grid)

# The deflection angles trace the (y,x) grid from the image-plane to the source-plane (where the source appears
# unlensed). We can subtract the deflection angles from the image-plane grid to get the source-plane grid.
Esempio n. 13
0
# scale which allows us to convert the axes of the arrays to arc-second coordinates.
image = al.array.from_fits(file_path=image_path, hdu=0, pixel_scales=0.03)

# We can now use an arrays plotter to plotters the arrays. We customize the plotters as follows:

# 1) We make the arrays's figure size bigger than the default size (7,7).

# 2) Because the figure is bigger, we increase the size of the title, x and y labels / ticks from their default size of
#    16 to 24.

# 3) For the same reason, we increase the size of the colorbar ticks from the default value 10 to 20.

plotter = aplt.Plotter(
    figure=aplt.Figure(figsize=(12, 12)),
    labels=aplt.Labels(title="SLACS1430+4105 Image",
                       titlesize=24,
                       ysize=24,
                       xsize=24),
    ticks=aplt.Ticks(ysize=24, xsize=24),
    cmap=aplt.ColorMap(norm="cold", norm_max=0.8),
    cb=aplt.ColorBar(ticksize=20),
)

aplt.array(array=image, plotter=plotter)

# The colormap of the arrays can be changed to any of the standard matplotlib colormaps.

plotter = aplt.Plotter(labels=aplt.Labels(title="SLACS1430+4105 Image"),
                       cmap=aplt.ColorMap(cmap="spring"))

aplt.array(array=image, plotter=plotter)
Esempio n. 14
0
# Setup the path to the autolens_workspace, using a relative directory name.
plot_path = "{}/../images/interferometry/".format(
    os.path.dirname(os.path.realpath(__file__)))
dataset_path = "{}/dataset/".format(os.path.dirname(
    os.path.realpath(__file__)))

# This loads the interferometer dataset,.
interferometer = al.Interferometer.from_fits(
    visibilities_path=dataset_path + "visibilities.fits",
    noise_map_path=dataset_path + "noise_map.fits",
    uv_wavelengths_path=dataset_path + "uv_wavelengths.fits",
)

plotter = aplt.Plotter(
    labels=aplt.Labels(title="Visibilities"),
    output=aplt.Output(path=plot_path, filename="visibilities", format="png"),
)

aplt.Interferometer.visibilities(interferometer=interferometer,
                                 plotter=plotter)

plotter = aplt.Plotter(
    labels=aplt.Labels(title="UV-Wavelengths"),
    output=aplt.Output(path=plot_path, filename="uv_wavelengths",
                       format="png"),
)

aplt.Interferometer.visibilities(interferometer=interferometer,
                                 plotter=plotter)
Esempio n. 15
0
# source-plane locations and their light and mass profiles to perform lensing calculations.
tracer = al.Tracer.from_galaxies(
    galaxies=[lens_galaxy_0, lens_galaxy_1, source_galaxy])

# Ray-tracing calculations are performed using a (y,x) grid of Cartesian coordinates.
grid = al.Grid.uniform(shape_2d=(150, 150), pixel_scales=0.05)

# The tracer and grid are used to calculate the lens system's convergence, potential,
# deflection angles, image-plane image and source-plane image (see figure ?).
aplt.Tracer.profile_image(tracer=tracer,
                          grid=grid,
                          include=aplt.Include(critical_curves=True,
                                               caustics=True))

figures_path = "{}/../figures/".format(
    os.path.dirname(os.path.realpath(__file__)))

aplt.Tracer.profile_image(
    tracer=tracer,
    grid=grid,
    include=aplt.Include(critical_curves=True, caustics=True),
    plotter=aplt.Plotter(
        labels=aplt.Labels(title="Multi-Plane Strong Lens Image"),
        output=aplt.Output(
            path=figures_path + "/paper/",
            filename="figure_4_complex_source",
            format="png",
        ),
    ),
)
Esempio n. 16
0
    mass=al.mp.EllipticalIsothermal(
        centre=(0.0, 0.0), axis_ratio=0.8, phi=90.0, einstein_radius=1.6
    ),
)

tracer = al.Tracer.from_galaxies(galaxies=[lens_galaxy, al.Galaxy(redshift=1.0)])

source_plane_grid = tracer.traced_grids_of_planes_from_grid(grid=grid)[1]

# Next, lets set up a pixelization using the 'pixelizations' module, which we've imported as 'pix'.

# There are multiple pixelizations available in PyAutoLens. For now, we'll keep it simple and use a uniform
# rectangular grid. As usual, the grid's 'shape' defines its (y,x) dimensions.
rectangular = al.pix.Rectangular(shape=(25, 25))

# By itself, a pixelization doesn't tell us much. It has no grid of coordinates, no image, and nothing which tells it
# about the lens we're fitting. This information comes when we use the pixelization to set up a 'mapper'. We'll use
# the (traced) source-plane grid to set up this mapper.

mapper = rectangular.mapper_from_grid_and_sparse_grid(grid=source_plane_grid)

# Infact, we can plot the source-plane grid and rectangular pixelization grid on our pixelization - to make it look
# slightly less boring!
aplt.MapperObj(
    mapper=mapper,
    include=aplt.Include(inversion_grid=True, inversion_pixelization_grid=True),
    plotter=aplt.Plotter(
        labels=aplt.Labels(title="Slightly less Boring Grid of Rectangular Pixels")
    ),
)
Esempio n. 17
0
... and use this `Grid` to setup the source-plane
"""

# %%
source_plane = al.Plane(galaxies=[source_galaxy])

# %%
"""
Lets inspect our `Grid`'s - I bet our source-plane isn't the boring uniform `Grid` we plotted in the first tutorial!
"""

# %%
aplt.Plane.plane_grid(
    plane=image_plane,
    grid=image_plane_grid,
    plotter=aplt.Plotter(labels=aplt.Labels(title="Image-plane Grid")),
)

aplt.Plane.plane_grid(
    plane=source_plane,
    grid=source_plane_grid,
    plotter=aplt.Plotter(labels=aplt.Labels(title="Source-plane Grid")),
)

# %%
"""
We can zoom in on the `centre` of the source-plane (remembering the lens galaxy was centred at (0.1", 0.1")).
"""

# %%
aplt.Plane.plane_grid(
Esempio n. 18
0
import autolens as al
import autolens.plot as aplt
import os

plot_path = "{}/../images/lensing/".format(
    os.path.dirname(os.path.realpath(__file__)))

grid = al.Grid.uniform(shape_2d=(50, 50), pixel_scales=0.05)

sersic_light_profile = al.lp.EllipticalSersic(
    centre=(0.0, 0.0),
    axis_ratio=0.9,
    phi=60.0,
    intensity=0.05,
    effective_radius=2.0,
    sersic_index=4.0,
)

image = sersic_light_profile.profile_image_from_grid(grid=grid)

plotter = aplt.Plotter(
    labels=aplt.Labels(title="Image of Elliptical Sersic Light Profile"),
    output=aplt.Output(path=plot_path,
                       filename="sersic_light_profile",
                       format="png"),
)

aplt.LightProfile.profile_image(light_profile=sersic_light_profile,
                                grid=grid,
                                plotter=plotter)
Esempio n. 19
0
import autolens.plot as aplt

# In this example, we'll create grids of Cartesian (y,x) coordinates, representing the arc-second coordinate grid of
# an observed dataset (e.g. imaging).

# In PyAutoLens, a grid is a set of two-dimensional (y,x) coordinates (in arc-seconds) that are deflected
# and traced by a strong lens system.

# This coordinate grid is aligned with the image we analyze, such that each coordinate on a grid maps to the
# centre of each image-pixel. Lets make a grid using 100 x 100 pixels, with a pixel scale (arcsecond-to-pixel
# conversion factor) of 0.05", giving us a a 5" x 5" grid.
grid = al.grid.uniform(shape_2d=(100, 100), pixel_scales=0.05)

# First, lets plotters this grid, which shows that it is a fairly bland uniform grid of dots.

plotter = aplt.Plotter(labels=aplt.Labels(title="Fairly Bland Uniform Grid Of Dots"))

aplt.grid(grid=grid, plotter=plotter)

# We can print each coordinate of this grid, revealing that it consists of a set of arc-second coordinates
# (where the spacing between each coordinate corresponds to the 'pixel_scales' of 0.05" defined above)
print("(y,x) pixel 0:")
print(grid.in_2d[0, 0])
print("(y,x) pixel 1:")
print(grid.in_2d[0, 1])
print("(y,x) pixel 2:")
print(grid.in_2d[0, 2])
print("(y,x) pixel 100:")
print(grid.in_2d[1, 0])
print("etc.")
Esempio n. 20
0
import os

plot_path = "{}/../images/lensing/".format(os.path.dirname(os.path.realpath(__file__)))

grid = al.Grid.uniform(shape_2d=(50, 50), pixel_scales=0.05)

isothermal_mass_profile = al.mp.EllipticalIsothermal(
    centre=(0.0, 0.0), axis_ratio=0.8, phi=120.0, einstein_radius=1.6
)

convergence = isothermal_mass_profile.convergence_from_grid(grid=grid)
potential = isothermal_mass_profile.potential_from_grid(grid=grid)
deflections = isothermal_mass_profile.deflections_from_grid(grid=grid)

plotter = aplt.Plotter(
    labels=aplt.Labels(title="Image of Elliptical Isothermal Mass Profile Convergence"),
    output=aplt.Output(
        path=plot_path, filename="isothermal_mass_profile_convergence", format="png"
    ),
)

aplt.MassProfile.convergence(
    mass_profile=isothermal_mass_profile, grid=grid, plotter=plotter
)

plotter = aplt.Plotter(
    labels=aplt.Labels(title="Image of Elliptical Isothermal Mass Profile Potential"),
    output=aplt.Output(
        path=plot_path, filename="isothermal_mass_profile_potential", format="png"
    ),
)
Esempio n. 21
0
# %%
print(type(mapper))

# %%
"""
By plotting our mapper, we now see our _Pixelization_. Its a fairly boring _Grid_ of rectangular pixels.

(we'll cover what the 'inversion' means in a later tutorial).
"""

# %%
aplt.MapperObj(
    mapper=mapper,
    include=aplt.Include(inversion_grid=False,
                         inversion_pixelization_grid=False),
    plotter=aplt.Plotter(labels=aplt.Labels(
        title="Fairly Boring Grid of Rectangular Pixels")),
)

# %%
"""
However, the _Mapper_ does contain lots of interesting information about our _Pixelization_, for example its 
pixelization_grid tells us where the pixel centers are located.
"""

# %%
print("Rectangular Grid Pixel Centre 1:")
print(mapper.pixelization_grid[0])
print("Rectangular Grid Pixel Centre 2:")
print(mapper.pixelization_grid[1])
print("Rectangular Grid Pixel Centre 3:")
print(mapper.pixelization_grid[2])
Esempio n. 22
0
import autolens as al
import autolens.plot as aplt
import os

plot_path = "{}/../images/lensing/".format(
    os.path.dirname(os.path.realpath(__file__)))

grid = al.Grid.uniform(shape_2d=(50, 50), pixel_scales=0.05)

plotter = aplt.Plotter(
    labels=aplt.Labels(title="Cartesian Grid of (y,x) Coordinates"),
    output=aplt.Output(path=plot_path, filename="grid", format="png"),
)

aplt.Grid(grid=grid, plotter=plotter)