def test__mass_tag(self): slam = al.SLaM( pipeline_source_parametric=al.SLaMPipelineSourceParametric(), pipeline_light_parametric=al.SLaMPipelineLightParametric(), pipeline_mass=al.SLaMPipelineMass(), ) assert ( slam.mass_tag == f"mass__" f"light[parametric__bulge_sersic__disk_exp__align_bulge_disk_centre]__" f"mass[total__power_law__with_shear]__" f"source[parametric__bulge_sersic]") pipeline_source_parametric = al.SLaMPipelineSourceParametric( setup_light=al.SetupLightParametric( bulge_prior_model=al.lp.SphericalExponential, disk_prior_model=None, align_bulge_disk_centre=False, ), setup_mass=al.SetupMassTotal( mass_prior_model=al.mp.EllipticalPowerLaw, mass_centre=(0.0, 0.0)), setup_source=al.SetupSourceParametric( bulge_prior_model=al.lp.SphericalDevVaucouleurs), ) pipeline_source_inversion = al.SLaMPipelineSourceInversion( setup_source=al.SetupSourceInversion( pixelization_prior_model=al.pix.VoronoiMagnification, regularization_prior_model=al.reg.AdaptiveBrightness, )) pipeline_light_parametric = al.SLaMPipelineLightParametric( setup_light=al.SetupLightParametric( bulge_prior_model=al.lp.SphericalDevVaucouleurs, disk_prior_model=al.lp.SphericalExponential, align_bulge_disk_centre=False, light_centre=(0.0, 0.0), )) pipeline_mass = al.SLaMPipelineMass(setup_mass=al.SetupMassLightDark( bulge_prior_model=al.lmp.EllipticalSersicRadialGradient)) slam = al.SLaM( pipeline_source_parametric=pipeline_source_parametric, pipeline_source_inversion=pipeline_source_inversion, pipeline_light_parametric=pipeline_light_parametric, pipeline_mass=pipeline_mass, ) assert ( slam.mass_tag == f"mass__" f"light[parametric__bulge_dev_sph__disk_exp_sph__centre_(0.00,0.00)]__" f"mass[light_dark__bulge_sersic_grad__disk_exp__mlr_free__dark_nfw_ludlow__with_shear]__" f"source[inversion__pix_voro_mag__reg_adapt_bright]")
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]" )
def test__source_inversion_tag(self): slam = al.SLaM( pipeline_source_parametric=al.SLaMPipelineSourceParametric(), pipeline_source_inversion=al.SLaMPipelineSourceInversion(), pipeline_mass=al.SLaMPipelineMass(), ) assert (slam.source_inversion_tag == f"source__" f"mass[total__sie__with_shear]__" f"source[inversion__pix_rect__reg_const]") assert slam.source_inversion_tag == slam.source_tag pipeline_source_parametric = al.SLaMPipelineSourceParametric( setup_light=al.SetupLightParametric( bulge_prior_model=al.lp.SphericalExponential, disk_prior_model=None), setup_mass=al.SetupMassTotal( mass_prior_model=al.mp.EllipticalPowerLaw, mass_centre=(0.0, 0.0)), setup_source=al.SetupSourceParametric( bulge_prior_model=al.lp.SphericalDevVaucouleurs), ) pipeline_source_inversion = al.SLaMPipelineSourceInversion( setup_source=al.SetupSourceInversion( pixelization_prior_model=al.pix.VoronoiMagnification, regularization_prior_model=al.reg.AdaptiveBrightness, )) slam = al.SLaM( pipeline_source_parametric=pipeline_source_parametric, pipeline_source_inversion=pipeline_source_inversion, pipeline_light_parametric=al.SLaMPipelineLightParametric(), pipeline_mass=al.SLaMPipelineMass(), ) assert (slam.source_inversion_tag == f"source__" f"light[parametric__bulge_exp_sph]__" f"mass[total__power_law__with_shear__centre_(0.00,0.00)]__" f"source[inversion__pix_voro_mag__reg_adapt_bright]") assert slam.source_inversion_tag == slam.source_tag
def test__source_parametric_tag(self): slam = al.SLaM( pipeline_source_parametric=al.SLaMPipelineSourceParametric(), pipeline_mass=al.SLaMPipelineMass(), ) assert (slam.source_parametric_tag == f"source__" f"mass[total__sie__with_shear]__" f"source[parametric__bulge_sersic]") assert slam.source_parametric_tag == slam.source_tag pipeline_source_parametric = al.SLaMPipelineSourceParametric( setup_light=al.SetupLightParametric( bulge_prior_model=al.lp.SphericalExponential, disk_prior_model=None, align_bulge_disk_centre=False, ), setup_mass=al.SetupMassTotal( mass_prior_model=al.mp.EllipticalPowerLaw, mass_centre=(0.0, 0.0)), setup_source=al.SetupSourceParametric( bulge_prior_model=al.lp.SphericalDevVaucouleurs, align_bulge_disk_centre=False, ), ) slam = al.SLaM( pipeline_source_parametric=pipeline_source_parametric, pipeline_light_parametric=al.SLaMPipelineLightParametric(), pipeline_mass=al.SLaMPipelineMass(), ) assert (slam.source_parametric_tag == f"source__" f"light[parametric__bulge_exp_sph]__" f"mass[total__power_law__with_shear__centre_(0.00,0.00)]__" f"source[parametric__bulge_dev_sph]") assert slam.source_parametric_tag == slam.source_tag
The parametric source pipeline aims to initialize a robust model for the source galaxy using `LightProfile` objects. _SLaMPipelineSourceParametric_ determines the source model used by the parametric source pipeline. A full description of all options can be found ? and ?. By default, this assumes an `EllipticalIsothermal` profile for the lens `Galaxy`'s mass and an `EllipticalSersic` + `EllipticalExponential` model for the lens `Galaxy`'s light. Our experience with lens modeling has shown they are the simplest models that provide a good fit to the majority of strong lenses. For this runner the `SLaMPipelineSourceParametric` customizes: - The `MassProfile` fitted by the pipeline (and the following `SLaMPipelineSourceInversion`.. - If there is an `ExternalShear` in the mass model or not. """ setup_light = al.SetupLightParametric() setup_mass = al.SetupMassTotal( mass_prior_model=al.mp.EllipticalIsothermal, with_shear=True ) setup_source = al.SetupSourceParametric() pipeline_source_parametric = al.SLaMPipelineSourceParametric( setup_light=setup_light, setup_mass=setup_mass, setup_source=setup_source ) """ __SLaMPipelineSourceInversion__ The Source inversion pipeline aims to initialize a robust model for the source galaxy using an `Inversion`. _SLaMPipelineSourceInversion_ determines the `Inversion` used by the inversion source pipeline. A full description of all
The parametric source pipeline aims to initialize a robust model for the source galaxy using `LightProfile` objects. _SLaMPipelineSourceParametric_ determines the source model used by the parametric source pipeline. A full description of all options can be found ? and ?. By default, this assumes an `EllipticalIsothermal` profile for the lens `Galaxy`'s mass and an `EllipticalSersic` + `EllipticalExponential` model for the lens `Galaxy`'s light. Our experience with lens modeling has shown they are the simplest models that provide a good fit to the majority of strong lenses. For this runner the `SLaMPipelineSourceParametric` customizes: - The `MassProfile` fitted by the pipeline (and the following `SLaMPipelineSourceInversion`.. - If there is an `ExternalShear` in the mass model or not. """ setup_light = al.SetupLightParametric(light_centre_gaussian_prior_values=(0.0, 0.1)) setup_mass = al.SetupMassTotal(mass_prior_model=al.mp.EllipticalIsothermal, with_shear=True) setup_source = al.SetupSourceParametric( bulge_prior_model=al.lp.EllipticalSersic, disk_prior_model=None, envelope_prior_model=None, ) pipeline_source_parametric = al.SLaMPipelineSourceParametric( setup_light=setup_light, setup_mass=setup_mass, setup_source=setup_source) """ __SLaMPipelineSourceInversion__ The Source inversion pipeline aims to initialize a robust model for the source galaxy using an `Inversion`.
The parametric source pipeline aims to initialize a robust model for the source galaxy using `LightProfile` objects. _SLaMPipelineSourceParametric_ determines the source model used by the parametric source pipeline. A full description of all options can be found ? and ?. By default, this assumes an `EllipticalIsothermal` profile for the lens `Galaxy`'s mass and an `EllipticalSersic` + `EllipticalExponential` model for the lens `Galaxy`'s light. Our experience with lens modeling has shown they are the simplest models that provide a good fit to the majority of strong lenses. For this runner the `SLaMPipelineSourceParametric` customizes: - The `MassProfile` fitted by the pipeline (and the following `SLaMPipelineSourceInversion`.. - If there is an `ExternalShear` in the mass model or not. """ setup_light = al.SetupLightParametric() setup_mass = al.SetupMassTotal(mass_prior_model=al.mp.EllipticalIsothermal, with_shear=True) setup_source = al.SetupSourceParametric( bulge_prior_model=al.lp.EllipticalSersic, disk_prior_model=None, envelope_prior_model=None, ) pipeline_source_parametric = al.SLaMPipelineSourceParametric( setup_light=setup_light, setup_mass=setup_mass, setup_source=setup_source) """ __SLaMPipelineLight__ The `SLaMPipelineLightParametric` pipeline fits the model for the lens `Galaxy`'s bulge + disk light model.
The parametric source pipeline aims to initialize a robust model for the source galaxy using `LightProfile` objects. _SLaMPipelineSourceParametric_ determines the source model used by the parametric source pipeline. A full description of all options can be found ? and ?. By default, this assumes an `EllipticalIsothermal` profile for the lens `Galaxy`'s mass and an `EllipticalSersic` + `EllipticalExponential` model for the lens `Galaxy`'s light. Our experience with lens modeling has shown they are the simplest models that provide a good fit to the majority of strong lenses. For this runner the `SLaMPipelineSourceParametric` customizes: - The `MassProfile` fitted by the pipeline (and the following `SLaMPipelineSourceInversion`.. - If there is an `ExternalShear` in the mass model or not. """ setup_light = al.SetupLightParametric(light_centre=(0.0, 0.0)) setup_mass = al.SetupMassTotal(mass_prior_model=al.mp.EllipticalIsothermal, with_shear=True, mass_centre=(0.0, 0.0)) setup_source = al.SetupSourceParametric() pipeline_source_parametric = al.SLaMPipelineSourceParametric( setup_light=setup_light, setup_mass=setup_mass, setup_source=setup_source) """ __SLaMPipelineLight__ The `SLaMPipelineLightParametric` pipeline fits the model for the lens `Galaxy`'s bulge + disk light model. A full description of all options can be found ? and ?. The model used to represent the lens `Galaxy`'s light is input into `SLaMPipelineLightParametric` below and this runner uses an