shock_cooling_curve: A Python-Based Package for Extensive and Efficient Modeling of Shock Cooling Emission in Supernovae

The light-curve evolution of a supernova contains information of the exploding star. Early-time photometry of a variety of explosive transients, including Calcium-rich transients and type IIb/Ibc and IIP supernovae shows evidence for an early light curve peak as a result of the explosion's shock wave passing through extended material (i.e., shock cooling emission (SCE)). Analytic modeling of the shock cooling emission allows us to estimate progenitor properties such as the radius and mass of extended material (e.g., the stellar envelope) as well as the shock velocity. In this work, we present a Python-based modular package that implements four analytic models originally developed in Piro 2015, Piro 2020 and Sapir&Waxman (2017) applied to photometric data to obtain progenitor parameter properties via different modeling techniques (including non-linear optimization, MCMC sampling). Our software is easily extendable to other analytic models for SCE and different methods of parameter estimation.


INTRODUCTION
A shock wave associated with a stellar explosion initiated close to the core of a supernova (SN) progenitor will propagate outwards, heating up optically thick stellar material as it proceeds.When the density of the material in front of the shock decreases, and its optical depth drops below a critical value of τ ∼ c/v sh , where v sh refers to the shock velocity, radiation can leave the region and reach the observer for a time-span of hours -this is referred to as "shock breakout" (Waxman & Katz 2017).This forms the first light curve peak -we typically miss the shock breakout signal due to its short time period.After this, the previously shock heated extended material cools down and the stored energy is released as electromagnetic radiation, which we refer to as "shock cooling emission," (SCE) forming what is typically the first observed peak in an SN light curve (followed by the Nickel-powered peak that characterizes H-stripped SN when there is no other energy source).
Modeling the cooling-envelope emission enables constraints on the different key unknown parameters of a SN's progenitor system.Early-time photometry of Calcium-rich (e.g., De et al. 2018;Jacobson-Galán et al. 2020;Jacobson-Galán et al. 2022) transients, type IIb (e.g., Arcavi et al. 2017;Das et al. 2022), Ibc (e.g., Das et al. 2023), and type IIP (e.g., Hosseinzadeh et al. 2018;Morag et al. 2023) supernovae (SNe) show evidence for a primary light curve peak that results from SCE.We present a open-source software package shock cooling curve actively being developed on GitHub1 , packaged via PyPI.This package derives key progenitor properties (extended material radius/mass, shock velocity and time offset) from the following analytic SCE models: P15 (Piro 2015), P20 (Piro et al. 2021), SW17 (Sapir & Waxman 2017).This tool can assist in efficient modeling and analysis of light curves spanning several SN sub-types, using models incorporating different physical assumptions, thus probing the systematic uncertainties behind each model.

SOFTWARE
shock cooling curve requires photometric data (.csv) and configuration (.ini) files.The tool recognizes data in SDSS and Johnson bandpass filters with a conversion available between AB and Vega magnitude systems.The data file should contain photometric magnitudes, filters, dates, and a binary value specifying magnitude system.The configuration file should contain SN information e.g., SCE timescale, reddening, core mass, kinetic energy, opacity, and distance.
shock cooling curve fits the supplied photometry to a specific SCE model and outputs best-fit key progenitor parameters.The models output a temperature and luminosity assuming blackbody conditions using uniformly sampled parameter inputs.shock cooling curve uses pysynphot (STScI Development Team 2013) to create synthetic photometry by convolving the observing instrument's bandpass with a blackbody spectrum generated by the SCE models.This synthetic photometry is repeatedly generated for a range of SCE parameters and the best-fit parameters minimize the log-likelihood between synthetic and observed photometry.
shock cooling curve has three modeling methods: (1) nl curve fit adopts non-linear least squares modeling (2) minimize adopts minimization techniques for analytical models with discontinuous luminosity functions and (3) MCMC fit applies Markov Chain Monte Carlo (MCMC) sampling (using emcee (Foreman-Mackey et al. 2013), adopting parallelization techniques).The fitting module stores best-fit parameters and uncertainty margins for different fitting methods, MCMC sampler chains and goodness-of-fit estimates.The plotting module plots posterior parameter corner plots, MCMC sampler chains and best-fit light curves (shown in Fig. 1) and parameter-varying light curve movies.

DISCUSSION AND CONCLUSIONS
To demonstrate this tool, we re-model SN 2021gno (Jacobson-Galán et al. 2022;Ertini et al. 2023) and present the results in Figure 1.To test the performance of our software, we model type IIb SN 2016gkg and compare the best-fit parameters to Arcavi et al. (2017).Overall, our fitting results obtained by using the P15 and SW17 models are statistically consistent within 1σ of the results presented in Arcavi et al. (2017).We note our application of the SW17 (n=3) model produces better fits (based on reduced chi-squared metrics), but returns an unphysical shock velocitythis could be due to constraints placed by the analytic formalism.
As shown in Figure 1, the choice of analytic model can yield a variety of best-fit parameters of the extended material.Modeling the SCE using all available models can allow us to obtain constraints on the progenitor properties, and quantitatively assess the assumptions made in each fit.Applying these models to early-time data allows us to effectively rule out or posit that the primary peak in double-peaked observations is a result of SCE.This package's modular nature also allows for inclusion of more recently developed analytical models (e.g., Morag et al. 2023).
We thank Margutti for valuable discussions and comments on the manuscript.

Figure 1 .
Figure 1.Best-fit results with 1-σ errors for SN2021gno obtained from MCMC sampling.The observed photometry is presented in AB magnitude system (Jacobson-Galán et al. 2022).Vertical red dashed line marks end of SCE timescale.Best-fit parameters along with the goodness-of-fit reduced chi-squared (χ 2 ν ) value is provided at the top right.Filters are shown at the bottom of the figure.