def __init__(self, redshift, galaxies, grid_stack, border, compute_deflections, cosmology=cosmo.Planck15):

super(AbstractGriddedPlane, self).__init__(redshift=redshift, galaxies=galaxies, cosmology=cosmology)<EOL>self.grid_stack = grid_stack<EOL>self.border = border<EOL>if compute_deflections:<EOL><INDENT>def calculate_deflections(grid):<EOL><INDENT>if galaxies:<EOL><INDENT>return sum(map(lambda galaxy: galaxy.deflections_from_grid(grid), galaxies))<EOL><DEDENT>else:<EOL><INDENT>return np.full((grid.shape[<NUM_LIT:0>], <NUM_LIT:2>), <NUM_LIT:0.0>)<EOL><DEDENT><DEDENT>self.deflection_stack = self.grid_stack.apply_function(calculate_deflections)<EOL><DEDENT>else:<EOL><INDENT>self.deflection_stack = None<EOL><DEDENT>

An abstract plane which represents a set of galaxies that are close to one another in redshift-space and \
        have an associated grid on which lensing calcuations are performed.

        From an abstract plane grid, the surface-density, potential and deflection angles of the galaxies can be \
        computed.

        Parameters
        -----------
        redshift : float or None
            The redshift of the plane.
        galaxies : [Galaxy]
            The list of lens galaxies in this plane.
        grid_stack : masks.GridStack
            The stack of grid_stacks of (y,x) arc-second coordinates of this plane.
        border : masks.RegularGridBorder
            The borders of the regular-grid, which is used to relocate demagnified traced regular-pixel to the \
            source-plane borders.
        compute_deflections : bool
            If true, the deflection-angles of this plane's coordinates are calculated use its galaxy's mass-profiles.
        cosmology : astropy.cosmology
            The cosmology associated with the plane, used to convert arc-second coordinates to physical values.


def minus(grid, deflections):<EOL><INDENT>return grid - deflections<EOL><DEDENT>return self.grid_stack.map_function(minus, self.deflection_stack)<EOL>

Trace this plane's grid_stacks to the next plane, using its deflection angles.


return np.linspace(np.amin(self.grid_stack.regular[:, <NUM_LIT:0>]), np.amax(self.grid_stack.regular[:, <NUM_LIT:0>]), <NUM_LIT:4>)<EOL>

Compute the yticks labels of this grid_stack, used for plotting the y-axis ticks when visualizing an image \


return np.linspace(np.amin(self.grid_stack.regular[:, <NUM_LIT:1>]), np.amax(self.grid_stack.regular[:, <NUM_LIT:1>]), <NUM_LIT:4>)<EOL>

Compute the xticks labels of this grid_stack, used for plotting the x-axis ticks when visualizing an \
        image


def __init__(self, galaxies, grid_stack, border=None, compute_deflections=True, cosmology=cosmo.Planck15):

if not galaxies:<EOL><INDENT>raise exc.RayTracingException('<STR_LIT>')<EOL><DEDENT>galaxy_redshifts = [galaxy.redshift for galaxy in galaxies]<EOL>if any([redshift is not None for redshift in galaxy_redshifts]):<EOL><INDENT>if not all([galaxies[<NUM_LIT:0>].redshift == galaxy.redshift for galaxy in galaxies]):<EOL><INDENT>raise exc.RayTracingException('<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT><DEDENT>super(Plane, self).__init__(redshift=galaxies[<NUM_LIT:0>].redshift, galaxies=galaxies, grid_stack=grid_stack,<EOL>border=border, compute_deflections=compute_deflections, cosmology=cosmology)<EOL>

A plane of galaxies where all galaxies are at the same redshift.

        Parameters
        -----------
        galaxies : [Galaxy]
            The list of lens galaxies in this plane.
        grid_stack : masks.GridStack
            The stack of grid_stacks of (y,x) arc-second coordinates of this plane.
        border : masks.RegularGridBorder
            The borders of the regular-grid, which is used to relocate demagnified traced regular-pixel to the \
            source-plane borders.
        compute_deflections : bool
            If true, the deflection-angles of this plane's coordinates are calculated use its galaxy's mass-profiles.
        cosmology : astropy.cosmology
            The cosmology associated with the plane, used to convert arc-second coordinates to physical values.


def unmasked_blurred_image_of_galaxies_from_psf(self, padded_grid_stack, psf):

return [padded_grid_stack.unmasked_blurred_image_from_psf_and_unmasked_image(<EOL>psf, image) if not galaxy.has_pixelization else None for galaxy, image in<EOL>zip(self.galaxies, self.image_plane_image_1d_of_galaxies)]<EOL>

This is a utility function for the function above, which performs the iteration over each plane's galaxies \
        and computes each galaxy's unmasked blurred image.

        Parameters
        ----------
        padded_grid_stack
        psf : ccd.PSF
            The PSF of the image used for convolution.


def __init__(self, galaxies, grid_stack, redshift, border=None, compute_deflections=True, cosmology=cosmo.Planck15):

super(PlaneSlice, self).__init__(redshift=redshift, galaxies=galaxies, grid_stack=grid_stack, border=border,<EOL>compute_deflections=compute_deflections, cosmology=cosmology)<EOL>

A plane of galaxies where the galaxies may be at different redshifts to the plane itself.

        Parameters
        -----------
        galaxies : [Galaxy]
            The list of lens galaxies in this plane.
        grid_stack : masks.GridStack
            The stack of grid_stacks of (y,x) arc-second coordinates of this plane.
        border : masks.RegularGridBorder
            The borders of the regular-grid, which is used to relocate demagnified traced regular-pixel to the \
            source-plane borders.
        compute_deflections : bool
            If true, the deflection-angles of this plane's coordinates are calculated use its galaxy's mass-profiles.
        cosmology : astropy.cosmology
            The cosmology associated with the plane, used to convert arc-second coordinates to physical values.


def __init__(self, redshift, galaxies, positions, compute_deflections=True, cosmology=None):

self.redshift = redshift<EOL>self.galaxies = galaxies<EOL>self.positions = positions<EOL>if compute_deflections:<EOL><INDENT>def calculate_deflections(pos):<EOL><INDENT>return sum(map(lambda galaxy: galaxy.deflections_from_grid(pos), galaxies))<EOL><DEDENT>self.deflections = list(map(lambda pos: calculate_deflections(pos), self.positions))<EOL><DEDENT>self.cosmology = cosmology<EOL>

A plane represents a set of galaxies at a given redshift in a ray-tracer_normal and the positions of image-plane \
        coordinates which mappers close to one another in the source-plane.

        Parameters
        -----------
        galaxies : [Galaxy]
            The list of lens galaxies in this plane.
        positions : [[[]]]
            The (y,x) arc-second coordinates of image-plane pixels which (are expected to) mappers to the same
            location(s) in the final source-plane.
        compute_deflections : bool
            If true, the deflection-angles of this plane's coordinates are calculated use its galaxy's mass-profiles.


return list(map(lambda positions, deflections: np.subtract(positions, deflections),<EOL>self.positions, self.deflections))<EOL>


@wraps(func)<EOL>def wrapper(self):<EOL><INDENT>"""<STR_LIT>"""<EOL>if self.has_light_profile is True:<EOL><INDENT>return func(self)<EOL><DEDENT>else:<EOL><INDENT>return None<EOL><DEDENT><DEDENT>return wrapper<EOL>

If none of the tracer's galaxies have a light profile, it image-plane image cannot be computed. This wrapper \
    makes this property return *None*.

    Parameters
    ----------
    func : (self) -> Object
        A property function that requires galaxies to have a mass profile.


@wraps(func)<EOL>def wrapper(self):<EOL><INDENT>"""<STR_LIT>"""<EOL>if self.has_mass_profile is True:<EOL><INDENT>return func(self)<EOL><DEDENT>else:<EOL><INDENT>return None<EOL><DEDENT><DEDENT>return wrapper<EOL>

If none of the tracer's galaxies have a mass profile, it surface density, potential and deflections cannot \
    be computed. This wrapper makes these properties return *None*.

    Parameters
    ----------
    func : (self) -> Object
        A property function that requires galaxies to have a mass profile.


def __init__(self, plane_redshifts, cosmology):

self.plane_redshifts = plane_redshifts<EOL>self.cosmology = cosmology<EOL>

Abstract Ray tracer for lens systems with any number of planes.

        From the galaxies of the tracer's planes, their grid-stack(s) and the cosmology physically derived quantities \
        (e.g. surface density, angular diameter distances, critical surface densities) can be computed.

        Parameters
        ----------
        plane_redshifts : [pl.Plane] or [pl.PlaneStack]
            The list of the tracer's planes in ascending redshift order.
        cosmology : astropy.cosmology
            The cosmology of the ray-tracing calculation.


self.planes = planes<EOL>super(AbstractTracer, self).__init__(plane_redshifts=[plane.redshift for plane in self.planes],<EOL>cosmology=cosmology)<EOL>

Abstract Ray tracer for lens systems with any number of planes.

        From the galaxies of the tracer's planes, their grid-stack(s) and the cosmology physically derived quantities \
        (e.g. surface density, angular diameter distances, critical surface densities) can be computed.

        Parameters
        ----------
        planes : [pl.Plane] or [pl.PlaneStack]
            The list of the tracer's planes in ascending redshift order.
        cosmology : astropy.cosmology
            The cosmology of the ray-tracing calculation.


def grid_at_redshift_from_image_plane_grid_and_redshift(self, image_plane_grid, redshift):

<EOL>image_plane_grid_stack = grids.GridStack(regular=image_plane_grid, sub=np.array([[<NUM_LIT:0.0>, <NUM_LIT:0.0>]]),<EOL>blurring=np.array([[<NUM_LIT:0.0>, <NUM_LIT:0.0>]]))<EOL>tracer = TracerMultiPlanes(galaxies=self.galaxies, image_plane_grid_stack=image_plane_grid_stack,<EOL>border=None, cosmology=self.cosmology)<EOL>for plane_index in range(<NUM_LIT:0>, len(self.plane_redshifts)):<EOL><INDENT>new_grid_stack = image_plane_grid_stack<EOL>if redshift <= tracer.plane_redshifts[plane_index]:<EOL><INDENT>if plane_index > <NUM_LIT:0>:<EOL><INDENT>for previous_plane_index in range(plane_index):<EOL><INDENT>scaling_factor = cosmology_util.scaling_factor_between_redshifts_from_redshifts_and_cosmology(<EOL>redshift_0=tracer.plane_redshifts[previous_plane_index], redshift_1=redshift,<EOL>redshift_final=tracer.plane_redshifts[-<NUM_LIT:1>], cosmology=tracer.cosmology)<EOL>scaled_deflection_stack = lens_util.scaled_deflection_stack_from_plane_and_scaling_factor(<EOL>plane=tracer.planes[previous_plane_index], scaling_factor=scaling_factor)<EOL>new_grid_stack =lens_util.grid_stack_from_deflection_stack(grid_stack=new_grid_stack,<EOL>deflection_stack=scaled_deflection_stack)<EOL><DEDENT><DEDENT>elif plane_index == <NUM_LIT:0>:<EOL><INDENT>return new_grid_stack.regular<EOL><DEDENT>return new_grid_stack.regular<EOL><DEDENT><DEDENT>

For an input grid of (y,x) arc-second image-plane coordinates, ray-trace the coordinates to any redshift in \
        the strong lens configuration.

        This is performed using multi-plane ray-tracing and the existing redshifts and planes of the tracer. However, \
        any redshift can be input even if a plane does not exist there, including redshifts before the first plane \
        of the lensing system.

        Parameters
        ----------
        image_plane_grid : ndsrray or grids.RegularGrid
            The image-plane grid which is traced to the redshift.
        redshift : float
            The redshift the image-plane grid is traced to.


def __init__(self, lens_galaxies, image_plane_grid_stack, border=None, cosmology=cosmo.Planck15,<EOL>units_distance='<STR_LIT>', units_luminosity='<STR_LIT>', units_mass='<STR_LIT>'):

if not lens_galaxies:<EOL><INDENT>raise exc.RayTracingException('<STR_LIT>')<EOL><DEDENT>image_plane = pl.Plane(galaxies=lens_galaxies, grid_stack=image_plane_grid_stack, border=border,<EOL>compute_deflections=True, cosmology=cosmology)<EOL>super(TracerImagePlane, self).__init__(planes=[image_plane], cosmology=cosmology)<EOL>

Ray tracer for a lens system with just an image-plane.

        As there is only 1 plane, there are no ray-tracing calculations. This class is therefore only used for fitting \
        image-plane galaxies with light profiles.

        This tracer has only one grid-stack (see grid_stack.GridStack) which is used for ray-tracing.

        Parameters
        ----------
        lens_galaxies : [Galaxy]
            The list of lens galaxies in the image-plane.
        image_plane_grid_stack : grid_stacks.GridStack
            The image-plane grid stack which is traced. (includes the regular-grid, sub-grid, blurring-grid, etc.).
        border : masks.RegularGridBorder
            The border of the regular-grid, which is used to relocate demagnified traced pixels to the \
            source-plane borders.
        cosmology : astropy.cosmology
            The cosmology of the ray-tracing calculation.


def __init__(self, lens_galaxies, source_galaxies, image_plane_grid_stack, border=None, cosmology=cosmo.Planck15):

image_plane_grid_stack = pix.setup_image_plane_pixelization_grid_from_galaxies_and_grid_stack(<EOL>galaxies=source_galaxies, grid_stack=image_plane_grid_stack)<EOL>image_plane = pl.Plane(galaxies=lens_galaxies, grid_stack=image_plane_grid_stack, border=border,<EOL>compute_deflections=True, cosmology=cosmology)<EOL>source_plane_grid_stack = image_plane.trace_grid_stack_to_next_plane()<EOL>source_plane = pl.Plane(galaxies=source_galaxies, grid_stack=source_plane_grid_stack, border=border,<EOL>compute_deflections=False, cosmology=cosmology)<EOL>super(TracerImageSourcePlanes, self).__init__(planes=[image_plane, source_plane], cosmology=cosmology)<EOL>

Ray-tracer for a lens system with two planes, an image-plane and source-plane.

        This tracer has only one grid-stack (see grid_stack.GridStack) which is used for ray-tracing.

        Parameters
        ----------
        lens_galaxies : [Galaxy]
            The list of galaxies in the image-plane.
        source_galaxies : [Galaxy]
            The list of galaxies in the source-plane.
        image_plane_grid_stack : grid_stacks.GridStack
            The image-plane grid stack which is traced. (includes the regular-grid, sub-grid, blurring-grid, etc.).
        border : masks.RegularGridBorder
            The border of the regular-grid, which is used to relocate demagnified traced pixels to the \
            source-plane borders.
        cosmology : astropy.cosmology.Planck15
            The cosmology of the ray-tracing calculation.


def __init__(self, galaxies, image_plane_grid_stack, border=None, cosmology=cosmo.Planck15):

plane_redshifts = lens_util.ordered_plane_redshifts_from_galaxies(galaxies=galaxies)<EOL>galaxies_in_planes =lens_util.galaxies_in_redshift_ordered_planes_from_galaxies(galaxies=galaxies,<EOL>plane_redshifts=plane_redshifts)<EOL>image_plane_grid_stack = pix.setup_image_plane_pixelization_grid_from_galaxies_and_grid_stack(<EOL>galaxies=galaxies, grid_stack=image_plane_grid_stack)<EOL>planes = []<EOL>for plane_index in range(<NUM_LIT:0>, len(plane_redshifts)):<EOL><INDENT>compute_deflections = lens_util.compute_deflections_at_next_plane(plane_index=plane_index,<EOL>total_planes=len(plane_redshifts))<EOL>new_grid_stack = image_plane_grid_stack<EOL>if plane_index > <NUM_LIT:0>:<EOL><INDENT>for previous_plane_index in range(plane_index):<EOL><INDENT>scaling_factor = cosmology_util.scaling_factor_between_redshifts_from_redshifts_and_cosmology(<EOL>redshift_0=plane_redshifts[previous_plane_index], redshift_1=plane_redshifts[plane_index],<EOL>redshift_final=plane_redshifts[-<NUM_LIT:1>], cosmology=cosmology)<EOL>scaled_deflection_stack = lens_util.scaled_deflection_stack_from_plane_and_scaling_factor(<EOL>plane=planes[previous_plane_index], scaling_factor=scaling_factor)<EOL>new_grid_stack =lens_util.grid_stack_from_deflection_stack(grid_stack=new_grid_stack,<EOL>deflection_stack=scaled_deflection_stack)<EOL><DEDENT><DEDENT>planes.append(pl.Plane(galaxies=galaxies_in_planes[plane_index], grid_stack=new_grid_stack,<EOL>border=border, compute_deflections=compute_deflections, cosmology=cosmology))<EOL><DEDENT>super(TracerMultiPlanes, self).__init__(planes=planes, cosmology=cosmology)<EOL>

Ray-tracer for a lens system with any number of planes.

        The redshift of these planes are specified by the redshits of the galaxies; there is a unique plane redshift \
        for every unique galaxy redshift (galaxies with identical redshifts are put in the same plane).

        To perform multi-plane ray-tracing, a cosmology must be supplied so that deflection-angles can be rescaled \
        according to the lens-geometry of the multi-plane system. All galaxies input to the tracer must therefore \
        have redshifts.

        This tracer has only one grid-stack (see grid_stack.GridStack) which is used for ray-tracing.

        Parameters
        ----------
        galaxies : [Galaxy]
            The list of galaxies in the ray-tracing calculation.
        image_plane_grid_stack : grid_stacks.GridStack
            The image-plane grid stack which is traced. (includes the regular-grid, sub-grid, blurring-grid, etc.).
        border : masks.RegularGridBorder
            The border of the regular-grid, which is used to relocate demagnified traced pixels to the \
            source-plane borders.
        cosmology : astropy.cosmology
            The cosmology of the ray-tracing calculation.


def __init__(self, lens_galaxies, line_of_sight_galaxies, source_galaxies, planes_between_lenses,<EOL>image_plane_grid_stack, border=None, cosmology=cosmo.Planck15):

lens_redshifts = lens_util.ordered_plane_redshifts_from_galaxies(galaxies=lens_galaxies)<EOL>plane_redshifts = lens_util.ordered_plane_redshifts_from_lens_and_source_plane_redshifts_and_slice_sizes(<EOL>lens_redshifts=lens_redshifts, planes_between_lenses=planes_between_lenses,<EOL>source_plane_redshift=source_galaxies[<NUM_LIT:0>].redshift)<EOL>galaxies_in_planes =lens_util.galaxies_in_redshift_ordered_planes_from_galaxies(galaxies=lens_galaxies + line_of_sight_galaxies,<EOL>plane_redshifts=plane_redshifts)<EOL>plane_redshifts.append(source_galaxies[<NUM_LIT:0>].redshift)<EOL>galaxies_in_planes.append(source_galaxies)<EOL>image_plane_grid_stack = pix.setup_image_plane_pixelization_grid_from_galaxies_and_grid_stack(<EOL>galaxies=lens_galaxies, grid_stack=image_plane_grid_stack)<EOL>planes = []<EOL>for plane_index in range(<NUM_LIT:0>, len(plane_redshifts)):<EOL><INDENT>compute_deflections = lens_util.compute_deflections_at_next_plane(plane_index=plane_index,<EOL>total_planes=len(plane_redshifts))<EOL>new_grid_stack = image_plane_grid_stack<EOL>if plane_index > <NUM_LIT:0>:<EOL><INDENT>print()<EOL>for previous_plane_index in range(plane_index):<EOL><INDENT>scaling_factor = cosmology_util.scaling_factor_between_redshifts_from_redshifts_and_cosmology(<EOL>redshift_0=plane_redshifts[previous_plane_index], redshift_1=plane_redshifts[plane_index],<EOL>redshift_final=plane_redshifts[-<NUM_LIT:1>], cosmology=cosmology)<EOL>scaled_deflection_stack = lens_util.scaled_deflection_stack_from_plane_and_scaling_factor(<EOL>plane=planes[previous_plane_index], scaling_factor=scaling_factor)<EOL>new_grid_stack =lens_util.grid_stack_from_deflection_stack(grid_stack=new_grid_stack,<EOL>deflection_stack=scaled_deflection_stack)<EOL><DEDENT><DEDENT>planes.append(pl.PlaneSlice(redshift=plane_redshifts[plane_index], galaxies=galaxies_in_planes[plane_index],<EOL>grid_stack=new_grid_stack, border=border,<EOL>compute_deflections=compute_deflections, cosmology=cosmology))<EOL><DEDENT>super(TracerMultiPlanesSliced, self).__init__(planes=planes, cosmology=cosmology)<EOL>

Ray-tracer for a lens system with any number of planes.

        The redshift of these planes are specified by the input parameters *lens_redshifts* and \
         *slices_between_main_planes*. Every galaxy is placed in its closest plane in redshift-space.

        To perform multi-plane ray-tracing, a cosmology must be supplied so that deflection-angles can be rescaled \
        according to the lens-geometry of the multi-plane system. All galaxies input to the tracer must therefore \
        have redshifts.

        This tracer has only one grid-stack (see grid_stack.GridStack) which is used for ray-tracing.

        Parameters
        ----------
        lens_galaxies : [Galaxy]
            The list of galaxies in the ray-tracing calculation.
        image_plane_grid_stack : grid_stacks.GridStack
            The image-plane grid stack which is traced. (includes the regular-grid, sub-grid, blurring-grid, etc.).
        planes_between_lenses : [int]
            The number of slices between each main plane. The first entry in this list determines the number of slices \
            between Earth (redshift 0.0) and main plane 0, the next between main planes 0 and 1, etc.
        border : masks.RegularGridBorder
            The border of the regular-grid, which is used to relocate demagnified traced pixels to the \
            source-plane borders.
        cosmology : astropy.cosmology
            The cosmology of the ray-tracing calculation.


def __init__(self, lens_galaxies, image_plane_positions, cosmology=cosmo.Planck15):

image_plane = pl.PlanePositions(redshift=lens_galaxies[<NUM_LIT:0>].redshift, galaxies=lens_galaxies,<EOL>positions=image_plane_positions, compute_deflections=True, cosmology=cosmology)<EOL>source_plane_positions = image_plane.trace_to_next_plane()<EOL>source_plane = pl.PlanePositions(redshift=None, galaxies=None, positions=source_plane_positions,<EOL>compute_deflections=False, cosmology=cosmology)<EOL>super(TracerImageSourcePlanesPositions, self).__init__(planes=[image_plane, source_plane], cosmology=cosmology)<EOL>

Positional ray-tracer for a lens system with two planes, an image-plane and source-plane (source-plane \
        galaxies are not input for the positional ray-tracer, as it is only the proximity that image_plane_positions \
        trace to within one another that needs to be computed).

        By default, this has no associated cosmology, thus all calculations are performed in arc seconds and galaxies \
        do not need input redshifts. If a cosmology is supplied, the plane's angular diameter distances, \
        conversion factors, etc. are used to provide quantities in kpc.

        Parameters
        ----------
        lens_galaxies : [Galaxy]
            The list of lens galaxies in the image-plane.
        image_plane_positions : [[[]]]
            The (y,x) arc-second coordinates of image-plane pixels which (are expected to) mappers to the same \
            location(s) in the source-plane.
        cosmology : astropy.cosmology.Planck15
            The cosmology of the ray-tracing calculation.


def __init__(self, galaxies, image_plane_positions, cosmology=cosmo.Planck15):

plane_redshifts = lens_util.ordered_plane_redshifts_from_galaxies(galaxies=galaxies)<EOL>galaxies_in_redshift_ordered_lists =lens_util.galaxies_in_redshift_ordered_planes_from_galaxies(galaxies=galaxies,<EOL>plane_redshifts=plane_redshifts)<EOL>if not galaxies:<EOL><INDENT>raise exc.RayTracingException('<STR_LIT>')<EOL><DEDENT>planes = []<EOL>for plane_index in range(<NUM_LIT:0>, len(plane_redshifts)):<EOL><INDENT>if plane_index < len(plane_redshifts) - <NUM_LIT:1>:<EOL><INDENT>compute_deflections = True<EOL><DEDENT>elif plane_index == len(plane_redshifts) - <NUM_LIT:1>:<EOL><INDENT>compute_deflections = False<EOL><DEDENT>else:<EOL><INDENT>raise exc.RayTracingException('<STR_LIT>')<EOL><DEDENT>new_positions = image_plane_positions<EOL>if plane_index > <NUM_LIT:0>:<EOL><INDENT>for previous_plane_index in range(plane_index):<EOL><INDENT>scaling_factor = cosmology_util.scaling_factor_between_redshifts_from_redshifts_and_cosmology(<EOL>redshift_0=plane_redshifts[previous_plane_index], redshift_1=plane_redshifts[plane_index],<EOL>redshift_final=plane_redshifts[-<NUM_LIT:1>], cosmology=cosmology)<EOL>scaled_deflections = list(map(lambda deflections:<EOL>np.multiply(scaling_factor, deflections),<EOL>planes[previous_plane_index].deflections))<EOL>new_positions = list(map(lambda positions, deflections:<EOL>np.subtract(positions, deflections), new_positions, scaled_deflections))<EOL><DEDENT><DEDENT>planes.append(pl.PlanePositions(redshift=plane_redshifts[plane_index],<EOL>galaxies=galaxies_in_redshift_ordered_lists[plane_index],<EOL>positions=new_positions, compute_deflections=compute_deflections))<EOL><DEDENT>super(TracerMultiPlanesPositions, self).__init__(planes=planes, cosmology=cosmology)<EOL>

Positional ray-tracer for a lens system with any number of planes.

        To perform multi-plane ray-tracing, a cosmology must be supplied so that deflection-angles can be rescaled \
        according to the lens-geometry of the multi-plane system.

        Parameters
        ----------
        galaxies : [Galaxy]
            The list of galaxies in the ray-tracing calculation.
        image_plane_positions : [[[]]]
            The (y,x) arc-second coordinates of image-plane pixels which (are expected to) mappers to the same \
            location(s) in the final source-plane.
        cosmology : astropy.cosmology
            The cosmology of the ray-tracing calculation.


ordered_galaxies = sorted(galaxies, key=lambda galaxy: galaxy.redshift, reverse=False)<EOL>galaxy_redshifts = list(map(lambda galaxy: galaxy.redshift, ordered_galaxies))<EOL>return [redshift for i, redshift in enumerate(galaxy_redshifts) if redshift not in galaxy_redshifts[:i]]<EOL>

Given a list of galaxies (with redshifts), return a list of the redshifts in ascending order.

    If two or more galaxies have the same redshift that redshift is not double counted.

    Parameters
    -----------
    galaxies : [Galaxy]
        The list of galaxies in the ray-tracing calculation.


<EOL>if len(lens_redshifts) != len(planes_between_lenses)-<NUM_LIT:1>:<EOL><INDENT>raise exc.RayTracingException('<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT>plane_redshifts = []<EOL>lens_redshifts.insert(<NUM_LIT:0>, <NUM_LIT:0.0>)<EOL>lens_redshifts.append(source_plane_redshift)<EOL>for lens_plane_index in range(<NUM_LIT:1>, len(lens_redshifts)):<EOL><INDENT>previous_plane_redshift = lens_redshifts[lens_plane_index - <NUM_LIT:1>]<EOL>plane_redshift = lens_redshifts[lens_plane_index]<EOL>slice_total = planes_between_lenses[lens_plane_index - <NUM_LIT:1>]<EOL>plane_redshifts += list(np.linspace(previous_plane_redshift, plane_redshift, slice_total+<NUM_LIT:2>))[<NUM_LIT:1>:]<EOL><DEDENT>return plane_redshifts[<NUM_LIT:0>:-<NUM_LIT:1>]<EOL>

Given a set of lens plane redshifts, the source-plane redshift and the number of planes between each, setup the \
    plane redshifts using these values. A lens redshift corresponds to the 'main' lens galaxy(s),
    whereas the slices collect line-of-sight halos over a range of redshifts.

    The source-plane redshift is removed from the ordered plane redshifts that are returned, so that galaxies are not \
    planed at the source-plane redshift.

    For example, if the main plane redshifts are [1.0, 2.0], and the bin sizes are [1,3], the following redshift \
    slices for planes will be used:

    z=0.5
    z=1.0
    z=1.25
    z=1.5
    z=1.75
    z=2.0

    Parameters
    -----------
    lens_redshifts : [float]
        The redshifts of the main-planes (e.g. the lens galaxy), which determine where redshift intervals are placed.
    planes_between_lenses : [int]
        The number of slices between each main plane. The first entry in this list determines the number of slices \
        between Earth (redshift 0.0) and main plane 0, the next between main planes 0 and 1, etc.
    source_plane_redshift : float
        The redshift of the source-plane, which is input explicitly to ensure galaxies are not placed in the \
        source-plane.


galaxies_in_redshift_ordered_planes =  [[] for i in range(len(plane_redshifts))]<EOL>for galaxy in galaxies:<EOL><INDENT>index = (np.abs(np.asarray(plane_redshifts) - galaxy.redshift)).argmin()<EOL>galaxies_in_redshift_ordered_planes[index].append(galaxy)<EOL><DEDENT>return galaxies_in_redshift_ordered_planes<EOL>

Given a list of galaxies (with redshifts), return a list of the galaxies where each entry contains a list \
    of galaxies at the same redshift in ascending redshift order.

    Parameters
    -----------
    galaxies : [Galaxy]
        The list of galaxies in the ray-tracing calculation.


if plane_index < total_planes - <NUM_LIT:1>:<EOL><INDENT>return True<EOL><DEDENT>elif plane_index == total_planes - <NUM_LIT:1>:<EOL><INDENT>return False<EOL><DEDENT>else:<EOL><INDENT>raise exc.RayTracingException('<STR_LIT>')<EOL><DEDENT>

This function determines whether the tracer should compute the deflections at the next plane.

    This is True if there is another plane after this plane, else it is False..

    Parameters
    -----------
    plane_index : int
        The index of the plane we are deciding if we should compute its deflections.
    total_planes : int
        The total number of planes.


def scale(grid):<EOL><INDENT>return np.multiply(scaling_factor, grid)<EOL><DEDENT>if plane.deflection_stack is not None:<EOL><INDENT>return plane.deflection_stack.apply_function(scale)<EOL><DEDENT>else:<EOL><INDENT>return None<EOL><DEDENT>

Given a plane and scaling factor, compute a set of scaled deflections.

    Parameters
    -----------
    plane : plane.Plane
        The plane whose deflection stack is scaled.
    scaling_factor : float
        The factor the deflection angles are scaled by, which is typically the scaling factor between redshifts for \
        multi-plane lensing.


if deflection_stack is not None:<EOL><INDENT>def minus(grid, deflections):<EOL><INDENT>return grid - deflections<EOL><DEDENT>return grid_stack.map_function(minus, deflection_stack)<EOL><DEDENT>

For a deflection stack, comput a new grid stack but subtracting the deflections


def blurred_image_1d_from_1d_unblurred_and_blurring_images(unblurred_image_1d, blurring_image_1d, convolver):

return convolver.convolve_image(image_array=unblurred_image_1d, blurring_array=blurring_image_1d)<EOL>

For a 1D masked image and 1D blurring image (the regions outside the mask whose light blurs \
    into the mask after PSF convolution), use both to compute the blurred image within the mask via PSF convolution.

    The convolution uses each image's convolver (*See ccd.convolution*).

    Parameters
    ----------
    unblurred_image_1d : ndarray
        The 1D masked datas which is blurred.
    blurring_image_1d : ndarray
        The 1D masked blurring image which is used for blurring.
    convolver : ccd.convolution.ConvolverImage
        The image-convolver which performs the convolution in 1D.


return -<NUM_LIT:0.5> * (chi_squared + regularization_term + noise_normalization)<EOL>

Compute the likelihood of an inversion's fit to the datas, including a regularization term which \
    comes from an inversion:

    Likelihood = -0.5*[Chi_Squared_Term + Regularization_Term + Noise_Term] (see functions above for these definitions)

    Parameters
    ----------
    chi_squared : float
        The chi-squared term of the inversion's fit to the observed datas.
    regularization_term : float
        The regularization term of the inversion, which is the sum of the difference between reconstructed \
        flux of every pixel multiplied by the regularization coefficient.
    noise_normalization : float
        The normalization noise_map-term for the observed datas's noise-map.


def evidence_from_inversion_terms(chi_squared, regularization_term, log_curvature_regularization_term,<EOL>log_regularization_term, noise_normalization):

return -<NUM_LIT:0.5> * (chi_squared + regularization_term + log_curvature_regularization_term - log_regularization_term<EOL>+ noise_normalization)<EOL>

Compute the evidence of an inversion's fit to the datas, where the evidence includes a number of \
    terms which quantify the complexity of an inversion's reconstruction (see the *inversion* module):

    Likelihood = -0.5*[Chi_Squared_Term + Regularization_Term + Log(Covariance_Regularization_Term) -
                       Log(Regularization_Matrix_Term) + Noise_Term]

    Parameters
    ----------
    chi_squared : float
        The chi-squared term of the inversion's fit to the observed datas.
    regularization_term : float
        The regularization term of the inversion, which is the sum of the difference between reconstructed \
        flux of every pixel multiplied by the regularization coefficient.
    log_curvature_regularization_term : float
        The log of the determinant of the sum of the curvature and regularization matrices.
    log_regularization_term : float
        The log of the determinant o the regularization matrix.
    noise_normalization : float
        The normalization noise_map-term for the observed datas's noise-map.


blurred_image_of_planes = []<EOL>for plane_index in range(total_planes):<EOL><INDENT>if np.count_nonzero(image_plane_image_1d_of_planes[plane_index]) > <NUM_LIT:0>:<EOL><INDENT>blurred_image_1d_of_plane = blurred_image_1d_from_1d_unblurred_and_blurring_images(<EOL>unblurred_image_1d=image_plane_image_1d_of_planes[plane_index],<EOL>blurring_image_1d=image_plane_blurring_image_1d_of_planes[plane_index],<EOL>convolver=convolver)<EOL>blurred_image_of_plane = map_to_scaled_array(array_1d=blurred_image_1d_of_plane)<EOL>blurred_image_of_planes.append(blurred_image_of_plane)<EOL><DEDENT>else:<EOL><INDENT>blurred_image_of_planes.append(None)<EOL><DEDENT><DEDENT>return blurred_image_of_planes<EOL>

For a tracer, extract the image-plane image of every plane and blur it with the PSF.

    If none of the galaxies in a plane have a light profie or pixelization (and thus don't have an image) a *None* \
    is used.

    Parameters
    ----------
    total_planes : int
        The total number of planes that blurred images are computed for.
    image_plane_image_1d_of_planes : [ndarray]
        For every plane, the 1D image-plane image.
    image_plane_blurring_image_1d_of_planes : [ndarray]
        For every plane, the 1D image-plane blurring image.
    convolver : hyper.ccd.convolution.ConvolverImage
        Class which performs the PSF convolution of a masked image in 1D.
    map_to_scaled_array : func
        A function which maps a masked image from 1D to 2D.


def unmasked_blurred_image_of_planes_from_padded_grid_stack_and_psf(planes, padded_grid_stack, psf):

unmasked_blurred_image_of_planes = []<EOL>for plane in planes:<EOL><INDENT>if plane.has_pixelization:<EOL><INDENT>unmasked_blurred_image_of_plane = None<EOL><DEDENT>else:<EOL><INDENT>unmasked_blurred_image_of_plane =padded_grid_stack.unmasked_blurred_image_from_psf_and_unmasked_image(<EOL>psf=psf, unmasked_image_1d=plane.image_plane_image_1d)<EOL><DEDENT>unmasked_blurred_image_of_planes.append(unmasked_blurred_image_of_plane)<EOL><DEDENT>return unmasked_blurred_image_of_planes<EOL>

For lens data, compute the unmasked blurred image of every unmasked unblurred image of each plane. To do this, \
    this function iterates over all planes to extract their unmasked unblurred images.

    If a galaxy in a plane has a pixelization, the unmasked image is returned as None, as as the inversion's model \
    image cannot be mapped to an unmasked version.

    This relies on using the lens data's padded-grid, which is a grid of (y,x) coordinates which extends over the \
    entire image as opposed to just the masked region.

    This returns a list, where each list index corresponds to [plane_index].

    Parameters
    ----------
    planes : [plane.Plane]
        The list of planes the unmasked blurred images are computed using.
    padded_grid_stack : grids.GridStack
        A padded-grid_stack, whose padded grid is used for PSF convolution.
    psf : ccd.PSF
        The PSF of the image used for convolution.


def unmasked_blurred_image_of_planes_and_galaxies_from_padded_grid_stack_and_psf(planes, padded_grid_stack, psf):

return [plane.unmasked_blurred_image_of_galaxies_from_psf(padded_grid_stack, psf) for plane in planes]<EOL>

For lens data, compute the unmasked blurred image of every unmasked unblurred image of every galaxy in each \
    plane. To do this, this function iterates over all planes and then galaxies to extract their unmasked unblurred \
    images.

    If a galaxy in a plane has a pixelization, the unmasked image of that galaxy in the plane is returned as None \
    as as the inversion's model image cannot be mapped to an unmasked version.

    This relies on using the lens data's padded-grid, which is a grid of (y,x) coordinates which extends over the \
    entire image as opposed to just the masked region.

    This returns a list of lists, where each list index corresponds to [plane_index][galaxy_index].

    Parameters
    ----------
    planes : [plane.Plane]
        The list of planes the unmasked blurred images are computed using.
    padded_grid_stack : grids.GridStack
        A padded-grid_stack, whose padded grid is used for PSF convolution.
    psf : ccd.PSF
        The PSF of the image used for convolution.


<EOL>return list(map(lambda hyper_galaxy, hyper_galaxy_image_1d, hyper_minimum_value:<EOL>hyper_galaxy.contributions_from_model_image_and_galaxy_image(model_image=hyper_model_image_1d,<EOL>galaxy_image=hyper_galaxy_image_1d,<EOL>minimum_value=hyper_minimum_value),<EOL>hyper_galaxies, hyper_galaxy_images_1d, hyper_minimum_values))<EOL>

For a fitting hyper_galaxy_image, hyper_galaxy model image, list of hyper galaxies images and model hyper galaxies, compute
    their contribution maps, which are used to compute a scaled-noise_map map. All quantities are masked 1D arrays.

    The reason this is separate from the *contributions_from_fitting_hyper_images_and_hyper_galaxies* function is that
    each hyper_galaxy image has a list of hyper galaxies images and associated hyper galaxies (one for each galaxy). Thus,
    this function breaks down the calculation of each 1D masked contribution map and returns them in the same datas
    structure (2 lists with indexes [image_index][contribution_map_index].

    Parameters
    ----------
    hyper_model_image_1d : ndarray
        The best-fit model image to the datas (e.g. from a previous analysis phase).
    hyper_galaxy_images_1d : [ndarray]
        The best-fit model image of each hyper galaxy to the datas (e.g. from a previous analysis phase).
    hyper_galaxies : [galaxy.Galaxy]
        The hyper galaxies which represent the model components used to scale the noise_map, which correspond to
        individual galaxies in the image.
    hyper_minimum_values : [float]
        The minimum value of each hyper_galaxy-image contribution map, which ensure zero's don't impact the scaled noise-map.


def scaled_noise_map_from_hyper_galaxies_and_contribution_maps(contribution_maps, hyper_galaxies, noise_map):

scaled_noise_maps = list(map(lambda hyper_galaxy, contribution_map:<EOL>hyper_galaxy.hyper_noise_from_contributions(noise_map=noise_map,<EOL>contributions=contribution_map),<EOL>hyper_galaxies, contribution_maps))<EOL>return noise_map + sum(scaled_noise_maps)<EOL>

For a contribution map and noise-map, use the model hyper galaxies to compute a scaled noise-map.

    Parameters
    -----------
    contribution_maps : ndarray
        The image's list of 1D masked contribution maps (e.g. one for each hyper galaxy)
    hyper_galaxies : [galaxy.Galaxy]
        The hyper galaxies which represent the model components used to scale the noise_map, which correspond to
        individual galaxies in the image.
    noise_map : ccd.NoiseMap or ndarray
        An array describing the RMS standard deviation error in each pixel, preferably in units of electrons per
        second.


def plot_image(<EOL>fit, mask=None, extract_array_from_mask=False, zoom_around_mask=False, positions=None,<EOL>image_plane_pix_grid=None, as_subplot=False,<EOL>units='<STR_LIT>', kpc_per_arcsec=None, figsize=(<NUM_LIT:7>, <NUM_LIT:7>), aspect='<STR_LIT>',<EOL>cmap='<STR_LIT>', norm='<STR_LIT>', norm_min=None, norm_max=None, linthresh=<NUM_LIT>, linscale=<NUM_LIT>,<EOL>cb_ticksize=<NUM_LIT:10>, cb_fraction=<NUM_LIT>, cb_pad=<NUM_LIT>, cb_tick_values=None, cb_tick_labels=None,<EOL>title='<STR_LIT>', titlesize=<NUM_LIT:16>, xlabelsize=<NUM_LIT:16>, ylabelsize=<NUM_LIT:16>, xyticksize=<NUM_LIT:16>,<EOL>grid_pointsize=<NUM_LIT:1>, mask_pointsize=<NUM_LIT:10>, position_pointsize=<NUM_LIT:10>,<EOL>output_path=None, output_format='<STR_LIT>', output_filename='<STR_LIT>'):

array_plotters.plot_array(<EOL>array=fit.image, mask=mask, extract_array_from_mask=extract_array_from_mask,<EOL>zoom_around_mask=zoom_around_mask, grid=image_plane_pix_grid,<EOL>positions=positions, as_subplot=as_subplot,<EOL>units=units, kpc_per_arcsec=kpc_per_arcsec, figsize=figsize, aspect=aspect,<EOL>cmap=cmap, norm=norm, norm_min=norm_min, norm_max=norm_max, linthresh=linthresh, linscale=linscale,<EOL>cb_ticksize=cb_ticksize, cb_fraction=cb_fraction, cb_pad=cb_pad, <EOL>cb_tick_values=cb_tick_values, cb_tick_labels=cb_tick_labels,<EOL>title=title, titlesize=titlesize, xlabelsize=xlabelsize, ylabelsize=ylabelsize, xyticksize=xyticksize,<EOL>grid_pointsize=grid_pointsize, mask_pointsize=mask_pointsize, position_pointsize=position_pointsize,<EOL>output_path=output_path, output_format=output_format, output_filename=output_filename)<EOL>

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.ccd.datas.CCD
        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'.


def plot_noise_map(<EOL>fit, mask=None, extract_array_from_mask=False, zoom_around_mask=False, positions=None, as_subplot=False,<EOL>units='<STR_LIT>', kpc_per_arcsec=None, figsize=(<NUM_LIT:7>, <NUM_LIT:7>), aspect='<STR_LIT>',<EOL>cmap='<STR_LIT>', norm='<STR_LIT>', norm_min=None, norm_max=None, linthresh=<NUM_LIT>, linscale=<NUM_LIT>,<EOL>cb_ticksize=<NUM_LIT:10>, cb_fraction=<NUM_LIT>, cb_pad=<NUM_LIT>, cb_tick_values=None, cb_tick_labels=None,<EOL>title='<STR_LIT>', titlesize=<NUM_LIT:16>, xlabelsize=<NUM_LIT:16>, ylabelsize=<NUM_LIT:16>, xyticksize=<NUM_LIT:16>,<EOL>mask_pointsize=<NUM_LIT:10>, position_pointsize=<NUM_LIT:10>,<EOL>output_path=None, output_format='<STR_LIT>', output_filename='<STR_LIT>'):

array_plotters.plot_array(<EOL>array=fit.noise_map, mask=mask, extract_array_from_mask=extract_array_from_mask,<EOL>zoom_around_mask=zoom_around_mask,<EOL>positions=positions, as_subplot=as_subplot,<EOL>units=units, kpc_per_arcsec=kpc_per_arcsec, figsize=figsize, aspect=aspect,<EOL>cmap=cmap, norm=norm, norm_min=norm_min, norm_max=norm_max, linthresh=linthresh, linscale=linscale,<EOL>cb_ticksize=cb_ticksize, cb_fraction=cb_fraction, cb_pad=cb_pad, <EOL>cb_tick_values=cb_tick_values, cb_tick_labels=cb_tick_labels,<EOL>title=title, titlesize=titlesize, xlabelsize=xlabelsize, ylabelsize=ylabelsize, xyticksize=xyticksize,<EOL>mask_pointsize=mask_pointsize, position_pointsize=position_pointsize,<EOL>output_path=output_path, output_format=output_format, output_filename=output_filename)<EOL>

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.ccd.datas.CCD
        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'.


def plot_signal_to_noise_map(<EOL>fit, mask=None, extract_array_from_mask=False, zoom_around_mask=False, positions=None, as_subplot=False,<EOL>units='<STR_LIT>', kpc_per_arcsec=None, figsize=(<NUM_LIT:7>, <NUM_LIT:7>), aspect='<STR_LIT>',<EOL>cmap='<STR_LIT>', norm='<STR_LIT>', norm_min=None, norm_max=None, linthresh=<NUM_LIT>, linscale=<NUM_LIT>,<EOL>cb_ticksize=<NUM_LIT:10>, cb_fraction=<NUM_LIT>, cb_pad=<NUM_LIT>, cb_tick_values=None, cb_tick_labels=None,<EOL>title='<STR_LIT>', titlesize=<NUM_LIT:16>, xlabelsize=<NUM_LIT:16>, ylabelsize=<NUM_LIT:16>, xyticksize=<NUM_LIT:16>,<EOL>mask_pointsize=<NUM_LIT:10>, position_pointsize=<NUM_LIT:10>,<EOL>output_path=None, output_format='<STR_LIT>', output_filename='<STR_LIT>'):

array_plotters.plot_array(<EOL>array=fit.signal_to_noise_map, mask=mask, extract_array_from_mask=extract_array_from_mask,<EOL>zoom_around_mask=zoom_around_mask, positions=positions, as_subplot=as_subplot,<EOL>units=units, kpc_per_arcsec=kpc_per_arcsec, figsize=figsize, aspect=aspect,<EOL>cmap=cmap, norm=norm, norm_min=norm_min, norm_max=norm_max,<EOL>linthresh=linthresh, linscale=linscale,<EOL>cb_ticksize=cb_ticksize, cb_fraction=cb_fraction, cb_pad=cb_pad, <EOL>cb_tick_values=cb_tick_values, cb_tick_labels=cb_tick_labels,<EOL>title=title, titlesize=titlesize, xlabelsize=xlabelsize, ylabelsize=ylabelsize, xyticksize=xyticksize,<EOL>mask_pointsize=mask_pointsize, position_pointsize=position_pointsize,<EOL>output_path=output_path, output_format=output_format, output_filename=output_filename)<EOL>

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.ccd.datas.CCD
    The datas-datas, which includes the observed datas, signal_to_noise_map-map, PSF, signal-to-signal_to_noise_map-map, etc.
    plot_origin : True
    If true, the origin of the datas's coordinate system is plotted as a 'x'.


def plot_model_data(<EOL>fit, mask=None, extract_array_from_mask=False, zoom_around_mask=False, positions=None,<EOL>plot_mass_profile_centres=True, as_subplot=False,<EOL>units='<STR_LIT>', kpc_per_arcsec=None, figsize=(<NUM_LIT:7>, <NUM_LIT:7>), aspect='<STR_LIT>',<EOL>cmap='<STR_LIT>', norm='<STR_LIT>', norm_min=None, norm_max=None, linthresh=<NUM_LIT>, linscale=<NUM_LIT>,<EOL>cb_ticksize=<NUM_LIT:10>, cb_fraction=<NUM_LIT>, cb_pad=<NUM_LIT>, cb_tick_values=None, cb_tick_labels=None,<EOL>title='<STR_LIT>', titlesize=<NUM_LIT:16>, xlabelsize=<NUM_LIT:16>, ylabelsize=<NUM_LIT:16>, xyticksize=<NUM_LIT:16>,<EOL>mask_pointsize=<NUM_LIT:10>, position_pointsize=<NUM_LIT:10>,<EOL>output_path=None, output_format='<STR_LIT>', output_filename='<STR_LIT>'):

centres = get_mass_profile_centes(plot_mass_profile_centres=plot_mass_profile_centres, fit=fit)<EOL>array_plotters.plot_array(<EOL>array=fit.model_data, mask=mask, extract_array_from_mask=extract_array_from_mask,<EOL>zoom_around_mask=zoom_around_mask, positions=positions, centres=centres, as_subplot=as_subplot,<EOL>units=units, kpc_per_arcsec=kpc_per_arcsec, figsize=figsize, aspect=aspect,<EOL>cmap=cmap, norm=norm, norm_min=norm_min, norm_max=norm_max, linthresh=linthresh, linscale=linscale,<EOL>cb_ticksize=cb_ticksize, cb_fraction=cb_fraction, cb_pad=cb_pad, <EOL>cb_tick_values=cb_tick_values, cb_tick_labels=cb_tick_labels,<EOL>title=title, titlesize=titlesize, xlabelsize=xlabelsize, ylabelsize=ylabelsize, xyticksize=xyticksize,<EOL>mask_pointsize=mask_pointsize, position_pointsize=position_pointsize,<EOL>output_path=output_path, output_format=output_format, output_filename=output_filename)<EOL>

Plot the model image of a fit.

    Set *autolens.datas.array.plotters.array_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.


def plot_lens_subtracted_image(<EOL>fit, mask=None, extract_array_from_mask=False, zoom_around_mask=False, positions=None, as_subplot=False,<EOL>units='<STR_LIT>', kpc_per_arcsec=None, figsize=(<NUM_LIT:7>, <NUM_LIT:7>), aspect='<STR_LIT>',<EOL>cmap='<STR_LIT>', norm='<STR_LIT>', norm_min=None, norm_max=None, linthresh=<NUM_LIT>, linscale=<NUM_LIT>,<EOL>cb_ticksize=<NUM_LIT:10>, cb_fraction=<NUM_LIT>, cb_pad=<NUM_LIT>, cb_tick_values=None, cb_tick_labels=None,<EOL>title='<STR_LIT>', titlesize=<NUM_LIT:16>, xlabelsize=<NUM_LIT:16>, ylabelsize=<NUM_LIT:16>, xyticksize=<NUM_LIT:16>,<EOL>mask_pointsize=<NUM_LIT:10>, position_pointsize=<NUM_LIT:10>,<EOL>output_path=None, output_format='<STR_LIT>', output_filename='<STR_LIT>'):

if fit.tracer.total_planes == <NUM_LIT:2>:<EOL><INDENT>if fit.tracer.image_plane.has_light_profile:<EOL><INDENT>lens_subtracted_image = fit.image - fit.model_image_of_planes[<NUM_LIT:0>]<EOL><DEDENT>else:<EOL><INDENT>lens_subtracted_image = fit.image<EOL><DEDENT><DEDENT>else:<EOL><INDENT>lens_subtracted_image = fit.image - sum(fit.model_image_of_planes[<NUM_LIT:0>:-<NUM_LIT:2>])<EOL><DEDENT>array_plotters.plot_array(<EOL>array=lens_subtracted_image, mask=mask, extract_array_from_mask=extract_array_from_mask,<EOL>zoom_around_mask=zoom_around_mask, positions=positions, as_subplot=as_subplot,<EOL>units=units, kpc_per_arcsec=kpc_per_arcsec, figsize=figsize, aspect=aspect,<EOL>cmap=cmap, norm=norm, norm_min=norm_min, norm_max=norm_max, linthresh=linthresh, linscale=linscale,<EOL>cb_ticksize=cb_ticksize, cb_fraction=cb_fraction, cb_pad=cb_pad, <EOL>cb_tick_values=cb_tick_values, cb_tick_labels=cb_tick_labels,<EOL>title=title, titlesize=titlesize, xlabelsize=xlabelsize, ylabelsize=ylabelsize, xyticksize=xyticksize,<EOL>mask_pointsize=mask_pointsize, position_pointsize=position_pointsize,<EOL>output_path=output_path, output_format=output_format, output_filename=output_filename)<EOL>

Plot the model image of a specific plane of a lens fit.

    Set *autolens.datas.array.plotters.array_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.


def plot_model_image_of_planes(<EOL>fit, plot_foreground=False, plot_source=False, mask=None, extract_array_from_mask=False, zoom_around_mask=False,<EOL>positions=None, plot_mass_profile_centres=True, as_subplot=False,<EOL>units='<STR_LIT>', kpc_per_arcsec=None, figsize=(<NUM_LIT:7>, <NUM_LIT:7>), aspect='<STR_LIT>',<EOL>cmap='<STR_LIT>', norm='<STR_LIT>', norm_min=None, norm_max=None, linthresh=<NUM_LIT>, linscale=<NUM_LIT>,<EOL>cb_ticksize=<NUM_LIT:10>, cb_fraction=<NUM_LIT>, cb_pad=<NUM_LIT>, cb_tick_values=None, cb_tick_labels=None,<EOL>title='<STR_LIT>', titlesize=<NUM_LIT:16>, xlabelsize=<NUM_LIT:16>, ylabelsize=<NUM_LIT:16>, xyticksize=<NUM_LIT:16>,<EOL>mask_pointsize=<NUM_LIT:10>, position_pointsize=<NUM_LIT:10>,<EOL>output_path=None, output_format='<STR_LIT>', output_filename='<STR_LIT>'):

centres = get_mass_profile_centes(plot_mass_profile_centres=plot_mass_profile_centres, fit=fit)<EOL>if plot_foreground:<EOL><INDENT>if fit.tracer.total_planes == <NUM_LIT:2>:<EOL><INDENT>model_image = fit.model_image_of_planes[<NUM_LIT:0>]<EOL><DEDENT>else:<EOL><INDENT>model_image = sum(fit.model_image_of_planes[<NUM_LIT:0>:-<NUM_LIT:2>])<EOL><DEDENT><DEDENT>elif plot_source:<EOL><INDENT>model_image = fit.model_image_of_planes[-<NUM_LIT:1>]<EOL><DEDENT>else:<EOL><INDENT>raise exc.PlottingException('<STR_LIT>')<EOL><DEDENT>array_plotters.plot_array(<EOL>array=model_image, mask=mask, extract_array_from_mask=extract_array_from_mask,<EOL>zoom_around_mask=zoom_around_mask, positions=positions, centres=centres, as_subplot=as_subplot,<EOL>units=units, kpc_per_arcsec=kpc_per_arcsec, figsize=figsize, aspect=aspect,<EOL>cmap=cmap, norm=norm, norm_min=norm_min, norm_max=norm_max, linthresh=linthresh, linscale=linscale,<EOL>cb_ticksize=cb_ticksize, cb_fraction=cb_fraction, cb_pad=cb_pad, <EOL>cb_tick_values=cb_tick_values, cb_tick_labels=cb_tick_labels,<EOL>title=title, titlesize=titlesize, xlabelsize=xlabelsize, ylabelsize=ylabelsize, xyticksize=xyticksize,<EOL>mask_pointsize=mask_pointsize, position_pointsize=position_pointsize,<EOL>output_path=output_path, output_format=output_format, output_filename=output_filename)<EOL>

Plot the model image of a specific plane of a lens fit.

    Set *autolens.datas.array.plotters.array_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.
    plane_indexes : [int]
        The plane from which the model image is generated.


def plot_residual_map(<EOL>fit, mask=None, extract_array_from_mask=False, zoom_around_mask=False, positions=None, as_subplot=False,<EOL>units='<STR_LIT>', kpc_per_arcsec=None, figsize=(<NUM_LIT:7>, <NUM_LIT:7>), aspect='<STR_LIT>',<EOL>cmap='<STR_LIT>', norm='<STR_LIT>', norm_min=None, norm_max=None, linthresh=<NUM_LIT>, linscale=<NUM_LIT>,<EOL>cb_ticksize=<NUM_LIT:10>, cb_fraction=<NUM_LIT>, cb_pad=<NUM_LIT>, cb_tick_values=None, cb_tick_labels=None,<EOL>title='<STR_LIT>', titlesize=<NUM_LIT:16>, xlabelsize=<NUM_LIT:16>, ylabelsize=<NUM_LIT:16>, xyticksize=<NUM_LIT:16>,<EOL>mask_pointsize=<NUM_LIT:10>, position_pointsize=<NUM_LIT:10>,<EOL>output_path=None, output_format='<STR_LIT>', output_filename='<STR_LIT>'):

array_plotters.plot_array(<EOL>array=fit.residual_map, mask=mask, extract_array_from_mask=extract_array_from_mask,<EOL>zoom_around_mask=zoom_around_mask, positions=positions, as_subplot=as_subplot,<EOL>units=units, kpc_per_arcsec=kpc_per_arcsec, figsize=figsize, aspect=aspect,<EOL>cmap=cmap, norm=norm, norm_min=norm_min, norm_max=norm_max, linthresh=linthresh, linscale=linscale,<EOL>cb_ticksize=cb_ticksize, cb_fraction=cb_fraction, cb_pad=cb_pad, <EOL>cb_tick_values=cb_tick_values, cb_tick_labels=cb_tick_labels,<EOL>title=title, titlesize=titlesize, xlabelsize=xlabelsize, ylabelsize=ylabelsize, xyticksize=xyticksize,<EOL>mask_pointsize=mask_pointsize, position_pointsize=position_pointsize,<EOL>output_path=output_path, output_format=output_format, output_filename=output_filename)<EOL>

Plot the residual-map of a lens fit.

    Set *autolens.datas.array.plotters.array_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 residual_map are plotted.


def plot_chi_squared_map(<EOL>fit, mask=None, extract_array_from_mask=False, zoom_around_mask=False, positions=None, as_subplot=False,<EOL>units='<STR_LIT>', kpc_per_arcsec=None, figsize=(<NUM_LIT:7>, <NUM_LIT:7>), aspect='<STR_LIT>',<EOL>cmap='<STR_LIT>', norm='<STR_LIT>', norm_min=None, norm_max=None, linthresh=<NUM_LIT>, linscale=<NUM_LIT>,<EOL>cb_ticksize=<NUM_LIT:10>, cb_fraction=<NUM_LIT>, cb_pad=<NUM_LIT>, cb_tick_values=None, cb_tick_labels=None,<EOL>title='<STR_LIT>', titlesize=<NUM_LIT:16>, xlabelsize=<NUM_LIT:16>, ylabelsize=<NUM_LIT:16>, xyticksize=<NUM_LIT:16>,<EOL>mask_pointsize=<NUM_LIT:10>, position_pointsize=<NUM_LIT:10>,<EOL>output_path=None, output_format='<STR_LIT>', output_filename='<STR_LIT>'):

array_plotters.plot_array(<EOL>array=fit.chi_squared_map, mask=mask, extract_array_from_mask=extract_array_from_mask,<EOL>zoom_around_mask=zoom_around_mask, positions=positions, as_subplot=as_subplot,<EOL>units=units, kpc_per_arcsec=kpc_per_arcsec, figsize=figsize, aspect=aspect,<EOL>cmap=cmap, norm=norm, norm_min=norm_min, norm_max=norm_max, linthresh=linthresh, linscale=linscale,<EOL>cb_ticksize=cb_ticksize, cb_fraction=cb_fraction, cb_pad=cb_pad, <EOL>cb_tick_values=cb_tick_values, cb_tick_labels=cb_tick_labels,<EOL>title=title, titlesize=titlesize, xlabelsize=xlabelsize, ylabelsize=ylabelsize, xyticksize=xyticksize,<EOL>mask_pointsize=mask_pointsize, position_pointsize=position_pointsize,<EOL>output_path=output_path, output_format=output_format, output_filename=output_filename)<EOL>

Plot the chi-squared map of a lens fit.

    Set *autolens.datas.array.plotters.array_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 chi-squareds are plotted.


def plot_contribution_maps(<EOL>fit, mask=None, extract_array_from_mask=False, zoom_around_mask=False, positions=None, as_subplot=False,<EOL>units='<STR_LIT>', kpc_per_arcsec=None, figsize=(<NUM_LIT:7>, <NUM_LIT:7>), aspect='<STR_LIT>',<EOL>cmap='<STR_LIT>', norm='<STR_LIT>', norm_min=None, norm_max=None, linthresh=<NUM_LIT>, linscale=<NUM_LIT>,<EOL>cb_ticksize=<NUM_LIT:10>, cb_fraction=<NUM_LIT>, cb_pad=<NUM_LIT>, cb_tick_values=None, cb_tick_labels=None,<EOL>title='<STR_LIT>', titlesize=<NUM_LIT:16>, xlabelsize=<NUM_LIT:16>, ylabelsize=<NUM_LIT:16>, xyticksize=<NUM_LIT:16>,<EOL>mask_pointsize=<NUM_LIT:10>, position_pointsize=<NUM_LIT:10>,<EOL>output_path=None, output_format='<STR_LIT>', output_filename='<STR_LIT>'):

if len(fit.contribution_maps) > <NUM_LIT:1>:<EOL><INDENT>contribution_map = sum(fit.contribution_maps)<EOL><DEDENT>else:<EOL><INDENT>contribution_map = fit.contribution_maps[<NUM_LIT:0>]<EOL><DEDENT>array_plotters.plot_array(<EOL>array=contribution_map, mask=mask, extract_array_from_mask=extract_array_from_mask,<EOL>zoom_around_mask=zoom_around_mask, positions=positions, as_subplot=as_subplot,<EOL>units=units, kpc_per_arcsec=kpc_per_arcsec, figsize=figsize, aspect=aspect,<EOL>cmap=cmap, norm=norm, norm_min=norm_min, norm_max=norm_max, linthresh=linthresh, linscale=linscale,<EOL>cb_ticksize=cb_ticksize, cb_fraction=cb_fraction, cb_pad=cb_pad, <EOL>cb_tick_values=cb_tick_values, cb_tick_labels=cb_tick_labels,<EOL>title=title, titlesize=titlesize, xlabelsize=xlabelsize, ylabelsize=ylabelsize, xyticksize=xyticksize,<EOL>mask_pointsize=mask_pointsize, position_pointsize=position_pointsize,<EOL>output_path=output_path, output_format=output_format, output_filename=output_filename)<EOL>

Plot the summed contribution maps of a hyper-fit.

    Set *autolens.datas.array.plotters.array_plotters* for a description of all input parameters not described below.

    Parameters
    -----------
    fit : datas.fitting.fitting.AbstractLensHyperFit
        The hyper-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 contribution_maps are plotted.


if should_plot_mask:<EOL><INDENT>return fit.mask<EOL><DEDENT>else:<EOL><INDENT>return None<EOL><DEDENT>

Get the masks of the fit if the masks should be plotted on the fit.

    Parameters
    -----------
    fit : datas.fitting.fitting.AbstractLensHyperFit
        The fit to the datas, which includes a lisrt of every model image, residual_map, chi-squareds, etc.
    should_plot_mask : bool
        If *True*, the masks is plotted on the fit's datas.


def plot_fit_subplot_lens_plane_only(<EOL>fit, should_plot_mask=True, extract_array_from_mask=False, zoom_around_mask=False, positions=None,<EOL>should_plot_image_plane_pix=False,<EOL>units='<STR_LIT>', figsize=None, aspect='<STR_LIT>',<EOL>cmap='<STR_LIT>', norm='<STR_LIT>', norm_min=None, norm_max=None, linthresh=<NUM_LIT>, linscale=<NUM_LIT>,<EOL>cb_ticksize=<NUM_LIT:10>, cb_fraction=<NUM_LIT>, cb_pad=<NUM_LIT>, cb_tick_values=None, cb_tick_labels=None,<EOL>titlesize=<NUM_LIT:10>, xlabelsize=<NUM_LIT:10>, ylabelsize=<NUM_LIT:10>, xyticksize=<NUM_LIT:10>,<EOL>mask_pointsize=<NUM_LIT:10>, position_pointsize=<NUM_LIT:10>, grid_pointsize=<NUM_LIT:1>,<EOL>output_path=None, output_filename='<STR_LIT>', output_format='<STR_LIT>'):

rows, columns, figsize_tool = plotter_util.get_subplot_rows_columns_figsize(number_subplots=<NUM_LIT:6>)<EOL>mask = lens_plotter_util.get_mask(fit=fit, should_plot_mask=should_plot_mask)<EOL>if figsize is None:<EOL><INDENT>figsize = figsize_tool<EOL><DEDENT>plt.figure(figsize=figsize)<EOL>plt.subplot(rows, columns, <NUM_LIT:1>)<EOL>kpc_per_arcsec = fit.tracer.image_plane.kpc_per_arcsec<EOL>image_plane_pix_grid = lens_plotter_util.get_image_plane_pix_grid(should_plot_image_plane_pix, fit)<EOL>lens_plotter_util.plot_image(<EOL>fit=fit, mask=mask, extract_array_from_mask=extract_array_from_mask, zoom_around_mask=zoom_around_mask,<EOL>positions=positions, image_plane_pix_grid=image_plane_pix_grid, as_subplot=True,<EOL>units=units, kpc_per_arcsec=kpc_per_arcsec, figsize=figsize, aspect=aspect,<EOL>cmap=cmap, norm=norm, norm_min=norm_min, norm_max=norm_max, linthresh=linthresh, linscale=linscale,<EOL>cb_ticksize=cb_ticksize, cb_fraction=cb_fraction, cb_pad=cb_pad, <EOL>cb_tick_values=cb_tick_values, cb_tick_labels=cb_tick_labels,<EOL>titlesize=titlesize, xlabelsize=xlabelsize, ylabelsize=ylabelsize, xyticksize=xyticksize,<EOL>grid_pointsize=grid_pointsize, position_pointsize=position_pointsize, mask_pointsize=mask_pointsize,<EOL>output_path=output_path, output_filename='<STR_LIT>', output_format=output_format)<EOL>plt.subplot(rows, columns, <NUM_LIT:2>)<EOL>lens_plotter_util.plot_noise_map(<EOL>fit=fit, mask=mask, extract_array_from_mask=extract_array_from_mask, zoom_around_mask=zoom_around_mask,<EOL>positions=positions, as_subplot=True,<EOL>units=units, kpc_per_arcsec=kpc_per_arcsec, figsize=figsize, aspect=aspect,<EOL>cmap=cmap, norm=norm, norm_min=norm_min, norm_max=norm_max, linthresh=linthresh, linscale=linscale,<EOL>cb_ticksize=cb_ticksize, cb_fraction=cb_fraction, cb_pad=cb_pad, <EOL>cb_tick_values=cb_tick_values, cb_tick_labels=cb_tick_labels,<EOL>titlesize=titlesize, xlabelsize=xlabelsize, ylabelsize=ylabelsize, xyticksize=xyticksize,<EOL>position_pointsize=position_pointsize, mask_pointsize=mask_pointsize,<EOL>output_path=output_path, output_filename='<STR_LIT>', output_format=output_format)<EOL>plt.subplot(rows, columns, <NUM_LIT:3>)<EOL>lens_plotter_util.plot_signal_to_noise_map(<EOL>fit=fit, mask=mask, extract_array_from_mask=extract_array_from_mask, zoom_around_mask=zoom_around_mask,<EOL>positions=positions, as_subplot=True,<EOL>units=units, kpc_per_arcsec=kpc_per_arcsec, figsize=figsize, aspect=aspect,<EOL>cmap=cmap, norm=norm, norm_min=norm_min, norm_max=norm_max, linthresh=linthresh, linscale=linscale,<EOL>cb_ticksize=cb_ticksize, cb_fraction=cb_fraction, cb_pad=cb_pad, <EOL>cb_tick_values=cb_tick_values, cb_tick_labels=cb_tick_labels,<EOL>titlesize=titlesize, xlabelsize=xlabelsize, ylabelsize=ylabelsize, xyticksize=xyticksize,<EOL>position_pointsize=position_pointsize, mask_pointsize=mask_pointsize,<EOL>output_path=output_path, output_filename='<STR_LIT>', output_format=output_format)<EOL>plt.subplot(rows, columns, <NUM_LIT:4>)<EOL>lens_plotter_util.plot_model_data(<EOL>fit=fit, mask=mask, extract_array_from_mask=extract_array_from_mask, zoom_around_mask=zoom_around_mask, as_subplot=True,<EOL>units=units, kpc_per_arcsec=kpc_per_arcsec, figsize=figsize, aspect=aspect,<EOL>cmap=cmap, norm=norm, norm_min=norm_min, norm_max=norm_max, linthresh=linthresh, linscale=linscale,<EOL>cb_ticksize=cb_ticksize, cb_fraction=cb_fraction, cb_pad=cb_pad, <EOL>cb_tick_values=cb_tick_values, cb_tick_labels=cb_tick_labels,<EOL>titlesize=titlesize, xlabelsize=xlabelsize, ylabelsize=ylabelsize, xyticksize=xyticksize,<EOL>output_path=output_path, output_filename='<STR_LIT>', output_format=output_format)<EOL>plt.subplot(rows, columns, <NUM_LIT:5>)<EOL>lens_plotter_util.plot_residual_map(<EOL>fit=fit, mask=mask, extract_array_from_mask=extract_array_from_mask, zoom_around_mask=zoom_around_mask, as_subplot=True,<EOL>units=units, kpc_per_arcsec=kpc_per_arcsec, figsize=figsize, aspect=aspect,<EOL>cmap=cmap, norm=norm, norm_min=norm_min, norm_max=norm_max, linthresh=linthresh, linscale=linscale,<EOL>cb_ticksize=cb_ticksize, cb_fraction=cb_fraction, cb_pad=cb_pad, <EOL>cb_tick_values=cb_tick_values, cb_tick_labels=cb_tick_labels,<EOL>titlesize=titlesize, xlabelsize=xlabelsize, ylabelsize=ylabelsize, xyticksize=xyticksize,<EOL>output_path=output_path, output_filename='<STR_LIT>', output_format=output_format)<EOL>plt.subplot(rows, columns, <NUM_LIT:6>)<EOL>lens_plotter_util.plot_chi_squared_map(<EOL>fit=fit, mask=mask, extract_array_from_mask=extract_array_from_mask, zoom_around_mask=zoom_around_mask, as_subplot=True,<EOL>units=units, kpc_per_arcsec=kpc_per_arcsec, figsize=figsize, aspect=aspect,<EOL>cmap=cmap, norm=norm, norm_min=norm_min, norm_max=norm_max, linthresh=linthresh, linscale=linscale,<EOL>cb_ticksize=cb_ticksize, cb_fraction=cb_fraction, cb_pad=cb_pad, <EOL>cb_tick_values=cb_tick_values, cb_tick_labels=cb_tick_labels,<EOL>titlesize=titlesize, xlabelsize=xlabelsize, ylabelsize=ylabelsize, xyticksize=xyticksize,<EOL>output_path=output_path, output_filename='<STR_LIT>', output_format=output_format)<EOL>plotter_util.output_subplot_array(output_path=output_path, output_filename=output_filename,<EOL>output_format=output_format)<EOL>plt.close()<EOL>

Plot the model datas_ of an analysis, using the *Fitter* class object.

    The visualization and output type can be fully customized.

    Parameters
    -----------
    fit : autolens.lens.fitting.Fitter
        Class containing fit between the model datas_ and observed lens datas_ (including residual_map, chi_squared_map etc.)
    output_path : str
        The path where the datas_ is output if the output_type is a file format (e.g. png, fits)
    output_filename : str
        The name of the file that is output, if the output_type is a file format (e.g. png, fits)
    output_format : str
        How the datas_ is output. File formats (e.g. png, fits) output the datas_ to harddisk. 'show' displays the datas_ \
        in the python interpreter window.


def plot_fit_subplot_lens_and_source_planes(<EOL>fit, should_plot_mask=True, extract_array_from_mask=False, zoom_around_mask=False,<EOL>should_plot_source_grid=False, positions=None, should_plot_image_plane_pix=False, plot_mass_profile_centres=True,<EOL>units='<STR_LIT>', figsize=None, aspect='<STR_LIT>',<EOL>cmap='<STR_LIT>', norm='<STR_LIT>', norm_min=None, norm_max=None, linthresh=<NUM_LIT>, linscale=<NUM_LIT>,<EOL>cb_ticksize=<NUM_LIT:10>, cb_fraction=<NUM_LIT>, cb_pad=<NUM_LIT>, cb_tick_values=None, cb_tick_labels=None,<EOL>titlesize=<NUM_LIT:10>, xlabelsize=<NUM_LIT:10>, ylabelsize=<NUM_LIT:10>, xyticksize=<NUM_LIT:10>,<EOL>mask_pointsize=<NUM_LIT:10>, position_pointsize=<NUM_LIT:10>, grid_pointsize=<NUM_LIT:1>,<EOL>output_path=None, output_filename='<STR_LIT>', output_format='<STR_LIT>'):

rows, columns, figsize_tool = plotter_util.get_subplot_rows_columns_figsize(number_subplots=<NUM_LIT:9>)<EOL>mask = lens_plotter_util.get_mask(fit=fit, should_plot_mask=should_plot_mask)<EOL>if figsize is None:<EOL><INDENT>figsize = figsize_tool<EOL><DEDENT>plt.figure(figsize=figsize)<EOL>kpc_per_arcsec = fit.tracer.image_plane.kpc_per_arcsec<EOL>image_plane_pix_grid = lens_plotter_util.get_image_plane_pix_grid(should_plot_image_plane_pix, fit)<EOL>plt.subplot(rows, columns, <NUM_LIT:1>)<EOL>lens_plotter_util.plot_image(<EOL>fit=fit, mask=mask, extract_array_from_mask=extract_array_from_mask, zoom_around_mask=zoom_around_mask, positions=positions,<EOL>image_plane_pix_grid=image_plane_pix_grid, as_subplot=True,<EOL>units=units, kpc_per_arcsec=kpc_per_arcsec, figsize=figsize, aspect=aspect,<EOL>cmap=cmap, norm=norm, norm_min=norm_min, norm_max=norm_max, linthresh=linthresh, linscale=linscale,<EOL>cb_ticksize=cb_ticksize, cb_fraction=cb_fraction, cb_pad=cb_pad, <EOL>cb_tick_values=cb_tick_values, cb_tick_labels=cb_tick_labels,<EOL>titlesize=titlesize, xlabelsize=xlabelsize, ylabelsize=ylabelsize, xyticksize=xyticksize,<EOL>grid_pointsize=grid_pointsize, position_pointsize=position_pointsize, mask_pointsize=mask_pointsize,<EOL>output_path=output_path, output_filename='<STR_LIT>', output_format=output_format)<EOL>plt.subplot(rows, columns, <NUM_LIT:2>)<EOL>lens_plotter_util.plot_noise_map(<EOL>fit=fit, mask=mask, extract_array_from_mask=extract_array_from_mask, zoom_around_mask=zoom_around_mask, positions=None, as_subplot=True,<EOL>units=units, kpc_per_arcsec=kpc_per_arcsec, figsize=figsize, aspect=aspect,<EOL>cmap=cmap, norm=norm, norm_min=norm_min, norm_max=norm_max, linthresh=linthresh, linscale=linscale,<EOL>cb_ticksize=cb_ticksize, cb_fraction=cb_fraction, cb_pad=cb_pad, <EOL>cb_tick_values=cb_tick_values, cb_tick_labels=cb_tick_labels,<EOL>titlesize=titlesize, xlabelsize=xlabelsize, ylabelsize=ylabelsize, xyticksize=xyticksize,<EOL>position_pointsize=position_pointsize, mask_pointsize=mask_pointsize,<EOL>output_path=output_path, output_filename='<STR_LIT>', output_format=output_format)<EOL>plt.subplot(rows, columns, <NUM_LIT:3>)<EOL>lens_plotter_util.plot_signal_to_noise_map(<EOL>fit=fit, mask=mask, extract_array_from_mask=extract_array_from_mask, zoom_around_mask=zoom_around_mask, positions=None, as_subplot=True,<EOL>units=units, kpc_per_arcsec=kpc_per_arcsec, figsize=figsize, aspect=aspect,<EOL>cmap=cmap, norm=norm, norm_min=norm_min, norm_max=norm_max, linthresh=linthresh, linscale=linscale,<EOL>cb_ticksize=cb_ticksize, cb_fraction=cb_fraction, cb_pad=cb_pad, <EOL>cb_tick_values=cb_tick_values, cb_tick_labels=cb_tick_labels,<EOL>titlesize=titlesize, xlabelsize=xlabelsize, ylabelsize=ylabelsize, xyticksize=xyticksize,<EOL>position_pointsize=position_pointsize, mask_pointsize=mask_pointsize,<EOL>output_path=output_path, output_filename='<STR_LIT>', output_format=output_format)<EOL>plt.subplot(rows, columns, <NUM_LIT:4>)<EOL>lens_plotter_util.plot_lens_subtracted_image(<EOL>fit=fit, mask=mask, extract_array_from_mask=extract_array_from_mask, zoom_around_mask=zoom_around_mask, positions=positions, as_subplot=True,<EOL>units=units, kpc_per_arcsec=kpc_per_arcsec, figsize=figsize, aspect=aspect,<EOL>cmap=cmap, norm=norm, norm_min=norm_min, norm_max=norm_max, linthresh=linthresh, linscale=linscale,<EOL>cb_ticksize=cb_ticksize, cb_fraction=cb_fraction, cb_pad=cb_pad, <EOL>cb_tick_values=cb_tick_values, cb_tick_labels=cb_tick_labels,<EOL>title='<STR_LIT>', titlesize=titlesize, xlabelsize=xlabelsize, ylabelsize=ylabelsize,<EOL>position_pointsize=position_pointsize, xyticksize=xyticksize,<EOL>output_path=output_path, output_filename='<STR_LIT>', output_format=output_format)<EOL>if fit.tracer.image_plane.has_light_profile:<EOL><INDENT>plt.subplot(rows, columns, <NUM_LIT:5>)<EOL>lens_plotter_util.plot_model_image_of_planes(<EOL>fit=fit, plot_foreground=True, mask=mask, extract_array_from_mask=extract_array_from_mask,<EOL>zoom_around_mask=zoom_around_mask, plot_mass_profile_centres=plot_mass_profile_centres, as_subplot=True,<EOL>units=units, kpc_per_arcsec=kpc_per_arcsec, figsize=figsize, aspect=aspect,<EOL>cmap=cmap, norm=norm, norm_min=norm_min, norm_max=norm_max, linthresh=linthresh, linscale=linscale,<EOL>cb_ticksize=cb_ticksize, cb_fraction=cb_fraction, cb_pad=cb_pad, <EOL>cb_tick_values=cb_tick_values, cb_tick_labels=cb_tick_labels,<EOL>title='<STR_LIT>', titlesize=titlesize, xlabelsize=xlabelsize, ylabelsize=ylabelsize,<EOL>xyticksize=xyticksize,<EOL>output_path=output_path, output_filename='<STR_LIT>', output_format=output_format)<EOL><DEDENT>plt.subplot(rows, columns, <NUM_LIT:6>)<EOL>lens_plotter_util.plot_model_image_of_planes(<EOL>fit=fit, plot_source=True, mask=mask, extract_array_from_mask=extract_array_from_mask,<EOL>zoom_around_mask=zoom_around_mask, plot_mass_profile_centres=plot_mass_profile_centres, as_subplot=True,<EOL>units=units, kpc_per_arcsec=kpc_per_arcsec, figsize=figsize, aspect=aspect,<EOL>cmap=cmap, norm=norm, norm_min=norm_min, norm_max=norm_max, linthresh=linthresh, linscale=linscale,<EOL>cb_ticksize=cb_ticksize, cb_fraction=cb_fraction, cb_pad=cb_pad, <EOL>cb_tick_values=cb_tick_values, cb_tick_labels=cb_tick_labels,<EOL>title='<STR_LIT>', titlesize=titlesize, xlabelsize=xlabelsize, ylabelsize=ylabelsize,<EOL>xyticksize=xyticksize,<EOL>output_path=output_path, output_filename='<STR_LIT>', output_format=output_format)<EOL>if fit.total_inversions == <NUM_LIT:0>:<EOL><INDENT>plt.subplot(rows, columns, <NUM_LIT:7>)<EOL>plane_plotters.plot_plane_image(<EOL>plane=fit.tracer.source_plane, positions=None, plot_grid=should_plot_source_grid, as_subplot=True,<EOL>units=units, figsize=figsize, aspect=aspect,<EOL>cmap=cmap, norm=norm, norm_min=norm_min, norm_max=norm_max, linthresh=linthresh, linscale=linscale,<EOL>cb_ticksize=cb_ticksize, cb_fraction=cb_fraction, cb_pad=cb_pad,<EOL>cb_tick_values=cb_tick_values, cb_tick_labels=cb_tick_labels,<EOL>titlesize=titlesize, xlabelsize=xlabelsize, ylabelsize=ylabelsize, xyticksize=xyticksize,<EOL>grid_pointsize=grid_pointsize, position_pointsize=position_pointsize,<EOL>output_path=output_path, output_filename='<STR_LIT>', output_format=output_format)<EOL><DEDENT>elif fit.total_inversions == <NUM_LIT:1>:<EOL><INDENT>ratio = float((fit.inversion.mapper.geometry.arc_second_maxima[<NUM_LIT:1>] - fit.inversion.mapper.geometry.arc_second_minima[<NUM_LIT:1>]) /(fit.inversion.mapper.geometry.arc_second_maxima[<NUM_LIT:0>] - fit.inversion.mapper.geometry.arc_second_minima[<NUM_LIT:0>]))<EOL>if aspect is '<STR_LIT>':<EOL><INDENT>aspect_inv = ratio<EOL><DEDENT>elif aspect is '<STR_LIT>':<EOL><INDENT>aspect_inv = <NUM_LIT:1.0> / ratio<EOL><DEDENT>elif aspect is '<STR_LIT>':<EOL><INDENT>aspect_inv = <NUM_LIT:1.0><EOL><DEDENT>plt.subplot(rows, columns, <NUM_LIT:7>, aspect=float(aspect_inv))<EOL>inversion_plotters.plot_reconstructed_pixelization(<EOL>inversion=fit.inversion, positions=None, should_plot_grid=False, should_plot_centres=False, as_subplot=True,<EOL>units=units, kpc_per_arcsec=kpc_per_arcsec, figsize=figsize, aspect=None,<EOL>cmap=cmap, norm=norm, norm_min=norm_min, norm_max=norm_max, linthresh=linthresh, linscale=linscale,<EOL>cb_ticksize=cb_ticksize, cb_fraction=cb_fraction, cb_pad=cb_pad,<EOL>cb_tick_values=cb_tick_values, cb_tick_labels=cb_tick_labels,<EOL>titlesize=titlesize, xlabelsize=xlabelsize, ylabelsize=ylabelsize, xyticksize=xyticksize,<EOL>output_path=output_path, output_filename=None, output_format=output_format)<EOL><DEDENT>plt.subplot(rows, columns, <NUM_LIT:8>)<EOL>lens_plotter_util.plot_residual_map(<EOL>fit=fit, mask=mask, extract_array_from_mask=extract_array_from_mask, zoom_around_mask=zoom_around_mask, as_subplot=True,<EOL>units=units, kpc_per_arcsec=kpc_per_arcsec, figsize=figsize, aspect=aspect,<EOL>cmap=cmap, norm=norm, norm_min=norm_min, norm_max=norm_max, linthresh=linthresh, linscale=linscale,<EOL>cb_ticksize=cb_ticksize, cb_fraction=cb_fraction, cb_pad=cb_pad,<EOL>cb_tick_values=cb_tick_values, cb_tick_labels=cb_tick_labels,<EOL>titlesize=titlesize, xlabelsize=xlabelsize, ylabelsize=ylabelsize, xyticksize=xyticksize,<EOL>output_path=output_path, output_filename='<STR_LIT>', output_format=output_format)<EOL>plt.subplot(rows, columns, <NUM_LIT:9>)<EOL>lens_plotter_util.plot_chi_squared_map(<EOL>fit=fit, mask=mask, extract_array_from_mask=extract_array_from_mask, zoom_around_mask=zoom_around_mask, as_subplot=True,<EOL>units=units, kpc_per_arcsec=kpc_per_arcsec, figsize=figsize, aspect=aspect,<EOL>cmap=cmap, norm=norm, norm_min=norm_min, norm_max=norm_max, linthresh=linthresh, linscale=linscale,<EOL>cb_ticksize=cb_ticksize, cb_fraction=cb_fraction, cb_pad=cb_pad,<EOL>cb_tick_values=cb_tick_values, cb_tick_labels=cb_tick_labels,<EOL>titlesize=titlesize, xlabelsize=xlabelsize, ylabelsize=ylabelsize, xyticksize=xyticksize,<EOL>output_path=output_path, output_filename='<STR_LIT>', output_format=output_format)<EOL>plotter_util.output_subplot_array(output_path=output_path, output_filename=output_filename,<EOL>output_format=output_format)<EOL>plt.close()<EOL>


mask = lens_plotter_util.get_mask(fit=fit, should_plot_mask=should_plot_mask)<EOL>kpc_per_arcsec = fit.tracer.image_plane.kpc_per_arcsec<EOL>if should_plot_image:<EOL><INDENT>image_plane_pix_grid = lens_plotter_util.get_image_plane_pix_grid(should_plot_image_plane_pix, fit)<EOL>lens_plotter_util.plot_image(<EOL>fit=fit, mask=mask, extract_array_from_mask=extract_array_from_mask, zoom_around_mask=zoom_around_mask,<EOL>image_plane_pix_grid=image_plane_pix_grid,<EOL>units=units, kpc_per_arcsec=kpc_per_arcsec,<EOL>output_path=output_path, output_format=output_format)<EOL><DEDENT>if should_plot_noise_map:<EOL><INDENT>lens_plotter_util.plot_noise_map(<EOL>fit=fit, mask=mask, extract_array_from_mask=extract_array_from_mask, zoom_around_mask=zoom_around_mask,<EOL>units=units, kpc_per_arcsec=kpc_per_arcsec,<EOL>output_path=output_path, output_format=output_format)<EOL><DEDENT>if should_plot_signal_to_noise_map:<EOL><INDENT>lens_plotter_util.plot_signal_to_noise_map(<EOL>fit=fit, mask=mask, extract_array_from_mask=extract_array_from_mask, zoom_around_mask=zoom_around_mask,<EOL>units=units, kpc_per_arcsec=kpc_per_arcsec,<EOL>output_path=output_path, output_format=output_format)<EOL><DEDENT>if should_plot_model_image:<EOL><INDENT>lens_plotter_util.plot_model_data(<EOL>fit=fit, mask=mask, extract_array_from_mask=extract_array_from_mask, zoom_around_mask=zoom_around_mask, positions=positions,<EOL>units=units, kpc_per_arcsec=kpc_per_arcsec,<EOL>output_path=output_path, output_format=output_format)<EOL><DEDENT>if should_plot_residual_map:<EOL><INDENT>lens_plotter_util.plot_residual_map(<EOL>fit=fit, mask=mask, extract_array_from_mask=extract_array_from_mask, zoom_around_mask=zoom_around_mask,<EOL>units=units, kpc_per_arcsec=kpc_per_arcsec,<EOL>output_path=output_path, output_format=output_format)<EOL><DEDENT>if should_plot_chi_squared_map:<EOL><INDENT>lens_plotter_util.plot_chi_squared_map(<EOL>fit=fit, mask=mask, extract_array_from_mask=extract_array_from_mask, zoom_around_mask=zoom_around_mask,<EOL>units=units, kpc_per_arcsec=kpc_per_arcsec,<EOL>output_path=output_path, output_format=output_format)<EOL><DEDENT>

Plot the model datas_ of an analysis, using the *Fitter* class object.

    The visualization and output type can be fully customized.

    Parameters
    -----------
    fit : autolens.lens.fitting.Fitter
        Class containing fit between the model datas_ and observed lens datas_ (including residual_map, chi_squared_map etc.)
    output_path : str
        The path where the datas_ is output if the output_type is a file format (e.g. png, fits)
    output_format : str
        How the datas_ is output. File formats (e.g. png, fits) output the datas_ to harddisk. 'show' displays the datas_ \
        in the python interpreter window.


mask = lens_plotter_util.get_mask(fit=fit, should_plot_mask=should_plot_mask)<EOL>kpc_per_arcsec = fit.tracer.image_plane.kpc_per_arcsec<EOL>if should_plot_image:<EOL><INDENT>image_plane_pix_grid = lens_plotter_util.get_image_plane_pix_grid(should_plot_image_plane_pix, fit)<EOL>lens_plotter_util.plot_image(<EOL>fit=fit, mask=mask, extract_array_from_mask=extract_array_from_mask, zoom_around_mask=zoom_around_mask,<EOL>image_plane_pix_grid=image_plane_pix_grid,<EOL>units=units, kpc_per_arcsec=kpc_per_arcsec,<EOL>output_path=output_path, output_format=output_format)<EOL><DEDENT>if should_plot_noise_map:<EOL><INDENT>lens_plotter_util.plot_noise_map(<EOL>fit=fit, mask=mask, extract_array_from_mask=extract_array_from_mask, zoom_around_mask=zoom_around_mask,<EOL>units=units, kpc_per_arcsec=kpc_per_arcsec,<EOL>output_path=output_path, output_format=output_format)<EOL><DEDENT>if should_plot_signal_to_noise_map:<EOL><INDENT>lens_plotter_util.plot_signal_to_noise_map(<EOL>fit=fit, mask=mask, extract_array_from_mask=extract_array_from_mask, zoom_around_mask=zoom_around_mask,<EOL>units=units, kpc_per_arcsec=kpc_per_arcsec,<EOL>output_path=output_path, output_format=output_format)<EOL><DEDENT>if should_plot_lens_subtracted_image:<EOL><INDENT>lens_plotter_util.plot_lens_subtracted_image(<EOL>fit=fit, mask=mask, positions=positions, extract_array_from_mask=extract_array_from_mask,<EOL>zoom_around_mask=zoom_around_mask,<EOL>units=units, kpc_per_arcsec=kpc_per_arcsec,<EOL>output_path=output_path, output_format=output_format)<EOL><DEDENT>if should_plot_model_image:<EOL><INDENT>lens_plotter_util.plot_model_data(<EOL>fit=fit, mask=mask, extract_array_from_mask=extract_array_from_mask, zoom_around_mask=zoom_around_mask,<EOL>units=units, kpc_per_arcsec=kpc_per_arcsec,<EOL>output_path=output_path, output_format=output_format)<EOL><DEDENT>if should_plot_lens_model_image:<EOL><INDENT>lens_plotter_util.plot_model_image_of_planes(<EOL>fit=fit, mask=mask, extract_array_from_mask=extract_array_from_mask, zoom_around_mask=zoom_around_mask,<EOL>plot_foreground=True,<EOL>units=units, kpc_per_arcsec=kpc_per_arcsec,<EOL>output_path=output_path, output_filename='<STR_LIT>', output_format=output_format)<EOL><DEDENT>if should_plot_source_model_image:<EOL><INDENT>lens_plotter_util.plot_model_image_of_planes(<EOL>fit=fit, mask=mask, extract_array_from_mask=extract_array_from_mask, zoom_around_mask=zoom_around_mask,<EOL>plot_source=True,<EOL>units=units, kpc_per_arcsec=kpc_per_arcsec,<EOL>output_path=output_path, output_filename='<STR_LIT>', output_format=output_format)<EOL><DEDENT>if should_plot_source_plane_image:<EOL><INDENT>if fit.total_inversions == <NUM_LIT:0>:<EOL><INDENT>plane_plotters.plot_plane_image(<EOL>plane=fit.tracer.source_plane, plot_grid=True,<EOL>units=units, figsize=(<NUM_LIT:20>, <NUM_LIT:20>),<EOL>output_path=output_path, output_filename='<STR_LIT>', output_format=output_format)<EOL><DEDENT>elif fit.total_inversions == <NUM_LIT:1>:<EOL><INDENT>inversion_plotters.plot_reconstructed_pixelization(<EOL>inversion=fit.inversion, should_plot_grid=True,<EOL>units=units, figsize=(<NUM_LIT:20>, <NUM_LIT:20>),<EOL>output_path=output_path, output_filename='<STR_LIT>', output_format=output_format)<EOL><DEDENT><DEDENT>if should_plot_residual_map:<EOL><INDENT>lens_plotter_util.plot_residual_map(<EOL>fit=fit, mask=mask, extract_array_from_mask=extract_array_from_mask, zoom_around_mask=zoom_around_mask,<EOL>units=units, kpc_per_arcsec=kpc_per_arcsec,<EOL>output_path=output_path, output_format=output_format)<EOL><DEDENT>if should_plot_chi_squared_map:<EOL><INDENT>lens_plotter_util.plot_chi_squared_map(<EOL>fit=fit, mask=mask, extract_array_from_mask=extract_array_from_mask, zoom_around_mask=zoom_around_mask,<EOL>units=units, kpc_per_arcsec=kpc_per_arcsec,<EOL>output_path=output_path, output_format=output_format)<EOL><DEDENT>


def plot_fit_subplot(<EOL>fit, should_plot_mask=True, extract_array_from_mask=False, zoom_around_mask=False, positions=None,<EOL>should_plot_image_plane_pix=True,<EOL>units='<STR_LIT>', figsize=None, aspect='<STR_LIT>',<EOL>cmap='<STR_LIT>', norm='<STR_LIT>', norm_min=None, norm_max=None, linthresh=<NUM_LIT>, linscale=<NUM_LIT>,<EOL>cb_ticksize=<NUM_LIT:10>, cb_fraction=<NUM_LIT>, cb_pad=<NUM_LIT>, cb_tick_values=None, cb_tick_labels=None,<EOL>titlesize=<NUM_LIT:10>, xlabelsize=<NUM_LIT:10>, ylabelsize=<NUM_LIT:10>, xyticksize=<NUM_LIT:10>,<EOL>mask_pointsize=<NUM_LIT:10>, position_pointsize=<NUM_LIT>, grid_pointsize=<NUM_LIT:1>,<EOL>output_path=None, output_filename='<STR_LIT>', output_format='<STR_LIT>'):

rows, columns, figsize_tool = plotter_util.get_subplot_rows_columns_figsize(number_subplots=<NUM_LIT:9>)<EOL>mask = lens_plotter_util.get_mask(fit=fit.fit_normal, should_plot_mask=should_plot_mask)<EOL>image_plane_pix_grid = lens_plotter_util.get_image_plane_pix_grid(should_plot_image_plane_pix, fit)<EOL>if figsize is None:<EOL><INDENT>figsize = figsize_tool<EOL><DEDENT>plt.figure(figsize=figsize)<EOL>plt.subplot(rows, columns, <NUM_LIT:1>)<EOL>kpc_per_arcsec = fit.tracer_normal.image_plane.kpc_per_arcsec<EOL>lens_plotter_util.plot_image(<EOL>fit=fit.fit_normal, mask=mask, extract_array_from_mask=extract_array_from_mask,<EOL>zoom_around_mask=zoom_around_mask, positions=positions, image_plane_pix_grid=image_plane_pix_grid,<EOL>as_subplot=True,<EOL>units=units, kpc_per_arcsec=kpc_per_arcsec, figsize=figsize, aspect=aspect,<EOL>cmap=cmap, norm=norm, norm_min=norm_min, norm_max=norm_max, linthresh=linthresh, linscale=linscale,<EOL>cb_ticksize=cb_ticksize, cb_fraction=cb_fraction, cb_pad=cb_pad, <EOL>cb_tick_values=cb_tick_values, cb_tick_labels=cb_tick_labels,<EOL>titlesize=titlesize, xlabelsize=xlabelsize, ylabelsize=ylabelsize, xyticksize=xyticksize,<EOL>grid_pointsize=grid_pointsize, position_pointsize=position_pointsize, mask_pointsize=mask_pointsize,<EOL>output_path=output_path, output_filename='<STR_LIT>', output_format=output_format)<EOL>plt.subplot(rows, columns, <NUM_LIT:4>)<EOL>lens_plotter_util.plot_model_data(<EOL>fit=fit.fit_normal, mask=mask, extract_array_from_mask=extract_array_from_mask,<EOL>zoom_around_mask=zoom_around_mask, as_subplot=True,<EOL>units=units, kpc_per_arcsec=kpc_per_arcsec, figsize=figsize, aspect=aspect,<EOL>cmap=cmap, norm=norm, norm_min=norm_min, norm_max=norm_max, linthresh=linthresh, linscale=linscale,<EOL>cb_ticksize=cb_ticksize, cb_fraction=cb_fraction, cb_pad=cb_pad, <EOL>cb_tick_values=cb_tick_values, cb_tick_labels=cb_tick_labels,<EOL>titlesize=titlesize, xlabelsize=xlabelsize, ylabelsize=ylabelsize, xyticksize=xyticksize,<EOL>output_path=output_path, output_filename='<STR_LIT>', output_format=output_format)<EOL>plt.subplot(rows, columns, <NUM_LIT:5>)<EOL>lens_plotter_util.plot_residual_map(<EOL>fit=fit.fit_normal, mask=mask, extract_array_from_mask=extract_array_from_mask,<EOL>zoom_around_mask=zoom_around_mask, as_subplot=True,<EOL>units=units, kpc_per_arcsec=kpc_per_arcsec, figsize=figsize, aspect=aspect,<EOL>cmap=cmap, norm=norm, norm_min=norm_min, norm_max=norm_max, linthresh=linthresh, linscale=linscale,<EOL>cb_ticksize=cb_ticksize, cb_fraction=cb_fraction, cb_pad=cb_pad, <EOL>cb_tick_values=cb_tick_values, cb_tick_labels=cb_tick_labels,<EOL>titlesize=titlesize, xlabelsize=xlabelsize, ylabelsize=ylabelsize, xyticksize=xyticksize,<EOL>output_path=output_path, output_filename='<STR_LIT>', output_format=output_format)<EOL>plt.subplot(rows, columns, <NUM_LIT:6>)<EOL>lens_plotter_util.plot_chi_squared_map(<EOL>fit=fit.fit_normal, mask=mask, extract_array_from_mask=extract_array_from_mask,<EOL>zoom_around_mask=zoom_around_mask, as_subplot=True,<EOL>units=units, kpc_per_arcsec=kpc_per_arcsec, figsize=figsize, aspect=aspect,<EOL>cmap=cmap, norm=norm, norm_min=norm_min, norm_max=norm_max, linthresh=linthresh, linscale=linscale,<EOL>cb_ticksize=cb_ticksize, cb_fraction=cb_fraction, cb_pad=cb_pad, <EOL>cb_tick_values=cb_tick_values, cb_tick_labels=cb_tick_labels,<EOL>titlesize=titlesize, xlabelsize=xlabelsize, ylabelsize=ylabelsize, xyticksize=xyticksize,<EOL>output_path=output_path, output_filename='<STR_LIT>', output_format=output_format)<EOL>plt.subplot(rows, columns, <NUM_LIT:7>)<EOL>lens_plotter_util.plot_model_data(<EOL>fit=fit.fit_sensitive, mask=mask, extract_array_from_mask=extract_array_from_mask,<EOL>zoom_around_mask=zoom_around_mask, as_subplot=True,<EOL>units=units, kpc_per_arcsec=kpc_per_arcsec, figsize=figsize, aspect=aspect,<EOL>cmap=cmap, norm=norm, norm_min=norm_min, norm_max=norm_max, linthresh=linthresh, linscale=linscale,<EOL>cb_ticksize=cb_ticksize, cb_fraction=cb_fraction, cb_pad=cb_pad, <EOL>cb_tick_values=cb_tick_values, cb_tick_labels=cb_tick_labels,<EOL>titlesize=titlesize, xlabelsize=xlabelsize, ylabelsize=ylabelsize, xyticksize=xyticksize,<EOL>output_path=output_path, output_filename='<STR_LIT>', output_format=output_format)<EOL>plt.subplot(rows, columns, <NUM_LIT:8>)<EOL>lens_plotter_util.plot_residual_map(<EOL>fit=fit.fit_sensitive, mask=mask, extract_array_from_mask=extract_array_from_mask,<EOL>zoom_around_mask=zoom_around_mask, as_subplot=True,<EOL>units=units, kpc_per_arcsec=kpc_per_arcsec, figsize=figsize, aspect=aspect,<EOL>cmap=cmap, norm=norm, norm_min=norm_min, norm_max=norm_max, linthresh=linthresh, linscale=linscale,<EOL>cb_ticksize=cb_ticksize, cb_fraction=cb_fraction, cb_pad=cb_pad, <EOL>cb_tick_values=cb_tick_values, cb_tick_labels=cb_tick_labels,<EOL>titlesize=titlesize, xlabelsize=xlabelsize, ylabelsize=ylabelsize, xyticksize=xyticksize,<EOL>output_path=output_path, output_filename='<STR_LIT>', output_format=output_format)<EOL>plt.subplot(rows, columns, <NUM_LIT:9>)<EOL>lens_plotter_util.plot_chi_squared_map(<EOL>fit=fit.fit_sensitive, mask=mask, extract_array_from_mask=extract_array_from_mask,<EOL>zoom_around_mask=zoom_around_mask, as_subplot=True,<EOL>units=units, kpc_per_arcsec=kpc_per_arcsec, figsize=figsize, aspect=aspect,<EOL>cmap=cmap, norm=norm, norm_min=norm_min, norm_max=norm_max, linthresh=linthresh, linscale=linscale,<EOL>cb_ticksize=cb_ticksize, cb_fraction=cb_fraction, cb_pad=cb_pad, <EOL>cb_tick_values=cb_tick_values, cb_tick_labels=cb_tick_labels,<EOL>titlesize=titlesize, xlabelsize=xlabelsize, ylabelsize=ylabelsize, xyticksize=xyticksize,<EOL>output_path=output_path, output_filename='<STR_LIT>', output_format=output_format)<EOL>plotter_util.output_subplot_array(output_path=output_path, output_filename=output_filename,<EOL>output_format=output_format)<EOL>plt.close()<EOL>

Plot the model datas of an analysis, using the *Fitter* class object.

    The visualization and output type can be fully customized.

    Parameters
    -----------
    fit : autolens.sensitivity_fitting.SensitivityProfileFit
        Class containing fitting between the model datas and observed lens datas (including residual_map, chi_squared_map etc.)


def plot_ray_tracing_subplot(<EOL>tracer, mask=None, extract_array_from_mask=False, zoom_around_mask=False, positions=None,<EOL>units='<STR_LIT>', figsize=None, aspect='<STR_LIT>',<EOL>cmap='<STR_LIT>', norm='<STR_LIT>', norm_min=None, norm_max=None, linthresh=<NUM_LIT>, linscale=<NUM_LIT>,<EOL>cb_ticksize=<NUM_LIT:10>, cb_fraction=<NUM_LIT>, cb_pad=<NUM_LIT>, cb_tick_values=None, cb_tick_labels=None,<EOL>titlesize=<NUM_LIT:10>, xlabelsize=<NUM_LIT:10>, ylabelsize=<NUM_LIT:10>, xyticksize=<NUM_LIT:10>,<EOL>mask_pointsize=<NUM_LIT:10>, position_pointsize=<NUM_LIT>, grid_pointsize=<NUM_LIT:1.0>,<EOL>output_path=None, output_filename='<STR_LIT>', output_format='<STR_LIT>'):

rows, columns, figsize_tool = plotter_util.get_subplot_rows_columns_figsize(number_subplots=<NUM_LIT:6>)<EOL>if figsize is None:<EOL><INDENT>figsize = figsize_tool<EOL><DEDENT>plt.figure(figsize=figsize)<EOL>plt.subplot(rows, columns, <NUM_LIT:1>)<EOL>plot_image_plane_image(<EOL>tracer=tracer, mask=mask, extract_array_from_mask=extract_array_from_mask, zoom_around_mask=zoom_around_mask,<EOL>positions=positions, as_subplot=True,<EOL>units=units, figsize=figsize, aspect=aspect,<EOL>cmap=cmap, norm=norm, norm_min=norm_min, norm_max=norm_max, linthresh=linthresh, linscale=linscale,<EOL>cb_ticksize=cb_ticksize, cb_fraction=cb_fraction, cb_pad=cb_pad, <EOL>cb_tick_values=cb_tick_values, cb_tick_labels=cb_tick_labels,<EOL>titlesize=titlesize, xlabelsize=xlabelsize, ylabelsize=ylabelsize, xyticksize=xyticksize,<EOL>mask_pointsize=mask_pointsize, position_pointsize=position_pointsize,<EOL>output_path=output_path, output_filename='<STR_LIT>', output_format=output_format)<EOL>if tracer.has_mass_profile:<EOL><INDENT>plt.subplot(rows, columns, <NUM_LIT:2>)<EOL>plot_convergence(<EOL>tracer=tracer, mask=mask, extract_array_from_mask=extract_array_from_mask,<EOL>zoom_around_mask=zoom_around_mask, as_subplot=True,<EOL>units=units, figsize=figsize, aspect=aspect,<EOL>cmap=cmap, norm=norm, norm_min=norm_min, norm_max=norm_max, linthresh=linthresh, linscale=linscale,<EOL>cb_ticksize=cb_ticksize, cb_fraction=cb_fraction, cb_pad=cb_pad, <EOL>cb_tick_values=cb_tick_values, cb_tick_labels=cb_tick_labels,<EOL>titlesize=titlesize, xlabelsize=xlabelsize, ylabelsize=ylabelsize, xyticksize=xyticksize,<EOL>output_path=output_path, output_filename='<STR_LIT>', output_format=output_format)<EOL>plt.subplot(rows, columns, <NUM_LIT:3>)<EOL>plot_potential(<EOL>tracer=tracer, mask=mask, extract_array_from_mask=extract_array_from_mask,<EOL>zoom_around_mask=zoom_around_mask, as_subplot=True,<EOL>units=units, figsize=figsize, aspect=aspect,<EOL>cmap=cmap, norm=norm, norm_min=norm_min, norm_max=norm_max, linthresh=linthresh, linscale=linscale,<EOL>cb_ticksize=cb_ticksize, cb_fraction=cb_fraction, cb_pad=cb_pad, <EOL>cb_tick_values=cb_tick_values, cb_tick_labels=cb_tick_labels,<EOL>titlesize=titlesize, xlabelsize=xlabelsize, ylabelsize=ylabelsize, xyticksize=xyticksize,<EOL>output_path=output_path, output_filename='<STR_LIT>', output_format=output_format)<EOL><DEDENT>plt.subplot(rows, columns, <NUM_LIT:4>)<EOL>plane_plotters.plot_plane_image(<EOL>plane=tracer.source_plane, as_subplot=True, positions=None, plot_grid=False,<EOL>cmap=cmap, norm=norm, norm_min=norm_min, norm_max=norm_max, linthresh=linthresh, linscale=linscale,<EOL>cb_ticksize=cb_ticksize, cb_fraction=cb_fraction, cb_pad=cb_pad, <EOL>cb_tick_values=cb_tick_values, cb_tick_labels=cb_tick_labels,<EOL>titlesize=titlesize, xlabelsize=xlabelsize, ylabelsize=ylabelsize, xyticksize=xyticksize,<EOL>grid_pointsize=grid_pointsize,<EOL>output_path=output_path, output_filename='<STR_LIT>', output_format=output_format)<EOL>if tracer.has_mass_profile:<EOL><INDENT>plt.subplot(rows, columns, <NUM_LIT:5>)<EOL>plot_deflections_y(<EOL>tracer=tracer, mask=mask, extract_array_from_mask=extract_array_from_mask,<EOL>zoom_around_mask=zoom_around_mask, as_subplot=True,<EOL>units=units, figsize=figsize, aspect=aspect,<EOL>cmap=cmap, norm=norm, norm_min=norm_min, norm_max=norm_max, linthresh=linthresh, linscale=linscale,<EOL>cb_ticksize=cb_ticksize, cb_fraction=cb_fraction, cb_pad=cb_pad, <EOL>cb_tick_values=cb_tick_values, cb_tick_labels=cb_tick_labels,<EOL>titlesize=titlesize, xlabelsize=xlabelsize, ylabelsize=ylabelsize, xyticksize=xyticksize,<EOL>output_path=output_path, output_filename='<STR_LIT>', output_format=output_format)<EOL>plt.subplot(rows, columns, <NUM_LIT:6>)<EOL>plot_deflections_x(<EOL>tracer=tracer, mask=mask, extract_array_from_mask=extract_array_from_mask,<EOL>zoom_around_mask=zoom_around_mask, as_subplot=True,<EOL>units=units, figsize=figsize, aspect=aspect,<EOL>cmap=cmap, norm=norm, norm_min=norm_min, norm_max=norm_max, linthresh=linthresh, linscale=linscale,<EOL>cb_ticksize=cb_ticksize, cb_fraction=cb_fraction, cb_pad=cb_pad, <EOL>cb_tick_values=cb_tick_values, cb_tick_labels=cb_tick_labels,<EOL>titlesize=titlesize, xlabelsize=xlabelsize, ylabelsize=ylabelsize, xyticksize=xyticksize,<EOL>output_path=output_path, output_filename='<STR_LIT>', output_format=output_format)<EOL><DEDENT>plotter_util.output_subplot_array(output_path=output_path, output_filename=output_filename,<EOL>output_format=output_format)<EOL>plt.close()<EOL>

Plot the observed _tracer of an analysis, using the *CCD* class object.

    The visualization and output type can be fully customized.

    Parameters
    -----------
    tracer : autolens.ccd.tracer.CCD
        Class containing the _tracer, noise_map-mappers and PSF that are to be plotted.
        The font size of the figure ylabel.
    output_path : str
        The path where the _tracer is output if the output_type is a file format (e.g. png, fits)
    output_format : str
        How the _tracer is output. File formats (e.g. png, fits) output the _tracer to harddisk. 'show' displays the _tracer \
        in the python interpreter window.


def fit_lens_data_with_sensitivity_tracers(lens_data, tracer_normal, tracer_sensitive):

if (tracer_normal.has_light_profile and tracer_sensitive.has_light_profile) and(not tracer_normal.has_pixelization and not tracer_sensitive.has_pixelization):<EOL><INDENT>return SensitivityProfileFit(lens_data=lens_data, tracer_normal=tracer_normal,<EOL>tracer_sensitive=tracer_sensitive)<EOL><DEDENT>elif (not tracer_normal.has_light_profile and not tracer_sensitive.has_light_profile) and(tracer_normal.has_pixelization and tracer_sensitive.has_pixelization):<EOL><INDENT>return SensitivityInversionFit(lens_data=lens_data, tracer_normal=tracer_normal,<EOL>tracer_sensitive=tracer_sensitive)<EOL><DEDENT>else:<EOL><INDENT>raise exc.FittingException('<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT>

Fit lens data with a normal tracer and sensitivity tracer, to determine our sensitivity to a selection of \
    galaxy components. This factory automatically determines the type of fit based on the properties of the galaxies \
    in the tracers.

    Parameters
    -----------
    lens_data : lens_data.LensData or lens_data.LensDataHyper
        The lens-images that is fitted.
    tracer_normal : ray_tracing.AbstractTracer
        A tracer whose galaxies have the same model components (e.g. light profiles, mass profiles) as the \
        lens data that we are fitting.
    tracer_sensitive : ray_tracing.AbstractTracerNonStack
        A tracer whose galaxies have the same model components (e.g. light profiles, mass profiles) as the \
        lens data that we are fitting, but also addition components (e.g. mass clumps) which we measure \
        how sensitive we are too.


def __init__(self, lens_data, tracer_normal, tracer_sensitive):

AbstractSensitivityFit.__init__(self=self, tracer_normal=tracer_normal, tracer_sensitive=tracer_sensitive)<EOL>self.fit_normal = lens_fit.LensProfileFit(lens_data=lens_data, tracer=tracer_normal)<EOL>self.fit_sensitive = lens_fit.LensProfileFit(lens_data=lens_data, tracer=tracer_sensitive)<EOL>

Evaluate the sensitivity of a profile fit to a specific component of a lens model and tracer. This is \
        performed by evaluating the likelihood of a fit to an image using two tracers:

        1) A 'normal tracer', which uses the same lens model as a the simulated lens data. This gives a baseline \
           value of the likelihood we can expect when we fit the model to itself.

        2) A 'sensitive tracer', which uses the same lens model as the simulated lens data, but also includes the \
           additional model components (e.g. a mass clump 'subhalo') which we are testing our sensitivity to.

        The difference in likelihood of these two fits informs us of how sensitive we are to the component in the \
        second tracer. For example, if the difference in likelihood is neglible, it means the model component had no \
        impact on our fit, meaning we are not sensitive to its properties.

        Parameters
        ----------
        lens_data: lens_data.LensData
            A simulated lens data which is used to determine our sensitiivity to specific model components.
        tracer_normal : ray_tracing.AbstractTracer
            A tracer whose galaxies have the same model components (e.g. light profiles, mass profiles) as the \
            lens data that we are fitting.
       tracer_sensitive : ray_tracing.AbstractTracerNonStack
            A tracer whose galaxies have the same model components (e.g. light profiles, mass profiles) as the \
            lens data that we are fitting, but also addition components (e.g. mass clumps) which we measure \
            how sensitive we are too.