def pass_priors(self, previous_results): # To change priors, we use the 'prior' module of PyAutoFit. These priors link our GalaxyModel to the # non-linear search. Thus, it tells PyAutoLens where to search non-linear parameter space. # These two lines change the centre of the lens galaxy's mass-profile to UniformPriors around the coordinates # (-0.1", 0.1"). For real lens modeling, this might be done by visually inspecting the centre of emission of # the lens galaxy's light. # The term 'lens_galaxy' refers to the name of the galaxy that we give it below (scroll down cell [5]. # By naming galaxies in this way, we can easily keep track of how to pass their priors). # The word 'mass' corresponds to the word we used when setting up the GalaxyModel above. self.lens_galaxies.lens_galaxy.mass.centre_0 = prior.UniformPrior( lower_limit=-0.1, upper_limit=0.1) self.lens_galaxies.lens_galaxy.mass.centre_1 = prior.UniformPrior( lower_limit=-0.1, upper_limit=0.1) # Lets also change the prior on the lens galaxy's einstein radius, to a GaussianPrior centred on 1.4". # For real lens modeling, this might be done by visually estimating the radius the lens's arcs / ring appear. self.lens_galaxies.lens_galaxy.mass.einstein_radius = prior.GaussianPrior( mean=1.4, sigma=0.2) # We can also customize the source galaxy - lets say we believe it is compact and limit its effective radius self.source_galaxies.source_galaxy.light.effective_radius = prior.UniformPrior( lower_limit=0.0, upper_limit=0.3)
def pass_priors(self, previous_results): self.lens_galaxies.lens = previous_results[1].constant.lens self.source_galaxies.source.pixelization.shape_0 = prior.UniformPrior( lower_limit=20.0, upper_limit=45.0) self.source_galaxies.source.pixelization.shape_1 = prior.UniformPrior( lower_limit=20.0, upper_limit=45.0)
def pass_priors(self, previous_results): self.lens_galaxies.lens.sersic.centre_0 = 0.0 self.lens_galaxies.lens.sersic.centre_1 = 0.0 self.lens_galaxies.lens.sersic.axis_ratio = prior.UniformPrior( lower_limit=-0.5, upper_limit=0.1) self.lens_galaxies.lens.sersic.phi = 90.0 self.lens_galaxies.lens.sersic.intensity = prior.UniformPrior( lower_limit=-0.5, upper_limit=0.1) self.lens_galaxies.lens.sersic.effective_radius = 1.3 self.lens_galaxies.lens.sersic.sersic_index = 3.0
def pass_priors(self, previous_results): # We've called our lens galaxy 'lens' this time, for shorter more readable code. # By default, the prior on the (y,x) coordinates of a light / mass profile is a GaussianPrior with mean # 0.0" and sigma "1.0. However, visual inspection of our strong lens image tells us that its clearly around # x = 0.0" and y = 0.0", so lets reduce where non-linear search looks for these parameters. self.lens_galaxies.lens.light.centre_0 = prior.UniformPrior( lower_limit=-0.05, upper_limit=0.05) self.lens_galaxies.lens.light.centre_1 = prior.UniformPrior( lower_limit=-0.05, upper_limit=0.05) self.lens_galaxies.lens.mass.centre_0 = prior.UniformPrior( lower_limit=-0.05, upper_limit=0.05) self.lens_galaxies.lens.mass.centre_1 = prior.UniformPrior( lower_limit=-0.05, upper_limit=0.05) # By default, the axis-ratio (ellipticity) of our lens galaxy's light profile is a UniformPrior between 0.2 and # 1.0. However, by looking at the image it looks fairly circular, so lets use a GaussianPrior nearer 1.0. self.lens_galaxies.lens.light.axis_ratio = prior.GaussianPrior( mean=0.8, sigma=0.15) # We'll also assume that the light profile's axis_ratio informs us of the mass-profile's axis_ratio, but # because this may not strictly be true (e.g. because of dark matter) we'll use a wider prior. self.lens_galaxies.lens.mass.axis_ratio = prior.GaussianPrior( mean=0.8, sigma=0.25) # By default, the orientation of the galaxy's light profile, phi, uses a UniformPrior between 0.0 and # 180.0 degrees. However, if you look really close at the image (and maybe adjust the color-map of the plot), # you'll be able to notice that it is elliptical and that it is oriented around 45.0 degrees counter-clockwise # from the x-axis. Lets update our prior self.lens_galaxies.lens.light.phi = prior.GaussianPrior(mean=45.0, sigma=15.0) # Again, lets kind of assume that the light's orientation roughly traces that of mass. self.lens_galaxies.lens.mass.phi = prior.GaussianPrior(mean=45.0, sigma=30.0) # The effective radius of a light profile is its 'half-light' radius, the radius at which 50% of its # total luminosity is internal to a circle defined within that radius. PyAutoLens assumes a # UniformPrior on this quantity between 0.0" and 4.0", but inspection of the image (again, using a colormap # scaling) shows the lens's light doesn't extend anywhere near 4.0", so lets reduce it. self.lens_galaxies.lens.light.effective_radius = prior.GaussianPrior( mean=0.5, sigma=0.8) # Typically, we have some knowledge of what morphology our lens galaxy is. Infact, most strong lenses are # massive elliptical galaxies, and anyone who studies galaxy morphology will tell you these galaxies have a # Sersic index near 4. So lets change our Sersic index from a UniformPrior between 0.8 and 8.0 to reflect this. self.lens_galaxies.lens.light.sersic_index = prior.GaussianPrior( mean=4.0, sigma=1.0) # Finally, the 'ring' that the lensed source forms clearly has a radius of about 0.8". This is its Einstein # radius, so lets change the prior from a UniformPrior between 0.0" and 4.0". self.lens_galaxies.lens.mass.einstein_radius = prior.GaussianPrior( mean=0.8, sigma=0.2)
def pass_priors(self, previous_results): self.lens_galaxies.lens.light.centre_0 = 0.0 self.lens_galaxies.lens.light.centre_1 = 0.0 self.lens_galaxies.lens.light.axis_ratio = previous_results[ 0].constant.lens.light.axis_ratio self.lens_galaxies.lens.light.phi = previous_results[ 0].constant.lens.light.phi self.lens_galaxies.lens.light.intensity = previous_results[ 0].constant.lens.light.intensity self.lens_galaxies.lens.light.effective_radius = prior.UniformPrior( lower_limit=0.0, upper_limit=4.0) self.lens_galaxies.lens.light.sersic_index = prior.UniformPrior( lower_limit=1.0, upper_limit=8.0)
def pass_priors(self, previous_results): self.lens_galaxies.lens.mass.centre_0 = 0.0 self.lens_galaxies.lens.mass.centre_1 = 0.0 self.lens_galaxies.lens.mass.einstein_radius = 1.6 self.source_galaxies.source.light.centre_0 = 0.0 self.source_galaxies.source.light.centre_1 = 0.0 self.source_galaxies.source.light.intensity = 1.0 self.source_galaxies.source.light.effective_radius = 0.5 self.source_galaxies.source.light.sersic_index = 1.0 self.sensitive_galaxies.subhalo.mass.centre_0 = prior.UniformPrior( lower_limit=-2.0, upper_limit=2.0) self.sensitive_galaxies.subhalo.mass.centre_1 = prior.UniformPrior( lower_limit=-2.0, upper_limit=2.0) self.sensitive_galaxies.subhalo.mass.kappa_s = 0.1 self.sensitive_galaxies.subhalo.mass.scale_radius = 5.0
def pass_priors(self, previous_results): self.lens_galaxies.lens.light.centre_0 = prior.UniformPrior( lower_limit=-0.01, upper_limit=0.01) self.lens_galaxies.lens.light.centre_1 = prior.UniformPrior( lower_limit=-0.01, upper_limit=0.01) self.lens_galaxies.lens.light.axis_ratio = prior.UniformPrior( lower_limit=0.79, upper_limit=0.81) self.lens_galaxies.lens.light.phi = prior.UniformPrior( lower_limit=-1.0, upper_limit=1.0) self.lens_galaxies.lens.light.intensity = prior.UniformPrior( lower_limit=0.99, upper_limit=1.01) self.lens_galaxies.lens.light.effective_radius = prior.UniformPrior( lower_limit=1.25, upper_limit=1.35) self.lens_galaxies.lens.light.sersic_index = prior.UniformPrior( lower_limit=3.95, upper_limit=4.05)
def pass_priors(self, previous_results): self.lens_galaxies.lens.disk = previous_results[ 0].constant.lens.disk self.lens_galaxies.lens.bulge.centre_0 = prior.UniformPrior( lower_limit=-0.01, upper_limit=0.01) self.lens_galaxies.lens.bulge.centre_1 = prior.UniformPrior( lower_limit=-0.01, upper_limit=0.01) self.lens_galaxies.lens.bulge.axis_ratio = prior.UniformPrior( lower_limit=0.79, upper_limit=0.81) self.lens_galaxies.lens.bulge.phi = prior.UniformPrior( lower_limit=-1.0, upper_limit=1.0) self.lens_galaxies.lens.bulge.intensity = prior.UniformPrior( lower_limit=0.99, upper_limit=1.01) self.lens_galaxies.lens.bulge.effective_radius = prior.UniformPrior( lower_limit=1.25, upper_limit=1.35)