Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if galaxy_data.use_image:
title = "Galaxy Data Image"
elif galaxy_data.use_convergence:
title = "Galaxy Data Convergence"
elif galaxy_data.use_potential:
title = "Galaxy Data Potential"
elif galaxy_data.use_deflections_y:
title = "Galaxy Data Deflections (y)"
elif galaxy_data.use_deflections_x:
title = "Galaxy Data Deflections (x)"
else:
raise exc.PlottingException(
"The galaxy data_type array does not have a True use_profile_type"
)
aa.plot_array(
array=galaxy_data.image(return_in_2d=True),
mask_overlay=mask,
positions=positions,
as_subplot=as_subplot,
units=units,
kpc_per_arcsec=kpc_per_arcsec,
figsize=figsize,
aspect=aspect,
cmap=cmap,
norm=norm,
norm_min=norm_min,
norm_max=norm_max,
linthresh=linthresh,
linscale=linscale,
cb_ticksize=cb_ticksize,
cb_fraction=cb_fraction,
galaxy : model.galaxy.galaxy.Galaxy
The galaxy whose y deflecton angles are plotted.
grid : ndarray or datas.array.grid_stacks.Grid
The (y,x) coordinates of the grid, in an array of shape (total_coordinates, 2)
"""
deflections = galaxy.deflections_from_grid(grid)
deflections_y = grid.mask.mapping.scaled_array_2d_from_array_1d(deflections[:, 0])
lines = aa.plotter_util.get_critical_curve_and_caustic(
obj=galaxy,
grid=grid,
plot_critical_curve=plot_critical_curves,
plot_caustics=plot_caustics,
)
aa.plot_array(
array=deflections_y,
mask_overlay=mask,
positions=positions,
lines=lines,
as_subplot=as_subplot,
units=units,
kpc_per_arcsec=kpc_per_arcsec,
figsize=figsize,
aspect=aspect,
cmap=cmap,
norm=norm,
norm_min=norm_min,
norm_max=norm_max,
linthresh=linthresh,
linscale=linscale,
cb_ticksize=cb_ticksize,
output_filename="image",
):
"""Plot the image of a light profile, on a grid of (y,x) coordinates.
Set *autolens.hyper_galaxies.array.plotters.array_plotters* for a description of all innput parameters not described below.
Parameters
-----------
light_profile : model.profiles.light_profiles.LightProfile
The light profile whose image are plotted.
grid : ndarray or hyper_galaxies.array.grid_stacks.Grid
The (y,x) coordinates of the grid, in an array of shape (total_coordinates, 2)
"""
image = light_profile.profile_image_from_grid(grid=grid)
aa.plot_array(
array=image,
mask_overlay=mask,
positions=positions,
as_subplot=as_subplot,
units=units,
kpc_per_arcsec=kpc_per_arcsec,
figsize=figsize,
aspect=aspect,
cmap=cmap,
norm=norm,
norm_min=norm_min,
norm_max=norm_max,
linthresh=linthresh,
linscale=linscale,
cb_ticksize=cb_ticksize,
cb_fraction=cb_fraction,
):
"""Plot the image of a lens fit.
Set *autolens.datas.array.plotters.array_plotters* for a description of all input parameters not described below.
Parameters
-----------
image : datas.imaging.datas.Imaging
The datas-datas, which includes the observed datas, noise_map-map, PSF, signal-to-noise_map-map, etc.
plot_origin : True
If true, the origin of the datas's coordinate system is plotted as a 'x'.
"""
image = fit.image.in_2d
aa.plot_array(
array=image,
grid=grid,
mask_overlay=mask,
positions=positions,
as_subplot=as_subplot,
units=units,
kpc_per_arcsec=kpc_per_arcsec,
figsize=figsize,
aspect=aspect,
cmap=cmap,
norm=norm,
norm_min=norm_min,
norm_max=norm_max,
linthresh=linthresh,
linscale=linscale,
cb_ticksize=cb_ticksize,
ylabelsize=16,
xyticksize=16,
output_path=None,
output_format="show",
output_filename="pixelization_source_values",
):
if isinstance(inversion.mapper, mappers.RectangularMapper):
reconstructed_pixelization = inversion.mapper.reconstructed_pixelization_from_solution_vector(
solution_vector=source_pixel_values
)
origin = get_origin(image=reconstructed_pixelization, plot_origin=plot_origin)
aa.plot_array(
array=reconstructed_pixelization,
should_plot_origin=origin,
positions=positions,
as_subplot=True,
units=units,
kpc_per_arcsec=kpc_per_arcsec,
figsize=figsize,
aspect=aspect,
cmap=cmap,
norm=norm,
norm_min=norm_min,
norm_max=norm_max,
linthresh=linthresh,
linscale=linscale,
cb_ticksize=cb_ticksize,
cb_fraction=cb_fraction,
-----------
mass_profile : model.profiles.mass_profiles.MassProfile
The mass profile whose magnification is plotted.
grid : ndarray or hyper_galaxies.array.grid_stacks.Grid
The (y,x) coordinates of the grid, in an array of shape (total_coordinates, 2)
"""
magnification = mass_profile.magnification_from_grid(grid=grid)
lines = aa.plotter_util.get_critical_curve_and_caustic(
obj=mass_profile,
grid=grid,
plot_critical_curve=plot_critical_curves,
plot_caustics=plot_caustics,
)
aa.plot_array(
array=magnification,
mask_overlay=mask,
positions=positions,
lines=lines,
as_subplot=as_subplot,
units=units,
kpc_per_arcsec=kpc_per_arcsec,
figsize=figsize,
aspect=aspect,
cmap=cmap,
norm=norm,
norm_min=norm_min,
norm_max=norm_max,
linthresh=linthresh,
linscale=linscale,
cb_ticksize=cb_ticksize,
):
"""Plot the noise-map of a lens fit.
Set *autolens.datas.array.plotters.array_plotters* for a description of all input parameters not described below.
Parameters
-----------
image : datas.imaging.datas.Imaging
The datas-datas, which includes the observed datas, noise_map-map, PSF, signal-to-noise_map-map, etc.
plot_origin : True
If true, the origin of the datas's coordinate system is plotted as a 'x'.
"""
noise_map = fit.noise_map.in_2d
aa.plot_array(
array=noise_map,
mask_overlay=mask,
positions=positions,
as_subplot=as_subplot,
units=units,
kpc_per_arcsec=kpc_per_arcsec,
figsize=figsize,
aspect=aspect,
cmap=cmap,
norm=norm,
norm_min=norm_min,
norm_max=norm_max,
linthresh=linthresh,
linscale=linscale,
cb_ticksize=cb_ticksize,
cb_fraction=cb_fraction,