  Historically, metallicity profiles of galaxies have been modelled using a
radially symmetric, two-parameter linear model, which reveals that most
galaxies are more metal-rich in their central regions than their outskirts.
However, this model is known to yield inaccurate results when the point-spread
function (PSF) of a telescope is large. Furthermore, a radially symmetric model
cannot capture asymmetric structures within a galaxy. In this work, we present
an extension of the popular forward-modelling python package LENSTRONOMY, which
allows the user to overcome both of these obstacles. We demonstrate the new
features of this code base through two illustrative examples on simulated data.
First, we show that through forward modelling, LENSTRONOMY is able to recover
accurately the metallicity gradients of galaxies, even when the PSF is
comparable to the size of a galaxy, as long as the data is observed with a
sufficient number of pixels. Additionally, we demonstrate how LENSTRONOMY is
able to fit irregular metallicity profiles to galaxies that are not
well-described by a simple surface brightness profile. This opens up pathways
for detailed investigations into the connections between morphology and
chemical structure for galaxies at cosmological distances using the
transformative capabilities of JWST. Our code is publicly available and open
source, and can also be used to model spatial distributions of other galaxy
properties that are traced by its surface brightness profile.
