Introducing a Real-time Interactive GUI Tool for Visualization of Galaxy Spectra

To aid the understanding of the non-linear relationship between galaxy properties and predicted spectral energy distributions (SED), we present a new interactive graphical user interface (GUI) tool pipes_vis based on Bagpipes \citep{arXiv:1712.04452,arXiv:1903.11082}. It allows for real-time manipulation of a model galaxy's star formation history, dust and other relevant properties through sliders and text boxes, with each change's effect on the predicted SED reflected instantaneously. We hope the tool will assist in building intuition about what affects the SED of galaxies, potentially helping to speed up fitting stages such as prior construction, and aid in undergraduate and graduate teaching. pipes_vis is available online (pipes_vis is maintained and documented online at https://github.com/HinLeung622/pipes_vis, or version 0.4.1 is archived in Zenodo and also available for installation through pip install pipes_vis).


INTRODUCTION
The study of galaxy evolution, aimed at understanding the processes that drive changes in galaxies, often requires the recovery of galaxy properties such as the total stellar mass, star-formation history (SFH), chemical evolution and dust properties, that are not directly measurable from the observed spectral energy distributions (SEDs). This is often done in a fitting process that relies on stellar population synthesis (SPS) models, which predict a galaxy's stellar-contributed SED when given its underlying properties and assumed initial mass function, isochrone tables, spectral libraries, etc. Non-stellar components, such as nebular and dust emission are also included via energy balance or ionisation balance constraints (for a comprehensive review, see Conroy 2013). This fitting process is complex and highly multi-dimensional, and can result in complex degeneracies between parameters (Ocvirk et al. 2006;Pacifici et al. 2015;Carnall et al. 2019a;Leja et al. 2019). In fitting contexts, the likelihood is also typically multi-modal (multi-peaked, each with similar likelihood levels), leading to multi-modal posteriors in Bayesian methods of fitting. Hence, a tool that quickly visualizes the effects on the predicted SED from changing each individual galaxy property will supply intuition for this non-linear transformation, possibly allowing for more efficient prior construction during fitting, and limit the amount of trial-and-error required before producing robust results.
Sengi (Lovell 2021) is an example of a similar visualizer, which works as a web-based online tool displaying changes in the SED in real-time. Sengi focuses on providing modelled SEDs from multiple SPS codes (FSPS (Conroy et al. 2009), BC03 (Bruzual & Charlot 2003), etc.), but is only able to model the stellar continuum SEDs of simple stellar populations (SSPs, coeval stellar populations with the same age, metallicity and chemical composition). Approaching from the fitting point of view with our tool, we aim to provide SED predictions from complex SFHs forms, while accounting for non-stellar elements including dust attenuation, emission and nebular line emission that are all crucially  (Wild et al. 2020), which consists of the 8 parameters on the left column, along with a CF00 (Charlot & Fall 2000) dust law. The slider symbols have their usual meanings, while η dust means the multiplicative factor on AV for stars in birth clouds, nCF 00 the power-law slope of CF00 dust attenuation and t bc the maximum age of stellar birth clouds. If a SFH function with more parameters and/or multiple SFH components were to be used, the left column would rearrange into multiple columns to accommodate this, and use different slider colours to differentiate between SFH components.
important for fitting, and allow for real-time adjustment for all parameters in these models. However, we rely on stellar continuum predictions from one SPS code alone (BC03), and the range of dust emission and nebular emission options are arguably limited compared to the true diversity of the galaxy population. Figure 1 shows an example of the main GUI interface when using pipes vis, which is maintained and documented online 1 , or version 0.4.1 2 is archived in Zenodo (Leung 2021). The top panel plots the SFH, from the beginning of the Universe to z = 0. The vertical red line shows the time and redshift of observation, which moves horizontally with the redshift slider controlled by the user. Only light from stellar populations formed rightwards of the line contributes to the predicted SED. The central panel shows the predicted SED at the wavelength limits controlled by the bottom right text boxes, also indicated with the shaded region within the full SED subplot. The bottom panel shows the fraction flux/continuum, aimed to highlight absorption and emission lines. The continuum is calculated via a rolling median, with a width of 150Å.
Written in Python, the visualizer is in practice a wrapper of the Python fully-Bayesian SED fitting code Bagpipes (Carnall et al. 2018(Carnall et al. , 2019b, relying on Bagpipes to re-calculate predicted SEDs mapped onto a defined wavelength array upon each change in the sliders. The main functionalities are as follows: • The GUI mentioned above.
• Returning the GUI plots as a static image without sliders, for users who might want it for fixed display or further manipulation.
• Plotting all predicted SEDs when sweeping across a defined range of a single parameter. This displays the changes each parameter can bring about, while keeping every other parameters fixed.
Since it is built on top of Bagpipes, pipes vis is designed to have similar model creation conventions as the underlying code. However, an important caveat regards parameters that refer to particular points in time: due to the timeinvariant nature of the inputted SFH, pipes vis requires inputs to be in age of the Universe (Gyr), instead of the more commonly used lookback time (Gyr). This change does not affect temporal parameters that refer to durations (e.g. decay timescale of the exponential function). Like Bagpipes, pipes vis supports the stacking of multiple SFH components of both different and the same functional forms, by generating individual sets of sliders for each component used. In line with Bagpipes, pipes vis assumes a ΛCDM cosmology with Ω M = 0.3, Ω Λ = 0.7 and h = 0.7.
Currently, pipes vis only predicts spectroscopic SEDs, but it would be possible to add predictions for photometric bands with user-specified filter curves, and Lick indices, in a similar setup in the future should there be interest from the community.