예제 #1
0
    def test__plot_array__works_with_all_extras_included(
            self, plot_path, plot_patch):

        array = aa.array.ones(shape_2d=(31, 31),
                              pixel_scales=(1.0, 1.0),
                              sub_size=2)

        mask = aa.mask.circular(
            shape_2d=array.shape_2d,
            pixel_scales=array.pixel_scales,
            radius=5.0,
            centre=(2.0, 2.0),
        )

        grid = aa.grid.uniform(shape_2d=(11, 11), pixel_scales=0.5)

        plotter = aplt.Plotter(output=aplt.Output(
            path=plot_path, filename="array1", format="png"))

        plotter.plot_array(
            array=array,
            mask=mask,
            grid=grid,
            positions=[(-1.0, -1.0)],
            lines=[(1.0, 1.0), (2.0, 2.0)],
            include_origin=True,
            include_border=True,
        )

        assert plot_path + "array1.png" in plot_patch.paths

        plotter = aplt.Plotter(output=aplt.Output(
            path=plot_path, filename="array2", format="png"))

        plotter.plot_array(
            array=array,
            mask=mask,
            grid=grid,
            positions=[[(1.0, 1.0), (2.0, 2.0)], [(-1.0, -1.0)]],
            lines=[[(1.0, 1.0), (2.0, 2.0)], [(2.0, 4.0), (5.0, 6.0)]],
            include_origin=True,
            include_border=True,
        )

        assert plot_path + "array2.png" in plot_patch.paths

        aplt.array(
            array=array,
            mask=mask,
            grid=grid,
            positions=[(-1.0, -1.0)],
            lines=[(1.0, 1.0), (2.0, 2.0)],
            include=aplt.Include(origin=True, border=True),
            plotter=aplt.Plotter(output=aplt.Output(
                path=plot_path, filename="array3", format="png")),
        )

        assert plot_path + "array3.png" in plot_patch.paths
예제 #2
0
import autoarray as aa
import autoarray.plot as aplt

array = aa.array.ones(shape_2d=(31, 31), pixel_scales=(1.0, 1.0), sub_size=2)

aplt.array(array=array, lines=[(1.0, 1.0), (2.0, 2.0)])

aplt.array(array=array,
           lines=[[(1.0, 1.0), (2.0, 2.0)], [(2.0, 4.0), (5.0, 6.0)]])
예제 #3
0
import autoarray as aa
import autoarray.plot as aplt

array = aa.array.ones(shape_2d=(31, 31), pixel_scales=(1.0, 1.0), sub_size=2)
array[0] = 3.0

mask = aa.mask.circular(
    shape_2d=array.shape_2d,
    pixel_scales=array.pixel_scales,
    radius=5.0,
    centre=(2.0, 2.0),
)

aplt.array(array=array, mask=mask, include_border=True)
예제 #4
0
파일: grid.py 프로젝트: Sketos/PyAutoArray
import autoarray as aa
import autoarray.plot as aplt

array = aa.array.ones(shape_2d=(31, 31), pixel_scales=(1.0, 1.0), sub_size=2)
array[0] = 3.0

grid = aa.grid.uniform(shape_2d=(11, 11), pixel_scales=0.5)

aplt.array(array=array, grid=grid)
예제 #5
0
import autoarray as aa
import autoarray.plot as aplt

array = aa.array.ones(shape_2d=(31, 31), pixel_scales=(1.0, 1.0), sub_size=2)
array[0] = 3.0

aplt.array(array=array, include_origin=True)
예제 #6
0
array[0] = 3.0

mask = aa.mask.circular(
    shape_2d=array.shape_2d,
    pixel_scales=array.pixel_scales,
    radius=5.0,
    centre=(2.0, 2.0),
)

grid = aa.grid.uniform(shape_2d=(11, 11), pixel_scales=0.5)

aplt.array(
    array=array,
    mask=mask,
    grid=grid,
    positions=[(-1.0, -1.0)],
    lines=[(1.0, 1.0), (2.0, 2.0)],
    include_origin=True,
    include_border=True,
)

aplt.array(
    array=array,
    mask=mask,
    grid=grid,
    positions=[[(1.0, 1.0), (2.0, 2.0)], [(-1.0, -1.0)]],
    lines=[[(1.0, 1.0), (2.0, 2.0)], [(2.0, 4.0), (5.0, 6.0)]],
    include_origin=True,
    include_border=True,
)
예제 #7
0
import autoarray as aa
import autoarray.plot as aplt

array = aa.array.ones(shape_2d=(31, 31), pixel_scales=(1.0, 1.0), sub_size=2)
array[0] = 3.0

mask = aa.mask.circular(
    shape_2d=array.shape_2d,
    pixel_scales=array.pixel_scales,
    radius=5.0,
    centre=(2.0, 2.0),
)

aplt.array(array=array, mask=mask)
예제 #8
0
import autoarray as aa
import autoarray.plot as aplt

array = aa.array.ones(shape_2d=(31, 31), pixel_scales=(1.0, 1.0), sub_size=2)
array[0] = 3.0

aplt.array(array=array, positions=[(1.0, 1.0), (2.0, 2.0)])

aplt.array(array=array, positions=[[(1.0, 1.0), (2.0, 2.0)], [(-1.0, -1.0)]])