PyAutoLens
PyAutoLens copied to clipboard
Create Tracer from result with same API as instance
There are currently two ways we can manipulate a lens model result:
tracer = result.max_log_likelihood_tracer
bulge_image = tracer.planes[0].galaxies[0].bulge.image_2d_from(grid=imaging.grid)
or
samples = result.samples
ml_instance = samples.max_log_likelihood_instance
bulge = ml_instance.galaxies.lens.bulge
bulge_image = bulge.image_2d_from(grid=imaging.grid)
Currently, it is not possible for us to create a Tracer with the API:
tracer = result.max_log_likelihood_tracer
bulge_image = tracer.lens.bulge.image_2d_from(grid=imaging.grid)
It should be possible to extend the Tracer object such that if the input galaxies object is a ModelInstance it has both the above API's as opposed to only the first one. This will make manipulating results more self consistent.