GSoC 2024: Final Report
GSoC 2024: Final Report
LIV (Last Interaction Velocity) Plot
(originally Velocity Packet Tracker Visualisation)
This page showcases a report on the Google Summer of Code project undertaken by Sarthak Srivastava with the guidance of James Gillanders, Jaladh Singhal, Abhinav Ohri, Mark Magee, Christian Vogl, and Harshul Gupta within the TARDIS-RT collaboration.
TARDIS is an open-source Monte Carlo radiative-transfer code used for spectral synthesis in 1D models of supernova ejecta. It enables quick and efficient spectral modeling of supernovae.
The core package of the TARDIS Project is Tardis. To explore the full project, discover additional packages, and connect with the community, visit the project website.
The TARDIS SDEC plot visualizes which atoms photon packets interact with before they escape the ejecta and contribute to the output spectrum's absorption and emission features. However, the SDEC plot does not visualize where these interactions occur within the ejecta. This information can be beneficial to astronomers who want to understand which regions of the ejecta are responsible for important features in the output spectrum. This project develops the LIV (Last Interaction Velocity) Plot that plots the number of photon packet interactions as a velocity function for each element present in the ejecta. One such example is shown in the interactive plot below.
Note: The Interactive version is best viewed on desktop.
The Last Interaction Velocity Plot tracks and displays the velocities at which different elements (or species) last interacted with packets in the simulation. For documentation visit this page.
We can create a highly informative and visually appealing Last Interaction Velocity plot using Matplotlib, If you're using the Last Interaction Velocity plot for exploration, consider creating an interactive version with Plotly. This allows you to zoom, pan, and inspect data values by hovering, resizing the scale, and more conveniently.
The plots have various options providing the users with more control over how your last interaction velocity looks:
species_list: List of species to plot.
nelements: Number of elements to include in the plot. The most interacting elements are included.
packets_mode: Packet mode, either 'virtual' or 'real'.
packet_wvl_range: Wavelength range to restrict the analysis of escaped packets. It should be a quantity having units of Angstrom, containing two values - lower lambda and upper lambda i.e.[lower_lambda, upper_lambda] * u.AA
ax: To plot on an Axis of a plot you're already working with, e.g. for subplots. (matplotlib only)
figsize: To resize the plot as per your requirements. (matplotlib only)
fig: To plot the last interaction velocity plot on a figure you are already using e.g. for subplots. (plotly only)
graph_height: To specify the height of the graph as needed. (plotly only)
cmapname: Colormap name.
xlog_scale: If True, the x-axis is scaled logarithmically.
ylog_scale: If True, the y-axis is scaled logarithmically.
num_bins: Number of bins for regrouping within the same range.
velocity_range: Limits for the x-axis. If specified, overrides any automatically determined limits.
Here are the PRs for this tool:
tardis #2677: Contains main code for the LIV Plot, a how-to plot jupyter notebook, and documentation update.
tardis #2784: Contains code for the addition of the packet_wvl_range filter.
tardis #2723: Contains tests for the LIV Plot.
tardis-regression-data #16: Contains regression data for testing of LIV Plot.
tardis-regression-data #19: Contains image data for testing Matplotlib LIV Plots.
tardis #2528: Correction of convergence plots, changed from line plot to step-plot.
tardis #2533: Fixed broken URL in generating_widgets.ipynb
tardis #2541: Fixed the units in properties for virtual packets in MonteCarloTransportState.
tardis #2684: Fixed hdf path in SDEC Plot.
In the future, I plan to contribute to TARDIS by focusing on the following tasks:
Replacing the deprecated qgrid library with a suitable alternative
Updating the LIV Plot to display a data table that allows users to select species for plotting.
Work on other open issues that interest me.
During my journey with Google Summer of Code 2024, the official coding period may have been from May to August, but the unwavering support from the TARDIS community began long before that. From the moment I started contributing, the TARDIS admins and members were there to encourage and guide me every step of the way. I’m incredibly grateful to my mentors—James, Jaladh, Abhinav, Mark, Christian, and Harshul—who generously shared their knowledge of astrophysics, software development, and the open-source world. I also want to extend my heartfelt thanks to Atharva and our organization's PI, Wolfgang, whose support was invaluable.
This project offered me a profound insight into open-source development, where individuals from different fields collaborate towards a shared vision. The chance to dive into complex challenges while learning and sharing those insights with the community is something I will carry with me into my professional career.
I would also like to express my deepest gratitude to Google Summer of Code for this amazing opportunity. It has been an unforgettable experience that will stay with me for years to come.