Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"""
mask = plotter_util.get_mask_from_fit(fit=fit, mask=mask)
if len(fit.contribution_maps) > 1:
contribution_map = sum(fit.contribution_maps)
else:
contribution_map = fit.contribution_maps[0]
positions = lens_plotter_util.get_positions_from_fit(fit=fit, positions=positions)
unit_label, unit_conversion_factor = lens_plotter_util.get_unit_label_and_unit_conversion_factor(
obj=fit.tracer.image_plane, plot_in_kpc=plot_in_kpc
)
aa.plot.array(
array=contribution_map,
mask=mask,
points=positions,
as_subplot=as_subplot,
unit_label=unit_label,
unit_conversion_factor=unit_conversion_factor,
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,
include_mass_profile_centres=include_mass_profile_centres, fit=fit
)
unit_label, unit_conversion_factor = lens_plotter_util.get_unit_label_and_unit_conversion_factor(
obj=fit.tracer.image_plane, plot_in_kpc=plot_in_kpc
)
positions = lens_plotter_util.get_positions_from_fit(fit=fit, positions=positions)
critical_curves = lens_plotter_util.get_critical_curves_and_caustics_from_lensing_object(
obj=fit.tracer,
include_critical_curves=include_critical_curves,
include_caustics=False,
)
aa.plot.array(
array=fit.model_images_of_planes[plane_index],
mask=mask,
lines=critical_curves,
points=positions,
centres=centres,
as_subplot=as_subplot,
unit_label=unit_label,
unit_conversion_factor=unit_conversion_factor,
figsize=figsize,
aspect=aspect,
cmap=cmap,
norm=norm,
norm_min=norm_min,
norm_max=norm_max,
linthresh=linthresh,
linscale=linscale,
deflections = plane.deflections_from_grid(grid=grid)
deflections_x = grid.mapping.array_stored_1d_from_sub_array_1d(
sub_array_1d=deflections[:, 1]
)
lines = lens_plotter_util.get_critical_curves_and_caustics_from_lensing_object(
obj=plane,
include_critical_curves=include_critical_curves,
include_caustics=include_caustics,
)
unit_label, unit_conversion_factor = lens_plotter_util.get_unit_label_and_unit_conversion_factor(
obj=plane, plot_in_kpc=plot_in_kpc
)
aa.plot.array(
array=deflections_x,
mask=mask,
lines=lines,
as_subplot=as_subplot,
unit_label=unit_label,
unit_conversion_factor=unit_conversion_factor,
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,
output_format="show",
output_filename="hyper_model_image",
):
"""Plot the image of a hyper_galaxies model image.
Set *autolens.datas.arrays.plotters.array_plotters* for a description of all input parameters not described below.
Parameters
-----------
hyper_model_image : datas.imaging.datas.Imaging
The hyper_galaxies model image.
origin : True
If true, the origin of the datas's coordinate system is plotted as a 'x'.
"""
aa.plot.array(
array=hyper_model_image,
mask=mask,
grid=image_plane_pix_grid,
points=positions,
as_subplot=as_subplot,
unit_label=unit_label,
unit_conversion_factor=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_format="show",
output_filename="hyper_noise_map",
):
"""Plot the image of a hyper_galaxies galaxy image.
Set *autolens.datas.arrays.plotters.array_plotters* for a description of all input parameters not described below.
Parameters
-----------
hyper_noise_map : datas.imaging.datas.Imaging
The hyper_galaxies galaxy image.
origin : True
If true, the origin of the datas's coordinate system is plotted as a 'x'.
"""
aa.plot.array(
array=hyper_noise_map,
mask=mask,
grid=image_plane_pix_grid,
points=positions,
as_subplot=as_subplot,
unit_label=unit_label,
unit_conversion_factor=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,
if include_grid:
grid = plane_image.grid
else:
grid = None
if origin:
origin = plane_image.grid.origin
else:
origin = None
unit_label, unit_conversion_factor = lens_plotter_util.get_unit_label_and_unit_conversion_factor(
obj=plane, plot_in_kpc=plot_in_kpc
)
aa.plot.array(
array=plane_image.array,
origin=origin,
points=positions,
grid=grid,
lines=lines,
as_subplot=as_subplot,
unit_label=unit_label,
unit_conversion_factor=unit_conversion_factor,
figsize=figsize,
aspect=aspect,
cmap=cmap,
norm=norm,
norm_min=norm_min,
norm_max=norm_max,
linthresh=linthresh,
linscale=linscale,
output_format="show",
output_filename="chi_squared_map",
):
"""Plot the image of a hyper_galaxies galaxy image.
Set *autolens.datas.arrays.plotters.array_plotters* for a description of all input parameters not described below.
Parameters
-----------
chi_squared_map : datas.imaging.datas.Imaging
The hyper_galaxies galaxy image.
origin : True
If true, the origin of the datas's coordinate system is plotted as a 'x'.
"""
aa.plot.array(
array=chi_squared_map,
mask=mask,
grid=image_plane_pix_grid,
points=positions,
as_subplot=as_subplot,
unit_label=unit_label,
unit_conversion_factor=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_format="show",
output_filename="contribution_map",
):
"""Plot the image of a hyper_galaxies galaxy image.
Set *autolens.datas.arrays.plotters.array_plotters* for a description of all input parameters not described below.
Parameters
-----------
contribution_map : datas.imaging.datas.Imaging
The hyper_galaxies galaxy image.
origin : True
If true, the origin of the datas's coordinate system is plotted as a 'x'.
"""
aa.plot.array(
array=contribution_map,
mask=mask,
grid=image_plane_pix_grid,
points=positions,
as_subplot=as_subplot,
unit_label=unit_label,
unit_conversion_factor=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,