Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@plotters.set_labels
def signal_to_noise_map(fit, include=None, plotter=None):
"""Plot the noise-map of a lens fit.
Set *autolens.datas.array.plotters.plotters* for a description of all input parameters not described below.
Parameters
-----------
image : datas.imaging.datas.Imaging
The datas-datas, which include the observed datas, signal_to_noise_map, PSF, signal-to-signal_to_noise_map, etc.
origin : True
If true, the origin of the datas's coordinate system is plotted as a 'x'.
"""
plotter.plot_array(
array=fit.signal_to_noise_map,
mask=include.mask_from_fit(fit=fit),
light_profile_centres=include.light_profile_centres_from_obj(
@plotters.set_labels
def deflections_x(tracer, grid, include=None, plotter=None):
deflections = tracer.deflections_from_grid(grid=grid)
deflections_x = arrays.MaskedArray.manual_1d(
array=deflections.in_1d[:, 1], mask=grid.mask
)
plotter.plot_array(
array=deflections_x,
mask=include.mask_from_grid(grid=grid),
critical_curves=include.critical_curves_from_obj(obj=tracer),
light_profile_centres=include.light_profile_centres_from_obj(obj=tracer),
mass_profile_centres=include.mass_profile_centres_from_obj(obj=tracer),
include_origin=include.origin,
)
@plotters.set_labels
def deflections_y(tracer, grid, include=None, plotter=None):
deflections = tracer.deflections_from_grid(grid=grid)
deflections_y = arrays.MaskedArray.manual_1d(
array=deflections.in_1d[:, 0], mask=grid.mask
)
plotter.plot_array(
array=deflections_y,
mask=include.mask_from_grid(grid=grid),
critical_curves=include.critical_curves_from_obj(obj=tracer),
light_profile_centres=include.light_profile_centres_from_obj(obj=tracer),
mass_profile_centres=include.mass_profile_centres_from_obj(obj=tracer),
include_origin=include.origin,
)
@plotters.set_labels
def plane_grid(
plane,
grid,
indexes=None,
axis_limits=None,
positions=None,
critical_curves=None,
caustics=None,
include=None,
plotter=None,
):
plotter.plot_grid(
grid=grid,
positions=positions,
axis_limits=axis_limits,
@plotters.set_labels
def deflections_y(plane, grid, include=None, plotter=None):
deflections = plane.deflections_from_grid(grid=grid)
deflections_y = grid.mapping.array_stored_1d_from_sub_array_1d(
sub_array_1d=deflections[:, 0]
)
plotter.plot_array(
array=deflections_y,
mask=include.mask_from_grid(grid=grid),
critical_curves=include.critical_curves_from_obj(obj=plane),
light_profile_centres=include.light_profile_centres_from_obj(obj=plane),
mass_profile_centres=include.mass_profile_centres_from_obj(obj=plane),
include_origin=include.origin,
)
@plotters.set_labels
def reconstructed_image(
inversion,
image_positions=None,
grid=None,
light_profile_centres=None,
mass_profile_centres=None,
critical_curves=None,
include=None,
plotter=None,
):
plotter.plot_array(
array=inversion.mapped_reconstructed_image,
mask=include.mask_from_grid(grid=inversion.mapper.grid),
positions=image_positions,
grid=grid,
@plotters.set_labels
def image_and_source_plane_subplot(
image_plane,
source_plane,
grid,
indexes=None,
positions=None,
axis_limits=None,
include=None,
sub_plotter=None,
):
number_subplots = 2
sub_plotter.open_subplot_figure(number_subplots=number_subplots)
sub_plotter.setup_subplot(number_subplots=number_subplots, subplot_index=1)
@plotters.set_labels
def reconstruction(
inversion,
source_positions=None,
caustics=None,
image_pixel_indexes=None,
source_pixel_indexes=None,
include=None,
plotter=None,
):
source_pixel_values = inversion.mapper.reconstructed_pixelization_from_solution_vector(
solution_vector=inversion.reconstruction
)
plotter.plot_mapper(
mapper=inversion.mapper,
@plotters.set_labels
def plane_image(plane, grid, positions=None, caustics=None, include=None, plotter=None):
plotter.plot_array(
array=plane.plane_image_from_grid(grid=grid).array,
positions=positions,
caustics=caustics,
grid=include.grid_from_grid(grid=grid),
light_profile_centres=include.light_profile_centres_from_obj(obj=plane),
mass_profile_centres=include.mass_profile_centres_from_obj(obj=plane),
include_origin=include.origin,
)