Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@lensing_plotters.set_include_and_plotter
@plotters.set_labels
def normalized_residual_map(fit, include=None, plotter=None):
"""Plot the residual-map of a lens fit.
Set *autolens.datas.array.plotters.plotters* for a description of all input parameters not described below.
Parameters
-----------
fit : datas.fitting.fitting.AbstractFitter
The fit to the datas, which include a list of every model image, normalized_residual_map, chi-squareds, etc.
image_index : int
The index of the datas in the datas-set of which the normalized_residual_map are plotted.
"""
plotter.plot_array(
array=fit.normalized_residual_map,
mask=include.mask_from_fit(fit=fit),
@lensing_plotters.set_include_and_plotter
@plotters.set_labels
def chi_squared_map(fit, include=None, plotter=None):
"""Plot the chi-squared map of a lens fit.
Set *autolens.datas.array.plotters.plotters* for a description of all input parameters not described below.
Parameters
-----------
fit : datas.fitting.fitting.AbstractFitter
The fit to the datas, which include a list of every model image, residual_map, chi-squareds, etc.
image_index : int
The index of the datas in the datas-set of which the chi-squareds are plotted.
"""
plotter.plot_array(
array=fit.chi_squared_map,
mask=include.mask_from_fit(fit=fit),
@lensing_plotters.set_include_and_plotter
@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,
)
@lensing_plotters.set_include_and_plotter
@plotters.set_labels
def image(tracer, grid, positions=None, include=None, plotter=None):
plotter.plot_array(
array=tracer.image_from_grid(grid=grid),
mask=include.mask_from_grid(grid=grid),
positions=positions,
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,
)
@lensing_plotters.set_include_and_plotter
@plotters.set_labels
def contribution_map(tracer, mask=None, positions=None, include=None, plotter=None):
plotter.plot_array(
array=tracer.contribution_map,
mask=mask,
positions=positions,
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,
)
@lensing_plotters.set_include_and_plotter
@plotters.set_labels
def convergence(tracer, grid, include=None, plotter=None):
plotter.plot_array(
array=tracer.convergence_from_grid(grid=grid),
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,
)
@lensing_plotters.set_include_and_plotter
@plotters.set_labels
def subtracted_image_of_plane(fit, plane_index, include=None, plotter=None):
"""Plot the model image of a specific plane of a lens fit.
Set *autolens.datas.arrays.plotters.plotters* for a description of all input parameters not described below.
Parameters
-----------
fit : datas.fitting.fitting.AbstractFitter
The fit to the datas, which includes a list of every model image, residual_map, chi-squareds, etc.
image_index : int
The index of the datas in the datas-set of which the model image is plotted.
plane_indexes : int
The plane from which the model image is generated.
"""
@lensing_plotters.set_include_and_plotter
@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,
)