示例#1
0
def test__disk_light_and_mass_profile():

    light = al.SetupPipeline(
        disk_as_sersic=False, disk_mass_to_light_ratio_gradient=False
    )
    assert (
        light.disk_light_and_mass_profile.effective_radius
        is al.lmp.EllipticalExponential
    )

    light = al.SetupPipeline(
        disk_as_sersic=True, disk_mass_to_light_ratio_gradient=False
    )
    assert light.disk_light_and_mass_profile.effective_radius is al.lmp.EllipticalSersic

    light = al.SetupPipeline(
        disk_as_sersic=False, disk_mass_to_light_ratio_gradient=True
    )
    assert (
        light.disk_light_and_mass_profile.effective_radius
        is al.lmp.EllipticalExponentialRadialGradient
    )

    light = al.SetupPipeline(
        disk_as_sersic=True, disk_mass_to_light_ratio_gradient=True
    )
    assert (
        light.disk_light_and_mass_profile.effective_radius
        is al.lmp.EllipticalSersicRadialGradient
    )
示例#2
0
    def test__tag(self):

        hyper = al.SetupHyper(
            hyper_galaxies_lens=True,
            hyper_background_noise=al.hyper_data.HyperBackgroundNoise,
            hyper_image_sky=al.hyper_data.HyperImageSky,
        )

        setup_mass = al.SetupMassLightDark(align_bulge_dark_centre=True)

        setup = al.SetupPipeline(setup_hyper=hyper, setup_mass=setup_mass)

        assert (
            setup.tag == "setup__"
            "hyper[galaxies_lens__bg_sky__bg_noise]__"
            "mass[light_dark__bulge_sersic__disk_exp__mlr_free__dark_nfw_ludlow__with_shear__align_bulge_dark_centre]"
        )

        setup_source = al.SetupSourceInversion(
            pixelization_prior_model=al.pix.Rectangular,
            regularization_prior_model=al.reg.Constant,
        )

        setup_light = al.SetupLightParametric(light_centre=(1.0, 2.0))

        setup_mass = al.SetupMassLightDark(mass_centre=(3.0, 4.0),
                                           with_shear=False)

        setup = al.SetupPipeline(setup_source=setup_source,
                                 setup_light=setup_light,
                                 setup_mass=setup_mass)

        assert (
            setup.tag == "setup__"
            "light[parametric__bulge_sersic__disk_exp__align_bulge_disk_centre__centre_(1.00,2.00)]__"
            "mass[light_dark__bulge_sersic__disk_exp__mlr_free__dark_nfw_ludlow__no_shear__centre_(3.00,4.00)]__"
            "source[inversion__pix_rect__reg_const]")

        setup_mass = al.SetupMassLightDark(align_bulge_dark_centre=True)

        setup = al.SetupPipeline(setup_mass=setup_mass)

        assert (
            setup.tag == "setup__"
            "mass[light_dark__bulge_sersic__disk_exp__mlr_free__dark_nfw_ludlow__with_shear__align_bulge_dark_centre]"
        )

        smbh = al.SetupSMBH(smbh_centre_fixed=True)

        setup_subhalo = al.SetupSubhalo(
            subhalo_instance=al.mp.SphericalNFWMCRLudlow(centre=(1.0, 2.0),
                                                         mass_at_200=1e8))

        setup = al.SetupPipeline(setup_smbh=smbh, setup_subhalo=setup_subhalo)

        assert (
            setup.tag == "setup__"
            "smbh[point_mass__centre_fixed]__"
            "subhalo[nfw_sph_ludlow__mass_is_model__source_is_model__grid_5__centre_(1.00,2.00)__mass_1.0e+08]"
        )
示例#3
0
def test__set_mass_to_light_ratios_of_light_and_mass_profiles():

    lmp_0 = af.PriorModel(al.lmp.EllipticalSersic)
    lmp_1 = af.PriorModel(al.lmp.EllipticalSersic)
    lmp_2 = af.PriorModel(al.lmp.EllipticalSersic)

    setup = al.SetupPipeline(constant_mass_to_light_ratio=False)

    setup.set_mass_to_light_ratios_of_light_and_mass_profiles(
        light_and_mass_profiles=[lmp_0, lmp_1, lmp_2]
    )

    assert lmp_0.mass_to_light_ratio != lmp_1.mass_to_light_ratio
    assert lmp_0.mass_to_light_ratio != lmp_2.mass_to_light_ratio
    assert lmp_1.mass_to_light_ratio != lmp_2.mass_to_light_ratio

    lmp_0 = af.PriorModel(al.lmp.EllipticalSersic)
    lmp_1 = af.PriorModel(al.lmp.EllipticalSersic)
    lmp_2 = af.PriorModel(al.lmp.EllipticalSersic)

    setup = al.SetupPipeline(constant_mass_to_light_ratio=True)

    setup.set_mass_to_light_ratios_of_light_and_mass_profiles(
        light_and_mass_profiles=[lmp_0, lmp_1, lmp_2]
    )

    assert lmp_0.mass_to_light_ratio == lmp_1.mass_to_light_ratio
    assert lmp_0.mass_to_light_ratio == lmp_2.mass_to_light_ratio
    assert lmp_1.mass_to_light_ratio == lmp_2.mass_to_light_ratio
示例#4
0
def test__smbh_tag():

    setup = al.SetupPipeline(include_smbh=False)
    assert setup.include_smbh_tag == ""

    setup = al.SetupPipeline(include_smbh=True, smbh_centre_fixed=True)
    assert setup.include_smbh_tag == "__smbh_centre_fixed"

    setup = al.SetupPipeline(include_smbh=True, smbh_centre_fixed=False)
    assert setup.include_smbh_tag == "__smbh_centre_free"
示例#5
0
def test__lens_light_centre_tag():

    setup = al.SetupPipeline(lens_light_centre=None)
    assert setup.lens_light_centre_tag == ""
    setup = al.SetupPipeline(lens_light_centre=(2.0, 2.0))
    assert setup.lens_light_centre_tag == "__lens_light_centre_(2.00,2.00)"
    setup = al.SetupPipeline(lens_light_centre=(3.0, 4.0))
    assert setup.lens_light_centre_tag == "__lens_light_centre_(3.00,4.00)"
    setup = al.SetupPipeline(lens_light_centre=(3.027, 4.033))
    assert setup.lens_light_centre_tag == "__lens_light_centre_(3.03,4.03)"
示例#6
0
def test__subhalo_centre_tag():

    setup = al.SetupPipeline(subhalo_instance=None)
    assert setup.subhalo_centre_tag == ""
    setup = al.SetupPipeline(subhalo_instance=al.mp.SphericalNFW(centre=(2.0, 2.0)))
    assert setup.subhalo_centre_tag == "__sub_centre_(2.00,2.00)"
    setup = al.SetupPipeline(subhalo_instance=al.mp.SphericalNFW(centre=(3.0, 4.0)))
    assert setup.subhalo_centre_tag == "__sub_centre_(3.00,4.00)"
    setup = al.SetupPipeline(subhalo_instance=al.mp.SphericalNFW(centre=(3.027, 4.033)))
    assert setup.subhalo_centre_tag == "__sub_centre_(3.03,4.03)"
示例#7
0
def make_pipeline(name, folders, search=af.DynestyStatic()):

    phase1 = al.PhaseImaging(
        phase_name="phase_1",
        folders=folders,
        galaxies=dict(
            lens=al.GalaxyModel(redshift=0.5, mass=al.mp.EllipticalIsothermal),
            source=al.GalaxyModel(redshift=1.0, light=al.lp.EllipticalSersic),
        ),
        search=af.DynestyStatic(n_live_points=40, evidence_tolerance=10.0),
    )

    pixeliation = af.PriorModel(al.pix.VoronoiBrightnessImage)
    pixeliation.pixels = 100

    phase1 = phase1.extend_with_multiple_hyper_phases(setup=al.SetupPipeline(),
                                                      include_inversion=False)

    phase2 = al.PhaseImaging(
        phase_name="phase_2",
        folders=folders,
        galaxies=dict(
            lens=al.GalaxyModel(
                redshift=0.5, mass=phase1.result.instance.galaxies.lens.mass),
            source=al.GalaxyModel(
                redshift=1.0,
                pixelization=pixeliation,
                regularization=al.reg.AdaptiveBrightness,
            ),
        ),
        search=af.DynestyStatic(n_live_points=40, evidence_tolerance=10.0),
    )

    phase2 = phase2.extend_with_multiple_hyper_phases(setup=al.SetupPipeline(),
                                                      include_inversion=True)

    phase3 = al.PhaseImaging(
        phase_name="phase_3",
        folders=folders,
        galaxies=dict(
            lens=al.GalaxyModel(redshift=0.5,
                                mass=phase1.result.model.galaxies.lens.mass),
            source=al.GalaxyModel(
                redshift=1.0,
                pixelization=phase2.result.instance.galaxies.source.
                pixelization,
                regularization=phase2.result.instance.galaxies.source.
                regularization,
            ),
        ),
        search=af.DynestyStatic(n_live_points=40, evidence_tolerance=10.0),
    )

    return al.PipelineDataset(name, phase1, phase2, phase3)
示例#8
0
def test__align_light_mass_centre_tag__is_empty_sting_if_both_lens_light_and_mass_centres_input():
    setup = al.SetupPipeline(align_light_mass_centre=False)
    assert setup.align_light_mass_centre_tag == ""
    setup = al.SetupPipeline(align_light_mass_centre=True)
    assert setup.align_light_mass_centre_tag == "__align_light_mass_centre"
    setup = al.SetupPipeline(
        lens_light_centre=(0.0, 0.0),
        lens_mass_centre=(1.0, 1.0),
        align_light_mass_centre=True,
    )
    assert setup.align_light_mass_centre_tag == ""
示例#9
0
def test__bulge_and_disk_mass_to_light_ratio_gradient_tag():

    setup = al.SetupPipeline(bulge_mass_to_light_ratio_gradient=True)
    assert setup.bulge_mass_to_light_ratio_gradient_tag == "_bulge"
    setup = al.SetupPipeline(bulge_mass_to_light_ratio_gradient=False)
    assert setup.bulge_mass_to_light_ratio_gradient_tag == ""

    setup = al.SetupPipeline(disk_mass_to_light_ratio_gradient=True)
    assert setup.disk_mass_to_light_ratio_gradient_tag == "_disk"
    setup = al.SetupPipeline(disk_mass_to_light_ratio_gradient=False)
    assert setup.disk_mass_to_light_ratio_gradient_tag == ""
示例#10
0
def test__bulge_light_and_mass_profile():

    light = al.SetupPipeline(bulge_mass_to_light_ratio_gradient=False)
    assert (
        light.bulge_light_and_mass_profile.effective_radius is al.lmp.EllipticalSersic
    )

    light = al.SetupPipeline(bulge_mass_to_light_ratio_gradient=True)
    assert (
        light.bulge_light_and_mass_profile.effective_radius
        is al.lmp.EllipticalSersicRadialGradient
    )
示例#11
0
def test__subhalo_mass_at_200_tag():

    setup = al.SetupPipeline(subhalo_instance=None)
    assert setup.subhalo_mass_at_200_tag == ""
    setup = al.SetupPipeline(
        subhalo_instance=al.mp.SphericalNFWMCRLudlow(mass_at_200=1e8)
    )
    assert setup.subhalo_mass_at_200_tag == "__sub_mass_1.0e+08"
    setup = al.SetupPipeline(
        subhalo_instance=al.mp.SphericalNFWMCRLudlow(mass_at_200=1e9)
    )
    assert setup.subhalo_mass_at_200_tag == "__sub_mass_1.0e+09"
    setup = al.SetupPipeline(
        subhalo_instance=al.mp.SphericalNFWMCRLudlow(mass_at_200=1e10)
    )
    assert setup.subhalo_mass_at_200_tag == "__sub_mass_1.0e+10"
示例#12
0
def test__smbh_from_centre():

    setup = al.SetupPipeline(include_smbh=False, smbh_centre_fixed=True)
    smbh = setup.smbh_from_centre(centre=(0.0, 0.0))
    assert smbh is None

    setup = al.SetupPipeline(include_smbh=True, smbh_centre_fixed=True)
    smbh = setup.smbh_from_centre(centre=(0.0, 0.0))
    assert isinstance(smbh, af.PriorModel)
    assert smbh.centre == (0.0, 0.0)

    setup = al.SetupPipeline(include_smbh=True, smbh_centre_fixed=False)
    smbh = setup.smbh_from_centre(centre=(0.1, 0.2), centre_sigma=0.2)
    assert isinstance(smbh, af.PriorModel)
    assert isinstance(smbh.centre[0], af.GaussianPrior)
    assert smbh.centre[0].mean == 0.1
    assert smbh.centre[0].sigma == 0.2
    assert isinstance(smbh.centre[1], af.GaussianPrior)
    assert smbh.centre[1].mean == 0.2
    assert smbh.centre[1].sigma == 0.2
示例#13
0
def test__tag():

    setup = al.SetupPipeline(
        hyper_galaxies=True,
        hyper_background_noise=True,
        hyper_image_sky=True,
        align_bulge_dark_centre=True,
    )

    assert (
        setup.tag
        == "setup__hyper_galaxies_bg_sky_bg_noise__with_shear__align_bulge_dark_centre"
    )

    setup = al.SetupPipeline(
        pixelization=al.pix.Rectangular,
        regularization=al.reg.Constant,
        lens_light_centre=(1.0, 2.0),
        lens_mass_centre=(3.0, 4.0),
        align_light_mass_centre=False,
        no_shear=True,
    )

    assert (
        setup.tag
        == "setup__pix_rect__reg_const__lens_light_centre_(1.00,2.00)__no_shear__lens_mass_centre_(3.00,4.00)"
    )

    setup = al.SetupPipeline(align_light_mass_centre=True, number_of_gaussians=1)

    assert setup.tag == "setup__align_light_mass_centre__gaussians_x1__with_shear"

    setup = al.SetupPipeline(
        subhalo_instance=al.mp.SphericalNFWMCRLudlow(centre=(1.0, 2.0), mass_at_200=1e8)
    )

    assert setup.tag == "setup__with_shear__sub_centre_(1.00,2.00)__sub_mass_1.0e+08"

    setup = al.SetupPipeline(include_smbh=True, smbh_centre_fixed=True)

    assert setup.tag == "setup__with_shear__smbh_centre_fixed"
示例#14
0
def test__mass_to_light_ratio_tag():

    setup = al.SetupPipeline(
        constant_mass_to_light_ratio=True,
        bulge_mass_to_light_ratio_gradient=False,
        disk_mass_to_light_ratio_gradient=False,
    )
    assert setup.mass_to_light_ratio_tag == "__mlr_const"

    setup = al.SetupPipeline(
        constant_mass_to_light_ratio=True,
        bulge_mass_to_light_ratio_gradient=True,
        disk_mass_to_light_ratio_gradient=False,
    )
    assert setup.mass_to_light_ratio_tag == "__mlr_const_grad_bulge"

    setup = al.SetupPipeline(
        constant_mass_to_light_ratio=True,
        bulge_mass_to_light_ratio_gradient=True,
        disk_mass_to_light_ratio_gradient=True,
    )
    assert setup.mass_to_light_ratio_tag == "__mlr_const_grad_bulge_disk"
示例#15
0
def test__align_light_dark_tag():

    setup = al.SetupPipeline(align_light_dark_centre=False)
    assert setup.align_light_dark_centre_tag == ""
    setup = al.SetupPipeline(align_light_dark_centre=True)
    assert setup.align_light_dark_centre_tag == "__align_light_dark_centre"
This means you can run the same pipeline on the same data twice (e.g. with and without shear) and the results will go
to different output folders and thus not clash with one another!

The `path_prefix` below specifies the path the pipeline results are written to, which is:

 `autolens_workspace/output/transdimensional/dataset_type/dataset_name` 
 `autolens_workspace/output/transdimensional/imaging/mass_sie__source_inversion/`

The redshift of the lens and source galaxies are also input (see `examples/model/customize/redshift.py`) for a 
description of what inputting redshifts into **PyAutoLens** does.
"""

setup = al.SetupPipeline(
    path_prefix=path.join("hyper", dataset_name),
    setup_hyper=setup_hyper,
    setup_mass=setup_mass,
    setup_source=setup_source,
)
"""
__PIPELINE CREATION__

To create a pipeline we import it from the pipelines folder and run its `make_pipeline` function, inputting the 
`Setup` and `SettingsPhase` above.
"""

from pipelines import mass_total__source_inversion

pipeline = mass_total__source_inversion.make_pipeline(setup=setup,
                                                      settings=settings)
"""
__Pipeline Run__
示例#17
0
def test__constant_mass_to_light_ratio_tag():

    setup = al.SetupPipeline(constant_mass_to_light_ratio=True)
    assert setup.constant_mass_to_light_ratio_tag == "_const"
    setup = al.SetupPipeline(constant_mass_to_light_ratio=False)
    assert setup.constant_mass_to_light_ratio_tag == "_free"
示例#18
0
def test__no_shear_tag():
    setup = al.SetupPipeline(no_shear=False)
    assert setup.no_shear_tag == "__with_shear"

    setup = al.SetupPipeline(no_shear=True)
    assert setup.no_shear_tag == "__no_shear"
 `autolens_workspace/output/dataset_type/dataset_name` 
 `autolens_workspace/output/imaging/mass_sie__source_sersic`
"""

setup_mass = al.SetupMassTotal(with_shear=False)

setup_source = al.SetupSourceInversion(
    pixelization_prior_model=al.pix.VoronoiMagnification,
    regularization_prior_model=al.reg.Constant,
)

# %%
setup = al.SetupPipeline(
    path_prefix=path.join("pipelines", dataset_type, dataset_name),
    setup_mass=setup_mass,
    setup_source=setup_source,
)

# %%
"""
__Pipeline Creation__

To create a pipeline we import it from the pipelines folder and run its `make_pipeline` function, inputting the 
`Setup` and `SettingsPhase` above.
"""

# %%
from pipelines import mass_total__source_inversion

pipeline = mass_total__source_inversion.make_pipeline(setup=setup, settings=settings)
示例#20
0
# %%
"""
__Pipeline_Setup_And_Tagging__:

For this pipeline the pipeline setup customizes and tags:

 - The Pixelization used by the inversion of this pipeline.
 - The Regularization scheme used by of this pipeline.
 - If there is an external shear in the mass model or not.
"""

# %%
setup = al.SetupPipeline(
    pixelization=al.pix.VoronoiMagnification,
    regularization=al.reg.Constant,
    no_shear=False,
    folders=["c4_t8_inversion"],
)

# %%
"""
__Pipeline Creation__

To create a pipeline we import it from the pipelines folder and run its 'make_pipeline' function, inputting the 
*Setup* and *SettingsPhase* above.
"""

# %%
from howtolens.chapter_4_inversions import tutorial_8_pipeline

pipeline_inversion = tutorial_8_pipeline.make_pipeline(setup=setup, settings=settings)
示例#21
0
    def test__phase_is_extended_with_hyper_phases__sets_up_hyper_images(
            self, interferometer_7, mask_7x7):

        galaxies = af.ModelInstance()
        galaxies.lens = al.Galaxy(redshift=0.5)
        galaxies.source = al.Galaxy(redshift=1.0)

        instance = af.ModelInstance()
        instance.galaxies = galaxies

        hyper_galaxy_image_path_dict = {
            ("galaxies", "lens"):
            al.Array.ones(shape_2d=(3, 3), pixel_scales=1.0),
            ("galaxies", "source"):
            al.Array.full(fill_value=2.0, shape_2d=(3, 3), pixel_scales=1.0),
        }

        hyper_galaxy_visibilities_path_dict = {
            ("galaxies", "lens"):
            al.Visibilities.full(fill_value=4.0, shape_1d=(7, )),
            ("galaxies", "source"):
            al.Visibilities.full(fill_value=5.0, shape_1d=(7, )),
        }

        results = mock.MockResults(
            hyper_galaxy_image_path_dict=hyper_galaxy_image_path_dict,
            hyper_model_image=al.Array.full(fill_value=3.0, shape_2d=(3, 3)),
            hyper_galaxy_visibilities_path_dict=
            hyper_galaxy_visibilities_path_dict,
            hyper_model_visibilities=al.Visibilities.full(fill_value=6.0,
                                                          shape_1d=(7, )),
            mask=mask_7x7,
            use_as_hyper_dataset=True,
        )

        phase_interferometer_7 = al.PhaseInterferometer(
            phase_name="test_phase",
            galaxies=dict(lens=al.GalaxyModel(redshift=0.5,
                                              hyper_galaxy=al.HyperGalaxy)),
            search=mock.MockSearch(),
            real_space_mask=mask_7x7,
        )

        phase_interferometer_7.extend_with_multiple_hyper_phases(
            setup=al.SetupPipeline())

        analysis = phase_interferometer_7.make_analysis(
            dataset=interferometer_7, mask=mask_7x7, results=results)

        assert (analysis.hyper_galaxy_image_path_dict[(
            "galaxies", "lens")].in_2d == np.ones((3, 3))).all()

        assert (analysis.hyper_galaxy_image_path_dict[(
            "galaxies", "source")].in_2d == 2.0 * np.ones((3, 3))).all()

        assert (analysis.hyper_model_image.in_2d == 3.0 * np.ones(
            (3, 3))).all()

        assert (analysis.hyper_galaxy_visibilities_path_dict[("galaxies",
                                                              "lens")] == 4.0 *
                np.ones((7, 2))).all()

        assert (analysis.hyper_galaxy_visibilities_path_dict[(
            "galaxies", "source")] == 5.0 * np.ones((7, 2))).all()

        assert (analysis.hyper_model_visibilities == 6.0 * np.ones(
            (7, 2))).all()
示例#22
0
"""
__Pipeline_Setup_And_Tagging__:

For this pipeline the pipeline setup customizes:

 - If there is an external shear in the mass model or not.

The pipeline setup 'tags' the output path of a pipeline. For example, if 'no_shear' is True, the pipeline's output 
paths are 'tagged' with the string 'no_shear'.

This means you can run the same pipeline on the same data twice (with and without shear) and the results will go
to different output folders and thus not clash with one another!
"""

# %%
setup = al.SetupPipeline(no_shear=False, folders=["c3_t3_complex_source"])

# %%
"""
__Pipeline Creation__

To create a _Pipeline_, we call a 'make_pipeline' function, which is written in its own Python script: 

 'tutorial_3_complex_source.py'. 

Before we check it out, lets get the pipeline running, by importing the script, running the 'make_pipeline' function
to create the _Pipeline_ object and calling that objects 'run' function.

The 'folders' below specify the path the pipeline results are written to, which is:

 'autolens_workspace/output/howtolens/c3_t3_complex_source/pipeline_name/setup_tag/phase_name/settings_tag'
示例#23
0
This means you can run the same pipeline on the same data twice (e.g. with and without shear) and the results will go
to different output folders and thus not clash with one another!

The `path_prefix` below specifies the path the pipeline results are written to, which is:

 `autolens_workspace/output/transdimensional/dataset_type/dataset_name` 
 `autolens_workspace/output/transdimensional/imaging/mass_sie__source_sersic/`
 
 The redshift of the lens and source galaxies are also input (see `examples/model/customize/redshift.py`) for a 
description of what inputting redshifts into **PyAutoLens** does.
"""

setup = al.SetupPipeline(
    path_prefix=path.join("transdimensional", dataset_name),
    redshift_lens=0.5,
    redshift_source=1.0,
    setup_mass=setup_mass,
    setup_source=setup_source,
)
"""
__Pipeline Creation__

To create a pipeline we import it from the pipelines folder and run its `make_pipeline` function, inputting the 
`Setup` and `SettingsPhase` above.
"""

from pipelines import mass_total__source_parametric

pipeline = mass_total__source_parametric.make_pipeline(setup=setup,
                                                       settings=settings)
"""
示例#24
0
"""
We also use the `SetupSourceInversion` object to customize the `Inversion` used for the source, specifically:

 - The `Pixelization` used by the `Inversion` of this pipeline.
 - The `Regularization` scheme used by the `Inversion` of this pipeline.
"""

# %%
setup_source = al.SetupSourceInversion(
    pixelization_prior_model=al.pix.VoronoiMagnification,
    regularization_prior_model=al.reg.Constant,
)

setup = al.SetupPipeline(
    path_prefix=path.join("howtolens", "c4_t8_inversion"),
    setup_mass=setup_mass,
    setup_source=setup_source,
)

# %%
"""
__Pipeline Creation__

To create a pipeline we import it from the pipelines folder and run its `make_pipeline` function, inputting the 
`Setup` and `SettingsPhase` above.
"""

# %%
from pipelines import tutorial_8_pipeline

pipeline_inversion = tutorial_8_pipeline.make_pipeline(setup=setup,
示例#25
0
"""
__Pipeline_Setup_And_Tagging__:

For this pipeline the pipeline setup customizes:

 - If there is an external shear in the mass model or not.

The pipeline setup 'tags' the output path of a pipeline. For example, if 'no_shear' is True, the pipeline's output 
paths are 'tagged' with the string 'no_shear'.

This means you can run the same pipeline on the same data twice (with and without shear) and the results will go
to different output folders and thus not clash with one another!
"""

# %%
setup = al.SetupPipeline(no_shear=False, folders=["c3_t1_lens_and_source"])

# %%
"""
__Pipeline Creation__

To create a _Pipeline_, we call a 'make_pipeline' function, which is written in its own Python script: 

 'tutorial_1_pipeline_lens_and_source.py'. 
    
Before we check it out, lets get the pipeline running, by importing the script, running the 'make_pipeline' function
to create the _Pipeline_ object and calling that objects 'run' function.

The 'folders' below specify the path the pipeline results are written to, which is:

 'autolens_workspace/output/howtolens/c3_t1_lens_and_source/pipeline_name/setup_tag/phase_name/settings_tag'
The `Setup` objects are input into a `SetupPipeline` object, which is passed into the pipeline and used to customize
the analysis depending on the setup. This includes tagging the output path of a pipeline. For example, if `with_shear` 
is True, the pipeline`s output paths are `tagged` with the string `with_shear`.

This means you can run the same pipeline on the same data twice (e.g. with and without shear) and the results will go
to different output folders and thus not clash with one another!

The `path_prefix` specifies the path the pipeline results are written to, as it did with phases in the previous 
chapter. The redshift of the lens and source galaxies are also input.
"""

# %%
setup = al.SetupPipeline(
    path_prefix=f"path_prefix",
    redshift_lens=0.5,
    redshift_source=1.0,
    setup_mass=setup_mass,
    setup_source=setup_source,
)

# %%
"""
_Template Pipelines_

The template pipelines can be found in the folder `autolens_workspace/transdimensional/pipelines`, with their 
accompanying runner scripts in `autolens_workspace/transdimensional/runners`. These templates are pretty comprehensive, 
so we do not include any pipelines in this tutorial of **HowToLens**, you should check out the `transdimensional` 
package now!
"""

# %%
示例#27
0
"""
__Pipeline_Setup_And_Tagging__:

For this pipeline the pipeline setup customizes:

 - If there is an external shear in the mass model or not.

The pipeline setup 'tags' the output path of a pipeline. For example, if 'no_shear' is True, the pipeline's output 
paths are 'tagged' with the string 'no_shear'.

This means you can run the same pipeline on the same data twice (with and without shear) and the results will go
to different output folders and thus not clash with one another!
"""

# %%
setup = al.SetupPipeline(no_shear=False, folders=["c3_t2_x2_galaxies"])

# %%
"""
__Pipeline Creation__

To create a _Pipeline_, we call a 'make_pipeline' function, which is written in its own Python script: 

 'tutorial_2_pipeline_x2_lens_galaxies.py'. 

Before we check it out, lets get the pipeline running, by importing the script, running the 'make_pipeline' function
to create the _Pipeline_ object and calling that objects 'run' function.

The 'folders' below specify the path the pipeline results are written to, which is:

 'autolens_workspace/output/howtolens/c3_t2_x2_galaxies/pipeline_name/setup_tag/phase_name/settings_tag'