Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
hyper_galaxy=hyper_galaxy,
)
else:
if source_as_model:
return ag.GalaxyModel(
redshift=af.last.instance.galaxies.source.redshift,
pixelization=af.last.hyper_combined.instance.galaxies.source.pixelization,
regularization=af.last.hyper_combined.model.galaxies.source.regularization,
)
else:
return ag.GalaxyModel(
redshift=af.last.instance.galaxies.source.redshift,
pixelization=af.last[
index
].hyper_combined.instance.galaxies.source.pixelization,
regularization=af.last[
index
].hyper_combined.instance.galaxies.source.regularization,
hyper_galaxy=hyper_galaxy,
)
1) The lens light model uses the light model of the Light pipeline.
2) The lens light is returned as a model if *fix_lens_light* is *False, an instance if *True*.
Parameters
----------
redshift_lens : float
The redshift of the lens galaxy.
mass : ag.MassProfile
The mass model of the len galaxy.
shear : ag.ExternalShear
The external shear of the lens galaxy.
"""
if self.mass.fix_lens_light:
return ag.GalaxyModel(
redshift=redshift_lens,
bulge=af.last.instance.galaxies.lens.bulge,
disk=af.last.instance.galaxies.lens.disk,
mass=mass,
shear=shear,
hyper_galaxy=af.last.hyper_combined.instance.optional.galaxies.lens.hyper_galaxy,
)
else:
return ag.GalaxyModel(
redshift=redshift_lens,
bulge=af.last.model.galaxies.lens.bulge,
disk=af.last.model.galaxies.lens.disk,
mass=mass,
shear=shear,
hyper_galaxy.contribution_factor = (
af.last.hyper_combined.instance.optional.galaxies.source.hyper_galaxy.contribution_factor
)
hyper_galaxy.noise_power = (
af.last.hyper_combined.instance.optional.galaxies.source.hyper_galaxy.noise_power
)
else:
hyper_galaxy = None
if self.source.type_tag in "sersic":
if source_as_model:
return ag.GalaxyModel(
redshift=af.last[index].model.galaxies.source.redshift,
sersic=af.last[index].model.galaxies.source.sersic,
hyper_galaxy=hyper_galaxy,
)
else:
return ag.GalaxyModel(
redshift=af.last[index].instance.galaxies.source.redshift,
sersic=af.last[index].instance.galaxies.source.sersic,
hyper_galaxy=hyper_galaxy,
)
else:
if source_as_model:
hyper_galaxy=hyper_galaxy,
)
else:
return ag.GalaxyModel(
redshift=af.last[index].instance.galaxies.source.redshift,
sersic=af.last[index].instance.galaxies.source.sersic,
hyper_galaxy=hyper_galaxy,
)
else:
if source_as_model:
return ag.GalaxyModel(
redshift=af.last.instance.galaxies.source.redshift,
pixelization=af.last.hyper_combined.instance.galaxies.source.pixelization,
regularization=af.last.hyper_combined.model.galaxies.source.regularization,
)
else:
return ag.GalaxyModel(
redshift=af.last.instance.galaxies.source.redshift,
pixelization=af.last[
index
].hyper_combined.instance.galaxies.source.pixelization,
regularization=af.last[
index
].hyper_combined.instance.galaxies.source.regularization,
hyper_galaxy=hyper_galaxy,
hyper_galaxy = None
if self.source.type_tag in "sersic":
if source_as_model:
return ag.GalaxyModel(
redshift=af.last[index].model.galaxies.source.redshift,
sersic=af.last[index].model.galaxies.source.sersic,
hyper_galaxy=hyper_galaxy,
)
else:
return ag.GalaxyModel(
redshift=af.last[index].instance.galaxies.source.redshift,
sersic=af.last[index].instance.galaxies.source.sersic,
hyper_galaxy=hyper_galaxy,
)
else:
if source_as_model:
return ag.GalaxyModel(
redshift=af.last.instance.galaxies.source.redshift,
pixelization=af.last.hyper_combined.instance.galaxies.source.pixelization,
regularization=af.last.hyper_combined.model.galaxies.source.regularization,
)
else: