コード例 #1
0
source_galaxy = al.Galaxy(
    redshift=1.0,
    light=al.lp.EllipticalSersic(
        centre=(0.0, 0.0),
        elliptical_comps=(0.096225, -0.055555),
        intensity=0.4,
        effective_radius=0.5,
        sersic_index=1.0,
    ),
)

for instrument in ["vro", "euclid", "hst", "hst_up", "ao"]:

    imaging = instrument_util.load_test_imaging(
        data_name="lens_sie__source_smooth",
        instrument=instrument,
        psf_shape_2d=psf_shape_2d,
    )

    mask = al.Mask.circular(
        shape_2d=imaging.shape_2d,
        pixel_scales=imaging.pixel_scales,
        sub_size=sub_size,
        radius=radius,
    )

    masked_imaging = al.MaskedImaging(imaging=imaging, mask=mask)

    print("Light profile fit run times for image type " + instrument + "\n")
    print("Number of points = " + str(masked_imaging.grid.sub_shape_1d) + "\n")
コード例 #2
0
from autolens.plot import plotters
from test_autolens.simulate.imaging import instrument_util

# In this tutorial, we'll introduce a new pixelization, called an adaptive-pixelization. This pixelization doesn't use
# uniform grid of rectangular pixels, but instead uses ir'Voronoi' pixels. So, why would we want to do that?
# Lets take another look at the rectangular grid, and think about its weakness.

# Lets quickly remind ourselves of the image, and the 3.0" circular mask we'll use to mask it.
imaging = instrument_util.load_test_imaging(
    data_name="lens_light_dev_vaucouleurs", instrument="vro")
array = imaging.image

mask = al.Mask.elliptical(
    shape=imaging.shape_2d,
    pixel_scales=imaging.pixel_scales,
    major_axis_radius=6.0,
    axis_ratio=0.5,
    phi=0.0,
    centre=(0.0, 0.0),
)
aplt.Array(array=array,
           mask=mask,
           positions=[[(1.0, 1.0)]],
           centres=[[(0.0, 0.0)]])

imaging = instrument_util.load_test_imaging(
    data_name="lens_sis__source_smooth__offset_centre", instrument="vro")
array = imaging.image

mask = al.Mask.elliptical(
    shape=imaging.shape_2d,
コード例 #3
0
import autolens as al
import autolens.plot as aplt

from test_autolens.simulate.imaging import instrument_util

# In this tutorial, we'll introduce a new pixelization, called an adaptive-pixelization. This pixelization doesn't use
# uniform grid of rectangular pixels, but instead uses ir'Voronoi' pixels. So, why would we want to do that?
# Lets take another look at the rectangular grid, and think about its weakness.

# Lets quickly remind ourselves of the image, and the 3.0" circular mask we'll use to mask it.
imaging = instrument_util.load_test_imaging(
    data_name="lens_light_dev_vaucouleurs", instrument="vro"
)

array = imaging.image

array_overlay = al.Array.manual_2d(array=[[1.0, 2.0], [3.0, 4.0]], pixel_scales=5.05)


aplt.Array(array=array, array_overlay=array_overlay)
コード例 #4
0
import autolens as al

from test_autolens.simulate.imaging import instrument_util

imaging = instrument_util.load_test_imaging(
    data_name="lens_sie__source_smooth__offset_centre", instrument="vro")


def fit_with_offset_centre(centre):

    mask = al.Mask.elliptical(
        shape_2d=imaging.shape_2d,
        pixel_scales=imaging.pixel_scales,
        major_axis_radius=3.0,
        axis_ratio=1.0,
        phi=0.0,
        centre=centre,
    )

    # The lines of code below do everything we're used to, that is, setup an image and its grid, mask it, trace it
    # via a tracer, setup the rectangular mapper, etc.
    lens_galaxy = al.Galaxy(
        redshift=0.5,
        mass=al.mp.EllipticalIsothermal(centre=(2.0, 2.0),
                                        einstein_radius=1.2,
                                        elliptical_comps=(0.17647, 0.0)),
    )
    source_galaxy = al.Galaxy(
        redshift=1.0,
        pixelization=al.pix.VoronoiMagnification(shape=(20, 20)),
        regularization=al.reg.Constant(coefficient=1.0),