How to use the autoarray.plot_array function in autoarray

To help you get started, we’ve selected a few autoarray examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Jammy2211 / PyAutoLens / autolens / model / galaxy / plotters / galaxy_fit_plotters.py View on Github external
if galaxy_data.use_image:
        title = "Galaxy Data Image"
    elif galaxy_data.use_convergence:
        title = "Galaxy Data Convergence"
    elif galaxy_data.use_potential:
        title = "Galaxy Data Potential"
    elif galaxy_data.use_deflections_y:
        title = "Galaxy Data Deflections (y)"
    elif galaxy_data.use_deflections_x:
        title = "Galaxy Data Deflections (x)"
    else:
        raise exc.PlottingException(
            "The galaxy data_type array does not have a True use_profile_type"
        )

    aa.plot_array(
        array=galaxy_data.image(return_in_2d=True),
        mask_overlay=mask,
        positions=positions,
        as_subplot=as_subplot,
        units=units,
        kpc_per_arcsec=kpc_per_arcsec,
        figsize=figsize,
        aspect=aspect,
        cmap=cmap,
        norm=norm,
        norm_min=norm_min,
        norm_max=norm_max,
        linthresh=linthresh,
        linscale=linscale,
        cb_ticksize=cb_ticksize,
        cb_fraction=cb_fraction,
github Jammy2211 / PyAutoLens / autolens / model / galaxy / plotters / galaxy_plotters.py View on Github external
galaxy : model.galaxy.galaxy.Galaxy
        The galaxy whose y deflecton angles are plotted.
    grid : ndarray or datas.array.grid_stacks.Grid
        The (y,x) coordinates of the grid, in an array of shape (total_coordinates, 2)
    """
    deflections = galaxy.deflections_from_grid(grid)
    deflections_y = grid.mask.mapping.scaled_array_2d_from_array_1d(deflections[:, 0])

    lines = aa.plotter_util.get_critical_curve_and_caustic(
        obj=galaxy,
        grid=grid,
        plot_critical_curve=plot_critical_curves,
        plot_caustics=plot_caustics,
    )

    aa.plot_array(
        array=deflections_y,
        mask_overlay=mask,
        positions=positions,
        lines=lines,
        as_subplot=as_subplot,
        units=units,
        kpc_per_arcsec=kpc_per_arcsec,
        figsize=figsize,
        aspect=aspect,
        cmap=cmap,
        norm=norm,
        norm_min=norm_min,
        norm_max=norm_max,
        linthresh=linthresh,
        linscale=linscale,
        cb_ticksize=cb_ticksize,
github Jammy2211 / PyAutoLens / autolens / model / profiles / plotters / profile_plotters.py View on Github external
output_filename="image",
):
    """Plot the image of a light profile, on a grid of (y,x) coordinates.

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

    Parameters
    -----------
    light_profile : model.profiles.light_profiles.LightProfile
        The light profile whose image are plotted.
    grid : ndarray or hyper_galaxies.array.grid_stacks.Grid
        The (y,x) coordinates of the grid, in an array of shape (total_coordinates, 2)
    """
    image = light_profile.profile_image_from_grid(grid=grid)

    aa.plot_array(
        array=image,
        mask_overlay=mask,
        positions=positions,
        as_subplot=as_subplot,
        units=units,
        kpc_per_arcsec=kpc_per_arcsec,
        figsize=figsize,
        aspect=aspect,
        cmap=cmap,
        norm=norm,
        norm_min=norm_min,
        norm_max=norm_max,
        linthresh=linthresh,
        linscale=linscale,
        cb_ticksize=cb_ticksize,
        cb_fraction=cb_fraction,
github Jammy2211 / PyAutoLens / autolens / plotters / fit_plotters.py View on Github external
):
    """Plot the image of a lens fit.

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

    Parameters
    -----------
    image : datas.imaging.datas.Imaging
        The datas-datas, which includes the observed datas, noise_map-map, PSF, signal-to-noise_map-map, etc.
    plot_origin : True
        If true, the origin of the datas's coordinate system is plotted as a 'x'.
    """

    image = fit.image.in_2d

    aa.plot_array(
        array=image,
        grid=grid,
        mask_overlay=mask,
        positions=positions,
        as_subplot=as_subplot,
        units=units,
        kpc_per_arcsec=kpc_per_arcsec,
        figsize=figsize,
        aspect=aspect,
        cmap=cmap,
        norm=norm,
        norm_min=norm_min,
        norm_max=norm_max,
        linthresh=linthresh,
        linscale=linscale,
        cb_ticksize=cb_ticksize,
github Jammy2211 / PyAutoLens / autolens / model / inversion / plotters / inversion_plotters.py View on Github external
ylabelsize=16,
    xyticksize=16,
    output_path=None,
    output_format="show",
    output_filename="pixelization_source_values",
):

    if isinstance(inversion.mapper, mappers.RectangularMapper):

        reconstructed_pixelization = inversion.mapper.reconstructed_pixelization_from_solution_vector(
            solution_vector=source_pixel_values
        )

        origin = get_origin(image=reconstructed_pixelization, plot_origin=plot_origin)

        aa.plot_array(
            array=reconstructed_pixelization,
            should_plot_origin=origin,
            positions=positions,
            as_subplot=True,
            units=units,
            kpc_per_arcsec=kpc_per_arcsec,
            figsize=figsize,
            aspect=aspect,
            cmap=cmap,
            norm=norm,
            norm_min=norm_min,
            norm_max=norm_max,
            linthresh=linthresh,
            linscale=linscale,
            cb_ticksize=cb_ticksize,
            cb_fraction=cb_fraction,
github Jammy2211 / PyAutoLens / autolens / model / profiles / plotters / profile_plotters.py View on Github external
-----------
    mass_profile : model.profiles.mass_profiles.MassProfile
        The mass profile whose magnification is plotted.
    grid : ndarray or hyper_galaxies.array.grid_stacks.Grid
        The (y,x) coordinates of the grid, in an array of shape (total_coordinates, 2)
    """
    magnification = mass_profile.magnification_from_grid(grid=grid)

    lines = aa.plotter_util.get_critical_curve_and_caustic(
        obj=mass_profile,
        grid=grid,
        plot_critical_curve=plot_critical_curves,
        plot_caustics=plot_caustics,
    )

    aa.plot_array(
        array=magnification,
        mask_overlay=mask,
        positions=positions,
        lines=lines,
        as_subplot=as_subplot,
        units=units,
        kpc_per_arcsec=kpc_per_arcsec,
        figsize=figsize,
        aspect=aspect,
        cmap=cmap,
        norm=norm,
        norm_min=norm_min,
        norm_max=norm_max,
        linthresh=linthresh,
        linscale=linscale,
        cb_ticksize=cb_ticksize,
github Jammy2211 / PyAutoLens / autolens / plotters / fit_plotters.py View on Github external
):
    """Plot the noise-map of a lens fit.

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

    Parameters
    -----------
    image : datas.imaging.datas.Imaging
        The datas-datas, which includes the observed datas, noise_map-map, PSF, signal-to-noise_map-map, etc.
    plot_origin : True
        If true, the origin of the datas's coordinate system is plotted as a 'x'.
    """

    noise_map = fit.noise_map.in_2d

    aa.plot_array(
        array=noise_map,
        mask_overlay=mask,
        positions=positions,
        as_subplot=as_subplot,
        units=units,
        kpc_per_arcsec=kpc_per_arcsec,
        figsize=figsize,
        aspect=aspect,
        cmap=cmap,
        norm=norm,
        norm_min=norm_min,
        norm_max=norm_max,
        linthresh=linthresh,
        linscale=linscale,
        cb_ticksize=cb_ticksize,
        cb_fraction=cb_fraction,