HAFFET: Hybrid Analytic Flux FittEr for Transients

The progenitors for many types of supernovae (SNe) are still unknown, and an approach to diagnose their physical origins is to investigate the light-curve brightness and shape of a large set of SNe. However, it is often difficult to compare and contrast the existing sample studies due to differences in their approaches and assumptions, for example, in how to eliminate host galaxy extinction, and this might lead to systematic errors when comparing the results. We therefore introduce the Hybrid Analytic Flux FittEr for Transients (HAFFET), a Python-based software package that can be applied to download photometric and spectroscopic data for transients from open online sources, derive bolometric light curves, and fit them to semianalytical models for estimation of their physical parameters. In a companion study, we have investigated a large collection of SNe Ib and Ic observed with the Zwicky Transient Facility (ZTF) with HAFFET, and here we detail the methodology and the software package to encourage more users. As large-scale surveys such as ZTF and LSST continue to discover increasing numbers of transients, tools such as HAFFET will be critical for enabling rapid comparison of models against data in statistically consistent, comparable, and reproducible ways. Additionally, HAFFET is created with a graphical user interface mode, which we hope will boost the efficiency and make the usage much easier (https://github.com/saberyoung/HAFFET).


Introduction
Transients are celestial objects whose brightness varies on timescales from seconds to years, for example due to explosions of their progenitors.These objects help astronomers to investigate physics under extreme conditions, and there are currently a large number of surveys being carried out to search for extra-galactic transients by regularly monitoring the night sky.Detected objects include classical transients, such as supernovae (SNe) that are luminous optical transients from either a thermonuclear explosion of a white dwarf, or the core-collapse (CC) of a massive star, as well as new and exotic transients.e.g. the kilonova AT2017gfo (Abbott et al. 2017;Coulter et al. 2017;Valenti et al. 2017;Tanvir et al. 2017;Lipunov et al. 2017;Soares-Santos et al. 2017;Arcavi et al. 2017;Pian et al. 2017;Smartt et al. 2017).To correctly classify them, spectroscopy is required, however spectroscopic follow-up resources are scarce, and only a fraction of the currently discovered SNe can be classified in this way (Kulkarni et al. 2018).
sheng.yang@hnas.ac.cnInvestigating the multi-band light curves (LCs) of the transients can also provide information about the mechanism that drives the explosions, such as shock cooling, circumstellar matter (CSM) interaction, radioactive decay or a central engine such as a magnetar.The information is encoded in the LCs in different aspects, e.g.their timescales, shapes and absolute luminosities, both for individual objects and for curated samples of specific types.Much progress has been made by linking multi-wavelength light curves to models, both numerical hydrodynamical models and simpler semianalytical estimates.For instance, for both SNe Ia and stripped envelope CC SNe, whose emission during the photospheric phase is normally powered by the radioactive decay of synthesized 56 Ni, Arnett (1982) made a semi-analytic model that can reconstruct the bolometric LCs for physical parameters of the explosion and the progenitors, such as the amount of ejected nickel mass, the ejecta mass and the kinetic energy.Therefore, exploring a large sample of SNe provides the opportunity to unveil their underlying physical origins.Such analysis has been performed in a number of studies, e.g.Barbarino et al. (2021); Taddia et al. (2018); Prentice et al. (2019); Lyman et al. (2016), but the different studies often use different approaches and codes which makes the direct comparisons less straightforward.A generic code-package to handle light curve fitting for transients of different types, from different surveys, observed with varying cadences, is therefore useful to provide comparable results.For this purpose, we present HAFFET, a data-driven model fitter for transients.Often some spectroscopic information is also available for the SNe and needed to perform parts of the analysis, and HAFFET also includes procedures for example for measuring ejecta velocities from spectra.
This paper aims to serve as a description of HAFFET and its capabilities at the time of its first release.This is complemented with a web-based users guide, which the reader should always consult for more up-to-date information 1 .This online documentation also contains more technical information and the code itself, whereas this paper aims to describe some of the possibilities in the code-package.Furthermore, as a scientific proof-of-concept of HAFFET, we are in a companion paper exploring a large sample of Type Ib and Ic SNe, observed by the Zwicky Transient Facility (ZTF; Bellm et al. 2019;Graham et al. 2019), and spectroscopically classified as part of the Bright Transient Survey (BTS) (Fremling et al. 2020;Perley et al. 2020).That paper (Yang et al. in preparation) contains the analysis of the objects that are used here to demonstrate the capabilities of HAFFET, and is hereafter referred to as Paper I. We have also estimated the luminosities for ZTF SNe Ic-BL using HAFFET in Corsi et al. (2023), Srinivasaragavan et al. (2023) and in Anand et al. (2023).
This paper is organized as follows.In Section 2 we present the code design of HAFFET.In Section 3, we describe how HAFFET handle meta and observational data, and in Section 4 we discuss in detail the different available models designed for different types of observational data.The fitting process and outputs by which users can share their results are outlined in Section 5.In Section 6 we further explore the sample of ZTF SNe Ib and Ic with HAFFET, complementary to Paper I. Finally, Section 7 presents our conclusions and provides a short discussion where we put our results in context.

HAFFET
In this section, we present the code's design, workflow, and diverse operating modes within the framework of HAFFET.
To begin, the code design of HAFFET is meticulously crafted to offer flexibility and scalability, catering to various types of transient data and analytical necessities.It employs a modular structure, empowering users to selectively engage desired functionalities based on real-world scenarios.
HAFFET offers three distinct methods of invocation: it can be employed as a Python package, executed as a standalone file, or accessed through a user-friendly Graphical User Interface (GUI).These approaches are functionally equivalent, all triggering the same core processes, and the outcomes they generate are also mutually interchangeable.The assortment of distinct operating modes is tailored to accommodate diverse analytical objectives.For instance, one mode may be tailored for light curve fitting and parameter estimation, while another could specialize in spectrum data processing and analysis.Users are empowered to select the most appropriate operating mode aligned with their specific analytical needs.
Moving on to the workflow, HAFFET encompasses several key stages.Users initiate the process by providing observational data of the transient, encompassing light curves, spectra, and other pertinent information.Subsequently, users have the option to choose from a range of suitable operating modes for data analysis.The chosen operating mode guides HAFFET to execute relevant data processing and fitting algorithms.Finally, users are able to access comprehensive analytical outcomes, including derived physical parameters and fitted light curve results.
For better clarity, in Figure 1, we illustrate the main steps as they were generally performed using HAFFET for stripped envelope SNe in Paper I: 1. HAFFET initiates a Python class named snelist, incorporating a meta table2 , which encompasses a list of objects.Within this meta table, every object's meta information, such as coordinates and redshifts, is standardized, establishing the groundwork for the creation of a subsequent class known as snobject.The purpose of the snobject class is to manage individual objects.
2. Within the context of snobject, several built-in functions are available to parse both photometric and spectroscopic data, whether they originate from local or remote sources.Depending on the specific objective, users have the flexibility to optionally assign observational data to the object.
3. Observational data is often discrete, influenced by objective factors such as observing conditions and instrument maintenance.As an option, HAFFET provides functions that can convert scattered data into a continuous format, thereby aiding in the estimation of specific characteristics, such as the peak magnitude of a lightcurve.
4. Certain photometric features necessitate simultaneous data from multiple distinct wavebands to be ac-quired.To address this, HAFFET incorporates functions (via either binning or interpolations) that enables the alignment of observational data from different wavebands.As an example, color estimation can be achieved through a comparison between two bands, subsequently convertible into luminosities using a bolometric correction function.Additionally, matching more than two bands enables the estimation of Spectral Energy Distribution (SED) and corresponding luminosities.
5. All photometric features, whether derived directly or indirectly, can undergo fitting procedures and subsequent parameter analysis using a range of analytical models.
6.For spectral data, the processing is similar to photometric data, yet comparatively simpler, given their typically one-dimensional nature.Each spectrum is binned, smoothed, and normalized.The continuum can be used to estimate the SED.Simultaneously, the automatic identification of emission and absorption lines takes place, followed by fitting with diverse models to measure spectral attributes, particularly identifying the troughs of absorption features to estimate ejecta velocities.
7. All the photometric and spectral properties from the snobject class can be accessed through snelist, and subsequently distributed into parameter space for the purpose of sample exploration.Furthermore, fitting procedures can also be executed within this context.
In essence, HAFFET serves as a versatile tool for transient data analysis, engineered to aid researchers in processing and comprehensively analyzing an array of transient data types.Its modular design and assortment of operating modes render it adaptable to a wide spectrum of research inquiries and analytical requirements.We would like to mention that the functions and their usages of snobject and snelist can be found in the online documentation3 .In this paper, we give a theoretical overview of HAFFET, and users should consult the corresponding functions for each section on the documentation page for more information and application examples.

Data Input
As discussed in Sec. 2, two different kinds of data, i.e. meta and observational data, might be employed in the fitting procedure.These data typically originate from various sources, leading to significant differences in their formats.In the meanwhile, users may work with their own data.Hence, in this chapter, our focus lies on the standardized formats for various data types within HAFFET.We will demonstrate the normalization procedure to accommodate these variations.

Meta data
Users may want to supply additional information for the SNe in addition to the observational data, for example spatial coordinates for milky way extinction or the redshifts to correct observing data to the rest frame.Within HAFFET, we have integrated pre-deployed metadata tables sourced from various open-source databases, e.g. the Bright Transient Survey explorer4 (BTS) catalog and the Open Astronomy Catalog5 (OAC) tables.Users can also create their own tables specifically for their needs, with proper column names following this specific scheme6 : ... ... idkey : objid # str # meta key as index idkey1 : alias # str # meta key as alias rakey : ra # str # meta key for ra deckey : dec # str # meta key for dec zkey : z # str # meta key for redshift distkey: dist # str # meta key for distance ... ... As shown, we compile the key, value, type, and some annotations of the data tables into a readable text.Below is an illustration showing how only columns with certain names can be appropriately identified and processed to the HAFFET meta table.Here, the object ID and coordinates would be read correctly, but the redshifts would be incorrect because of the erroneous column name (redshift instead of z).objid,ra,dec,redshift ZTF18aajpjdi,13:18:06.62,+27:52:24.2,0.0746ZTF18aahtkze,11:14:19.24,+34:28:43.7,0.0693 ZTF18aapictz,11:59:37.00,+27:31:50.0,0.084... ... The Object ID is the only item required as the identifier of an object.In most cases, an object would have multiple names, e.g. the survey name and the IAU name.In order to compile all of these names that may be used to search for a certain object, an alias ID column is established as an option.
Coordinates are essential mainly when using forced photometry services, and for getting Milky Way extinctions.There are built-in functions that can handle coordinates with different formats via astropy (Astropy Collaboration et al. 2013, 2018, 2022) 7 , as well as the healpix (Górski et al. 2005) 8 indices for mollweide plots.
The redshift for each object should be well determined; otherwise all the analysis will be done in the observer frame.In the framework of HAFFET, users have the flexibility to define cosmological assumptions, parameters, error budgets, etc, in order to determine distances based on input redshift information.Here, we exemplify this by showcasing the default HAFFET settings, that is also the specific configuration applied to stripped envelope SNe in Paper I. Unless distances are specified, redshifts were converted to distances using a flat cosmology with H 0 = 70 km s −1 Mpc −1 and Ω m = 0.3.This was done using the redshifts in the CMB frame where the dipole parameters were obtained from Fixsen et al. (1996).We also included corrections for peculiar velocities using the formalism of Carrick et al. (2015).
For each individual SN we include an uncertainty on the peak magnitude corresponding to a 150 km s −1 uncertainty included in the peculiar velocity correction and a systematic ±3 km s −1 Mpc −1 error on the adopted Hubble constant.For the most nearby objects, with the largest peculiar motion corrections, the relative errors on the absolute magnitudes are the largest.Comparing the estimates for peculiar velocity corrections for our SNe (Paper I) within z < 0.015 with values estimated using Maeda et al. (2015) and the corrections provided by NED for the Virgo, Great attractor and Shapley cluster (Mould et al. 2000) we find a rms of 0.19 mag, so for these low-z SNe we add another 0.15 mag to the peak luminosity uncertainty in our error budget.
The transient type matters for some of the analysis, for example which spectral line should be used to determine the photospheric velocity, or which intrinsic colour template should be compared with to estimate the host galaxy reddening.HAFFET is able to supply this from the BTS or OAC catalogs.There is also a straightforward photometric categorization procedure within HAFFET as implemented from astrorapid (Muthukrishna et al. 2019) 9 .Moreover, since HAFFET provides spectral line identification, this is aiding in a more secure classification of the transient types.
By default, HAFFET would ignore extinctions unless they are explicitly assigned or inferred using HAFFET functions.HAFFET correct all photometry for Galactic extinction, using the Milky Way (MW) color excess E(B − V ) MW toward the position of the SNe, unless precise coordinates have been assigned.These are all obtained from Schlafly & Finkbeiner (2011).All reddening corrections are applied using the Cardelli et al. (1989) extinction law with R V = 3.1.HAFFET utilizes dustmap (Green 2018) package for Galactic extinction estimation, and users can refer to their documenta-tion page10 for a wider selection of maps and parameter configurations.Host galaxy extinction is more uncertain.One method to estimate host-galaxy extinction is to make use of the fact that SNe often have similar intrinsic colors after peak (e.g., Drout et al. 2011).This was developed by Stritzinger et al. (2018) and Taddia et al. (2018) for stripped envelope SNe and Type II SNe.For super-luminous SNe (SLSNe), Chen et al. (2023, their table A4) investigated the g − r colours at peak for a large sample of ZTF objects.To estimate the values for the host-galaxy extinction, HAFFET collected these intrinsic SN color-curve templates and attribute the difference between the observed and the intrinsic color to the host galaxy reddening.

Observational data
Once a list of objects is constructed using an appropriate meta table, each object's observational data must be assigned.Besides the image (see Fig. 2), HAFFET can be utilized to work with photometric and spectroscopic data, and in this section we describe how to input these data to HAFFET.

Using private data and arbitrary input formats
Different datasets may have significantly different data formats, depending on how the data was reduced and presented.For example, certain codes favor the json format, while others make use of the csv format.Many sources may also use various keywords to describe the data, e.g.different notations of magnitudes or fluxes with distinct units.
It is important to note that jdkey and filterkey are strictly required, and either mag/emag or flux/eflux should be provided after that.Then, to convert between magnitudes and fluxes, built-in functions can be utilized.HAFFET uses a default zeropoint of 23.9, which is appropriate for converting fluxes measured in micro Janskys.
It frequently happens that LCs from different sources do not match up.This can be due to a variety of factors, such as the methodology used to estimate the photometry, the way standard stars were chosen, or not correcting for the different filter functions.Therefore, HAFFET makes a source column whenever a LC is appropriately included in order to display the data origins.
Similar plain text files with either 2 or 3 columns are required for input of spectra, as well as an observation time that might be used later to estimate the line velocity evolution.The three columns present the wavelengths, fluxes, and their errors.When making spectral fits, HAFFET has built-in methods to mimic flux errors depending on the spectral quality if errors are not provided.The flux units for spectra could be arbitrary, and HAFFET is able to absolute calibrate them with interpolated photometric magnitudes.

Using data from public online sources
Since open web servers offer data in a consistent data format, HAFFET contains built-in functions for obtaining data from them, e.g. the ZTF (Yao et al. 2019) and Asteroid Terrestrial-impact Last Alert System (ATLAS) (Shingles et al. 2021) Forced Photometry Services, the application programming interface (API) of Weizmann Interactive Supernova Data Repository (WISeREP) (Yaron & Gal-Yam 2012), Open Astronomy Catalog (OAC) (Guillochon et al. 2017) and Transient Name Server (TNS) (Gal-Yam 2021), and the Growth marshal (Kasliwal et al. 2019)/fritz12 broker for the internal ZTF groups13 .A valid set of authorizations is required by HAFFET to access these services if a user wants to utilize them.Guidance on handling these authorizations can be found in the online documentation.
HAFFET has the capability to preprocess these data, e.g.binning, outlier removal, etc, aiming to standardize them to the best extent possible.Meanwhile, HAFFET also incorporates nested auxiliary tools that facilitate appropriate optimization of these data.For instance, as shown in Fig. 3, for the ZTF Forced Photometry Services the user can use HAFFET to check if the object is covered by multiple fields, and if so, correct the baseline of different fields in the same filter.More details can be found in Yao et al. (2019, see their Fig. 4).Once observational data for a SN have been acquired and standardized, the subsequent stage in HAFFET involves fitting the data using a range of analytical models.HAFFET is built to fit functions to a variety of datasets, including spectral absorption features and many kinds of LCs.Despite having very different data, these can be fitted using the same techniques.In HAFFET we therefore specify a number of "models" that provide the objectives for the data to approach as well as so-called "engines" that are used to prepare the dataset for certain fits.

Model Fittings
There are currently nine engines available in HAFFET, and these are shown in Table 1, along with a variety of built-in models for each of them, see Table 2.In this section, we describe all built-in engines and models, show the situations in which these engines and models should be utilized, how to tune their hyperparameters, and explain how users can define their own engines and models.

Defining models
A python file that contains analytical functions and a json file that specifies the engine and parameters are used to define each model in HAFFET.Below is an example using the json file of the power-law fits (which is further discussed in section 4. As shown, the powerlaw multiple model would be called to fit data prepared by the multiband early engine with the powerlaw full functions having four free parameters.As discussed in Section 5.1, there are two different likelihoods available in HAFFET.By default, HAFFET uses a Gaussian likelihood, while if we set fit error = True, it will include one more term to the likelihood as additional model uncertainties.The same parameter item decides whether to fit multiple band LCs simultaneously or independently.If the same parameter is left blank, HAFFET will fit the LCs in different bands one at a time.If some other parameters are specified, such as t exp for example, HAFFET fit all bands at once with the same t exp, which is the epoch of first light for such a case.We have showcased examples of how to define engines and models on the documentation page, which users can always refer to.

Built-in models
In the sections that follow we outline the fundamental concepts of the built-in models while highlighting the possibility of experimenting with various fitting choices, such as different free parameters, likelihoods, or fitting patterns.

multiband early models
'multiband early' engine will extract multi-band light curves of SNe, automatically identify the baselines, and, based on user settings, extract early-phase multi-band light curves from baseline to a specified percentage of the estimated peak.As a representative model, power-law fits are working with multiple-band photometric data prepared by the 'multiband early' engine.These fits can for example be used to estimate explosion epochs and rise times, but the precision by which we can constrain the first light is also of importance for many other investigations (for example for coincidence studies with neutrino signals or gravitational wave detections).Miller et al. (2020) developed a Bayesian framework to model the early rise of LCs as a power law in time in their Eq.1: where C is the baseline flux present in the reference image prior to SN discovery, t fl is the time of first light, H[t fl ] is the Heaviside function equal to 0 for t < t fl and 1 for t ≥ t fl , A b is a constant of proportionality in filter b, and α b is the power-law index in filter b.Miller et al. (2020) applied this framework to a subset of normal SNe Ia from ZTF to simultaneoulsy model the evolution in both the ZTF g and r filters.This assumes that the epoch of first light is the same in the two ZTF bands, which is a fair assumption given the ZTF cadence and the similarity of the SN ejecta opacity at these wavelengths.In HAFFET we follow the same methodology to characterize the early emission in the powerlaw multiple model (see Sect. 4.1), but also provide the possibility to fit the different band LCs independently by removing same parameter in the power single model.This configuration is maintained as the default setting in HAFFET and is ultimately applicable across all models.By way of illustration, we employed this model to estimate the explosion epochs of SNe in Paper 1.As in Olling et al. (2015), Miller et al. (2020) only include observations up to 40% of the peak amplitude of the SN LC, and note that this particular choice, instead of 30% or 50%, does slightly affect the final inference for the model parameters.
For comparison we adopt the same settings as default in the multiband early engine, where the peak amplitude in each band should be previously estimated via the gaussian process or other multiband main models.It is noteworthy that the explosion epoch can also be fitted to bolometric models as a free parameter, or estimated as the middle of the last non-detection and the first detection epochs.In HAFFET, we provide users the option to choose their method of estimation.

multiband main models
SNe LCs typically exhibit a rapid rise to maximum after the explosion, followed by a decline, and eventually accompanied by a linear tail.In the meanwhile unique physical mechanisms, such as CSM (circumstellar material), can result in multiple peaks in the LCs.Currently, there are numer- ous analytical physical models that can effectively reproduce the evolution of the primary peak in SNe LCs through parameterization.By fitting these models to the LCs near the main peak, we not only achieve data continuity but also directly describe transient LCs through the parameters of these models.Within HAFFET, 'multiband main' engine extracts data encompassing the main peak of the LC in accordance with user-defined criteria for model fitting.Identifying the primary peak often necessitates techniques that are dissociated from the model itself.By default, HAFFET employs the Gaussian regression algorithm (GP) for peak determination.GP is a non-parametric data-driven interpolation technique utilized for serializing LCs.In order to include color effects, we perform time-series forecasting on the joint multi-band (e.g.g and r) fluxes convolved with the wavelengths.We use a flat mean function14 for the flux form, and establish two kernels, i.e. a constant kernel for the wavelengths, and a stationary Matern32 kernel for the fluxes, with the GEORGE15 package (Ambikasaran et al. 2015).
The GP interpolation becomes less informative with larger uncertainties and when the data are sparser.For estimating physical parameters for normal SNe, an alternative approach is then to fit the data using analytic functions, such as those used by Bazin et al. (2009); Karpenka et al. (2012); Kessler et al. (2010a,b); Villar et al. (2019).For this purpose we in-cluded the Bazin et al. (2009) and Villar et al. ( 2019) models in HAFFET.The 'Bazin' model is appropriate for SN LCs without fluctuations, whereas the 'Villar' model is also useful to fit plateaus and bumps.For the Bazin model, the flux form is determined by 5 parameters: e −(t−t0)/τ fall 1 + e −(t−t0)/τrise + B (2) where Taddia et al. (2015, their fig. 8) illustrate the different parameters and how they contribute to the light curve properties.We can obtain the date of maximum from the derivative of this function as t max = t 0 + τ rise log −τrise τrise+τ fall (Bazin et al. 2009).
The functional form of the Villar model is similar to the Bazin model, but incorporates a plateau component by adding two additional free parameters: The comparison of the Villar model with the Bazin model and the Karpenka et al. (2012)

SED models
The SED engine is designed to match multi-band data in the temporal dimension, resulting in wavelength-dependent data at different epochs.This allows for color calculation, blackbody fitting, etc, which can subsequently be utilized to estimate bolometric luminosities.Taking a different perspective: three approaches are adopted in HAFFET to estimate the bolometric luminosity based on the extinction-corrected brightness and the distance.
First, we use the bolometric correction (BC) coefficients of Lyman et al. (2014Lyman et al. ( , 2016)).These color-dependent coefficients were measured by fitting the spectral energy distributions of a sample of stripped-envelope SNe that have good observational coverage at ultra-violet, optical, and infrared wavelengths, and can be utilized as long as the light curves for a SN of interest are available in at least two bands.The bolometric magnitude is expressed as where L bol is the bolometric luminosity, L ⊙,bol and M ⊙,bol are the luminosity and bolometric magnitude of the Sun.A BC to filter x is defined as: where M x is the absolute magnitude of the SN in filter x.
For example, if a SE SN is monitored in the g and r filters, then according to Lyman et al. (2014, their table 2), this SE SN during the photospheric phases (−0.3 mag < g − r < 1.0 mag) will have In this way, the bolometric LCs of the SNe can be estimated by matching up the g and r-band magnitudes.Three approaches in HAFFET are utilized for the color epoch match-up, i.e. binning, GP, and fitting.HAFFET projects gand r-band detections onto a grid (with a userdefined binning, such as 1 day) that may be readily matched.The binning method is taking all epochs with both bands available, and convert them to bolometric magnitudes and hence luminosities.For epochs with only one band, HAFFET can estimate magnitudes for the missing band from either GP interpolation or from analytic fittings.
The above match-ups can also be applied to multiple filters.In HAFFET, we can construct SEDs as a diluted blackbody (BB) distribution for those epochs with multiple-band data, and the luminosity can then be calculated by integrating the fitted BB from 2000 Å to 20000 Å 16 .We fit a diluted BB function with multiple bands using the following formula17 : where F λ is the flux at wavelength λ, B is the Planck function, A λ is the extinction in magnitudes, T is the temperature, R is the radius, d is the distance, and ϵ is the dilution factor (Eastman et al. 1996;Hamuy et al. 2001;Dessart & Hillier 2005) that represents a general correction between the fitted BB distribution to the observed fluxes.We use the values from Dessart & Hillier (2005) in HAFFET for SNe II.For other types of SNe, the default is to ignore the dilution factor but users can also use their own functions.Finally, the derived magnitudes (from section 4.2.1 and 4.2.2) can also be used to absolute calibrate the input spectra, which could then be used to fit the SED models (e.g. the blackbody function) or integrated for bolometric luminosities.For this approach, we have included the transmission information for ZTF g, r and i filters in HAFFET.After obtaining the bolometric LCs, there are a variety of models available in HAFFET that can fit them.

bol early models
Following shock breakout, the emission from an astrophysical explosion can be dominated by the radiation of shockheated material as it expands and cools, known as shock cooling emission.This is often seen for a subgroup of supernovae, SNe IIb, that exhibits double-peaked light curves, but there is also evidence for this kind of early emission from other transients, presumably with extended atmospheres.
In HAFFET, similar to the multiband early engine, bol early engine primarily focuses on extracting the earlyphase bolometric LCs that was inferred from the SED engine.As a default built-in model, we implement the shock cooling emission model from Piro et al. (2021), that fits LCs prepared by the 'bol early' engine, and here the luminosity can be expressed as (Piro et al. 2021, their functions 17 and 20): where the prefactor P = π(n−1) , and v t = (n−5)(5−δ) Here, n = 10, δ = 1.1, K = 0.119, and t is the time relative to the explosion epoch.
Due to the hot temperatures during shock cooling emission, the function can be simplified by assuming a constant electron scattering opacity κ.Piro et al. (2021) use κ = 0.2 cm 2 g −1 for their helium-rich SNe.In HAFFET, we could either fit the opacity as a free parameter, or use a constant opacity following Nagy (2018, their table 6): κ = 0.21 cm 2 g −1 for SNe IIP, 0.20 cm 2 g −1 for IIb, 0.18 cm 2 g −1 for Type Ib, and 0.10 cm 2 g −1 for Type Ic SNe, or use constant opacity from user input, e.g. for the ZTF Ibc sample study in Paper I, we use a constant opacity κ = 0.07 cm 2 g −1 for both SNe Ib and Ic following Chugai (2000); Tartaglia et al. (2021); Barbarino et al. (2021) 18 .

bol main models
The bolometric LCs of SNe contain a rich array of physical information, and the mathematical modeling of these curves has a well-established history since Arnett (1982).Within HAFFET, we established 'bol ' engines, that was similar to 'multiband ' engines, to prepare bolometric LCs in different phases for model fittings.As default of HAFFET, we provide built-in functions to compare the constructed bolometric LCs with the semi-analytic models from Arnett (1982) for normal core-collapse SNe for epochs around the main peak.
For a normal SN after the explosion, as the ejecta expand, the decay of 56 Ni to 56 Co and afterward to 56 Fe releases energy into the ejecta which powers the optical LC, including the luminous peak and the later epochs19 .Thus, exploring the bolometric LCs during the peak and tail phases can reveal the properties of the explosion and the progenitor.
With several simplifying assumptions, e.g. the ejecta are expanding homologously, the radiation pressure dominates over the gas pressure, and with a constant opacity and small initial radius, Arnett (1982, their Eq. 36) provides an expression for all Type I SN LCs, that can be used to estimate the bolometric luminosity with the radioactive inputs, see also Valenti et al. (2008).We assume full γ-ray trapping since the Arnett formalism is constructed for the LCs around the peak, and get (see Chatzopoulos et al. 2012;Tartaglia et al. 2021): Here, ϵ Ni = 3.9 × 10 10 erg g −1 s −1 and ϵ Co = 6.8 × 10 9 erg g −1 s −1 are the specific heating rates of Ni and Co decay, respectively, and τ Ni = 8.8 days and τ Co = 111.3days are their corresponding decay (e-folding) timescales.Using Arnett (1982, his Eq. 31): τ m is the characteristic time scale, and by assuming a uniform density within the ejecta: where β = 13.8 (Valenti et al. 2008), Λ = 6/5 (Lyman et al. 2016), and the opacity κ opt is discussed at the end of Section 4.2.4.
In HAFFET, users have the option to select the free parameters that fit the Arnett model.For instance, the bolometric LCs can be fitted with M Ni + τ m , or M Ni + M ej + E kin , and it is possible to vary the explosion epoch and opacity as free parameters as well.The default HAFFET model is the M Ni + τ m , and by doing this, an additional function is needed to break the degeneracy between the ejecta mass (M ej ) and the kinetic energy (E kin ) in Eq. 11, and for this an estimate for the velocity is employed.
As discussed in Dessart et al. ( 2016, their section 5.3), a 'representative' expansion rate, V m is defined as, that can be used to break the degeneracy between M ej and E kin in Eq. 11.With a large grid of 1D radiative-transfer simulations for SE SNe, they derived analytic expressions between V m and V ph at the peak epoch as follows: V ph (He I λ5876) = 2.64 + 0.765 V m , (13) and suggest to measure V ph from He I λ5876 in SNe IIb/Ib and from O I λ7772 in SNe Ic.We derive spectral line velocities (V ph ) in section 4.2.7, and follow their methodology to convert V ph into V m with Eqs. 13 and 14.Finally with Eqs.11 and 12, we can estimate M ej and E kin separately with V m and the Arnett fitted τ m , as: We explore the relationship of τ m on M ej and E kin in the left panel of Fig. 5.As shown, the M ej and E kin can be decided with τ m together with a velocity measurement.As example with SN 2020bcq, the fitted τ m is ∼ 10 days (see Fig. 9) and the peak velocity is ∼ 10,000 km s −1 (see Fig. 6), therefore according to Fig. 5, M ej and E kin should be around 1 M ⊙ and 1 × 10 51 erg, respectively.

bol tail models
Figure 5.In the left panel, we visualize Eq. 11 and Eq. 12, showing how both Mej and E kin can be estimated with τm together with a velocity measurement.In the right panel, we instead show T0 of the bolometric tail in Eq. 18.Here we assume constant opacities, i.e. κ = 0.2 cm 2 g −1 and κγ = 0.027 cm 2 g −1 An alternative way to estimate the 56 Ni mass is using the luminosity at the tail, see for example the work by Afsariardchi et al. (2021).In HAFFET, by default the 'tail' of the LC is defined as the epochs after 60 rest-frame days post-peak.We fit the tail bolometric LCs with the model from Wygoda et al. (2019, their Eqs. 10, 11 and 12): where t is the time since the explosion in the rest frame, L γ and L pos are the total energy release rate of gamma rays and positron kinetic energy respectively.The term in parenthesis is a deposition factor, which represents the incomplete trapping of gamma rays with T 0 as the partial trapping timescale.T 0 can be translated to ejecta mass and kinetic energy in a similar way as τ m (Clocchiatti & Wheeler 1997): where κ γ = 0.027 cm 2 g −1 is the gamma ray opacity.The luminosity terms can be expressed as: In the right panel of Fig. 5, we show that the M ej and E kin can be decided with T 0 together with a velocity measurement.

specline and specv evolution models
In this section, we describe the specline engine, employed for the preparation of spectroscopic data pertaining to specific elements.Additionally, we detail the procedure for measuring expansion velocities from the data prepared by the specline engine.Furthermore, we discuss the specv evolution engine, which facilitates the fitting of velocity evolution to predict velocities at designated phases.
The specline engine in HAFFET offers spectral data within a range for model fits.A line's intrinsic wavelength and the permitted velocity ranges can be used by HAFFET in addition to a manual input to infer the fitting range.Such an automated spectral fitting process is shown in the lower left panel of Fig. 7.After correcting for extinction and time dilation, we fit the continuum of a spectrum with a polynomial, which is afterwards subtracted.We smooth the residual spectrum around the relevant absorption feature with a Savitzky-Golay filter 20 , and obtain a number of peak (valley) points via scipy.signal.findpeaks (Harris et al. 2020)  21 .The spectra after continuum removal and their local smoothings are shown as the grey and brown lines correspondingly in Fig. 7.The vertical dashed line denotes the intrinsic location of a spectral line (Here He I λ5876 for a SN Ib), and the detected peaks and valleys in the spectral region are shown as orange upper and cyan lower arrows.The peak closest to the intrinsic line location is selected as the red endpoint of the absorption feature.The peak with a slightly lower wavelength is assumed to be the blue boundary of the spectral line.
The selected fitting range is afterward applied to cut the spectra.After fitting the spectral data within the wavelength range with analytic models, e.g.Gaussian or Voigt, the output is compared to the intrinsic wavelength of the line to estimate the velocities.To these velocities, a specv evolution engine could be used to collect them for fitting with, e.g. an exponential function, for the average velocities against phase 20 Smoothed spectrum is only used for peak search. 21https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.findpeaks.htmlafter peak, as done by Fremling et al. (2018, their fig. 4), see Fig. 6 22 .

Import external models
Observers often search for intriguing transients with peculiar photometric or spectroscopic behavior that are not necessarily consistent with traditional explanations.For example, superluminous supernovae (SLSNe) show luminosities significantly greater than for conventional SNe.Other models for the powering mechanism are then needed to explain them rather than the classical radioactive models, e.g. a magnetar model (Ostriker & Gunn 1971;Kasen & Bildsten 2010;Chatzopoulos et al. 2012;Inserra et al. 2013;Nicholl et al. 2017;Liu et al. 2022).Instead of upgrading the built-in models in HAFFET, we choose to provide users the ability to create their own models (see Sect. 4.1) or import models from other modeling-specific software packages, such as MOSFIT and redback.We show an example that fits the redback magnetar model23 on the famous SN 2015bn in section 6.4.
One point we need to emphasize is that HAFFET's modular design allows users to perform individual analyses and model fitting steps on SNe data, starting from raw photometric and spectral data, progressing through color, temperature, etc, all the way to the final bolometric LC.Alternatively, similar to some model-fitting programs like MOSFIT, all steps can be integrated into a closed-loop fitting process, offering users more flexibilities.Additionally, HAFFET provides more fitting options, such as utilizing scipy instead of MCMC (Markov Chain Monte Carlo) for faster parameter optimization.The user-friendly GUI interface within HAFFET also offers convenience for users lacking in background knowledge.

Fitting methods and outputs
In Sec. 4, we introduced built-in engines within HAFFET, which offer data for fitting diverse models.These engines, together with user-selected objective functions, systematically investigate optimal parameter distributions through various fitting procedures.In this section, we will explore the different fitting routines offered by HAFFET and how it preserves certain outputs of this process for caching and sharing fitting results.

Hyperparameter optimization routine
By assuming the observed deviations between the objective function and the observed data are the result of Gaussian scatter, the log-likelihood is: where O i , σ i , and M i are the i-th of n observed magnitudes, errors, and model magnitudes, respectively.The term β is used to account for the fact that the data uncertainties are over-or underestimated.In HAFFET, users can decide whether to include β into likelihood functions with the fit error parameter (see Sect. 4.1).To optimize the parameters that are used in the fits to the analytic models there are two routines available in HAFFET, i.e. optimization via scipy.optimizeand Monte Carlo (MC) methods via emcee (Foreman-Mackey et al. 2013).scipy.optimizeoffers functions designed for minimizing objective functions, potentially under constraints.It is a versatile tool that integrates various models and methods, capable of fitting the objective function based on user requirements.Its fitting speed is notably rapid, yet it frequently places significant reliance on prior information, specifically initial guesses and boundaries.In cases where prior information is insufficient, this method often fails to converge.Therefore, we also introduced MCMC method, a more resource-intensive yet more reliable approach, to HAFFET.
In order to alleviate the computational cost as well as to speed up the MC burn-in process, by default HAFFET first fit the model with minimizing objective functions via scipy.optimize.The resulting parameters as well as the predefined boundaries are afterwards used to set the initial guesses for a number of Markov chains (walkers).For each chain, the set of parameters is randomly sampled, a likelihood is calculated between the observed data and the resulting models, and MC would enforce random sampling to follow the direction to minimize the likelihood.The parameter distributions are afterwards built after the sampler burn-in to a specific parameter region.To estimate the parameter error bars, by default we use 1 sigma for scipy estimations and a correspondence of 16 and 84 percentiles for all burn-in samples as lower and upper limits.
While fitting the SNe data in Paper 1 with HAFFET, we employed specific fitting parameters that were broadly suitable for the majority of the objects.Consequently, these parameters have been adopted as the default fitting options in HAFFET.We emphasize that in cases where fits using these default settings are failed, users should consult the HAFFET documentation page as well as the websites of scipy and emcee.This will provide a deeper insight into the underlying concepts and allow for the appropriate adjustment of parameters.Moreover, a comprehensive comparison from multiple angles, e.g.posterior parameter distributions with scipy and emcee, are presented in section 6.3.

Caching Data and Models
HAFFET handles data and fits for various SNe on a caseby-case basis, and below we describe in detail how it operates.First, a global variable called ZTFDATA24 has to be defined (often in the shell profiles; if not, it will use the current folder).This is the directory for HAFFET to manage cached data, e.g. the photometric data downloaded from online resources.All observational data are stored in dedicated folders, organized as easily readable text files.In order to increase code efficiency, it is important to properly cache the samplings as model fitting may take a long time, especially when using the Monte Carlo method.We store and load the cached fitting samplings in hdf5 format with the joblib25 package, and all these cached files are stored following a dedicated data structure.HAFFET offers functions that facilitate the storage and retrieval of all pertinent observational data and models used in the fitting process.Additionally, it ensures cross-compatibility across various systems and platforms.
Then, according to the intrinsic properties and data qualities, different SN data may be fitted to models with different options, e.g.whether there is a tail in the SN LCs, or what is the range of photospheric phases for the Arnett model fitting, or if the automatic identification of absorption features is correct.HAFFET provides default settings in a file for general usage, as well as a possibility for the users to specify parameters for individual SNe26 .An alternative option to adjust fitting options for particular SNe is to use HAFFET with a Graphical User Interface (GUI), see Figure 7.All the data, fitting parameters, and fitting samplings can be stored and loaded, which is universal to different modes.

Examples of utilizing HAFFET
We have presented how HAFFET might be used to analyze SN Ibc data in Paper I, e.g.figure 2 of Paper I illustrate the fittings with an example of SN 2020bcq; in this section, we provide some more technical descriptions as a supplement to that HAFFET usage.

Blackbody vs bolometric correction inferred luminosity
In HAFFET, we often construct bolometric LCs for SE SNe and SNe II with two bands (e.g.their g and r magnitudes) using the analytic bolometric corrections derived in Lyman et al. (2014).For objects observed in more than two bands, e.g. in the ZTF gri bands, we could also use the multi-band photometry to construct SEDs.Alternatively, we can estimate the bolometric luminosity by integrating the absolute-calibrated spectra.We compare the luminosi- ties estimated from these different approaches in Fig. 8.As shown, the bolometric correction approach using only two bands provides quite similar bolometric luminosities to those from the blackbody or spectra integration.We estimated the luminosities for ZTF SNe Ic-BL in Corsi et al. (2023) and in Anand et al. (2023), and for comparison we test the methods also on a few famous SNe, e.g.SN 1998bw, and found consistent results between the different methods.Therefore, we set the Lyman bolometric correction method as the default approach for SE SNe and SNe II in HAFFET, and provide functions to convert BV R to gr in case an object is observed in Johnson filters.

Explosion properties from the Arnett model vs the radioactive decay tail
As discussed in section 4.2.5, the constructed bolometric LC at epochs around the main peak can be fitted to the clas-sical Arnett model for an estimation on the explosion properties, e.g.M Ni , M Ej and E Kin .In section 4.2.6 the fits on the bolometric tail were introduced which can provide alternative estimates of the same properties.In Fig. 9 we compare the nickel masses from the two approaches with SN 2020bcq as example.As shown, the inferred M Ni from the Arnett model is 0.09 solar masses, which is ∼ 2 times larger than the estimate from the tail that is 0.04 solar masses.We conducted such a comparison to a sample of ZTF SNe Ibc (the black dots) in Fig. 10 and conclude similarly to Afsariardchi et al. (2021) (the red dots, see also their Fig. 4) that the Arnett method yields M Ni values which are systematically a factor of around 2 larger than those estimated from the tail.
The restrictions of the Arnett model may be to blame for this discrepancy, e.g.Khatami & Kasen (2019) claimed that the self-similarity condition breaks down when the SN ejecta  In Fig. 11, we explore whether explosion parameters from the radioactive tail could be consistent with the peak Arnett fit.Models 1 and 2 are the best-fit models for the Arnett peak and bolometric tail, respectively, as estimated using HAFFET with constant opacities, i.e. κ = 0.2 cm 2 g −1 and κ γ = 0.027 cm 2 g −1 .Assuming the Arnett model is accurate, the bolometric tail could be predicted (model 3) using its inferred explosion parameters.As shown, the radioactive decay model, i.e. model 3, is underestimated compared to the Arnett model.It is possible to argue that the adopted velocity (that was estimated via the Dessart relation, see equations 15 and 16) or the opacities are incorrect.We then explore how the tail brightness and slope depend on the velocity and opacities in models 4 and 5.We can translate the Arnett model's estimates of τ m into M Ej and E Kin (along with a velocity measurement), and then T 0 for the tail.In model 4, we fix the M Ni , τ m , and fit the bolometric tail with γ-trapping opacity as a free parameter, whereas in model 5 we fit the velocity instead27 .As shown, the best fits of models 4 and 5 have steeper slopes than model 2.

Optimize fitting with minimize routine vs monte carlo
As discussed in section 5.1, there are two routines available in HAFFET for hyperparameter optimization, and in this section we compare them for the fitting results on the r-band LC of SN 2020bcq with the analytic model of Bazin et al. (2009).The parameter contours from the MCMC and the fitted region from the scipy minimization are shown in Fig. 12. Once fit with the scipy package, the optimal values for the parameters as well as their estimated covariances could be estimated.In HAFFET, the diagonals of the covariance matrix are used as the errors for the parameters, therefore hyperparameters could be optimized into the green and blue dashed regions (for 1 and 3 sigma correspondingly) as shown in Fig. 12.In HAFFET, we mimic the MCMC contours for the scipy minimization routine by randomly selecting parameters within the permitted regions.Also, the resulting parameter ranges from scipy minimize, i.e. the blue and green dashed regions, can afterwards be used as prior for MC samplers.After burn-in, a more degenerate version of the contours could be generated from the MCMC process.To decide the parameter error bars, in HAFFET we use 1 sigma for the scipy estimations, and corresponding 16 and 84 percentiles of all burn-in samples as lower and upper limits.
As shown in Fig. 12, the scipy minimize routine can estimate a similar set of parameters as MCMC, with much less computational cost and time.However, the scipy method might not be suitable for complicated models with many free parameters, and for such cases MCMC is the better option.

Beyond the Arnett model, a magnetar fit to SN 2015bn
As discussed in section 4.3, HAFFET can be used to fit the constructed bolometric LC to models from external packages.In this section, we show an example with a magnetar model (import from MOSFIT) fitting on data of SN 2015bn (Nicholl et al. 2016).The photometric data were obtained  7).From model 1, we obtain the posterior distributions of MNi and τm, which can be translated into MEj and EKin together with a velocity measurement (∼ 10,000 km s −1 ).We use the parameters obtained from model 1 to reproduce a tail bolometric, model 3 (the brown line).We adapted its γ trapping opacity (model 4, κγ from 0.027 to 0.05 cm 2 g −1 ) or photospheric velocity (model 5, V ph from 10,000 to 5,000 km s −1 ) so that the tail can be brighter to match the observed data.
from the Open SN Catalog (Guillochon et al. 2017).We use the analytic bolometric correction for SE SNe derived in Lyman et al. (2014) to estimate its bolometric LC.As shown in the left panel of Fig. 13, the bolometric LCs for SN 2015bn from Nicholl et al. (2016) and HAFFET are similar, however the HAFFET LC lack a few early phase observations since they were not available in the Open SN Catalog.The absence of early phase constraints gave more freedom to our fittings, see the early stage of the cyan dashed lines that are the modeled magnetar LCs fitting on the HAFFET bolometric LC.For the magnetar fitting, we set the same host extinction and opacities for SN 2015bn as in Nicholl et al. (2016) and fit the explosion epoch as a free parameter.The resulting contours are presented in the right panel, which is consistent with those from Nicholl et al. (2016).

Summary and Future prospects
In this work we have introduced a new open-source SN fitting code HAFFET.We explain the driving forces behind the HAFFET code's creation, and how HAFFET could be utilized to analyze SN data for sample investigation.We tested HAFFET by applying it to the SNe Ibc that were observed by ZTF and classified with BTS in Paper I. In this paper we show more examples and demonstrate that HAFFET is functional and clearly not strictly adhering to SNe Ibc.
To broaden its applicability, we have plans for future upgrades of HAFFET.This includes: 2. K-corrections for high-redshift SNe, which would be important in the LSST era.
4. Besides analytic models, we intend to provide possibilities for users to include hydrodynamic models as well.This could be done by comparing data to a grid of hydrodynamic model realizations.
5. Comprehensively improving the radioactive models, e.g. by including nickel mixing (Dessart et al. 2012;Dessart et al. 2016;Yoon et al. 2019), asymmetry, etc.These can be explored after a grid of numerical models are available, which are not possible in the analytic Arnett model.
6. Adding machine learning components to snelist for sample exploration.For instance a dataset of SN LCs, HAFFET can be used to obtain a list of features such as their peak magnitudes, slopes, and colors.A Principal Component Analysis could be then adopted to asses which properties are significantly related to the SN types.

Figure 1 .
Figure1.Flowchart of the main steps in the HAFFET process, performed on the stripped envelop SNe in Paper I. As shown, after getting observational data for a single SN, snobject is called to fit on multi-band LCs, which could be used to estimate photometric properties, as well as provide interpolated magnitudes for estimating color and bolometric LC.A further step is to fit bolometric LC with, e.g. the Arnett model, and spectral lines can be also fitted for photospheric velocities, which are often used to help break the degeneracy of the Arnett model.Finally, all the fitted parameters from model fittings are collected by the snelist for a sample study.

Figure 2 .
Figure 2. The image of the field of SN 2020bcq as a finder that was automatically made by HAFFET.The images are queried with the PS1 Image Cutout Service a , while the SDSS field stars (the green open circles) are downloaded via astroquery b .The position of SN 2020bcq is marked as the red source in the middle of the inset.a https://outerspace.stsci.edu/display/PANSTARRS/PS1+Image+Cutout+Serviceb https://astroquery.readthedocs.io/en/latest/

Figure 4 .
Figure 4. Flowchart illustrating model fitting procedures of HAFFET.As shown, HAFFET first obtain model function and priors, as well as data to be fitted that were prepared by the engines.Then a minimizing process is performed to constrain model parameters.The output could be used as prior for MCMC routines.Finally the fitted samplings can be called by HAFFET to, e.g.produce parameter contours, and reproduce observational data.

Figure 6 .
Figure 6.An exponential fit of the fitted velocities on the phases for SN 2020bcq.The red dashed lines are the random samplings of the MCMC, and the red open circle is the estimated velocity at the peak phase from the exponential fit.

Figure 7 .
Figure 7.A view of the HAFFET GUI showing the model fittings on multi-band LCs, spectral lines and the constructed bolometric LC.In the upper panel we show the control window of the GUI.

Figure 8 .
Figure 8. Luminosity comparison between different approaches.In the left panel, the circles represent the luminosity estimated with the analytic bolometric correction from Lyman et al. (2014), while the red circles are bolometric luminosities estimated from blackbody fits on the gri photometry and the orange down pointing arrows are estimates based on integrating the spectra.In the right panel, we show the peak luminosity comparison between the blackbody fitted and the Lyman inferred values for 34 SNe Ib and 35 SNe Ic at peak epoch.The blue dashed line is the one-to-one relation.As shown, the luminosities from the two approaches are consistent, although the gri-constructed blackbody provides luminosity estimates with large(r) uncertainties.

Figure 9 .
Figure 9.As shown in the lower left panel of Fig. 7, we fit the Arnett and tail functions to the Lyman-inferred bolometric luminosity LC of SN 2020bcq (ZTF20aajcdad) as an example.The marginalized parameter distributions are shown as corner plots in this figure.In the left panel, we fit the Arnett model by using the explosion epoch from our earlier power-law fits, while in the middle plot we treat the explosion epoch as a free parameter in the Arnett model.The predicted rise time from the Arnett model, i.e. the time between the estimated explosion epoch to peak, is 13.93 days, which is comparable to the estimate from the power-law fits (13.14 days).The slight difference in the explosion epoch does not change the nickel mass estimate but modifies τm from 9.6 to 10.6 days.The marginalized parameter distributions of the tail fitting are shown as corner plots to the right.The best-fit nickel mass is 0.04 solar masses, which is roughly half of that inferred from the Arnett model.have a centralized 56 Ni deposition, thus proposed a new analytical model for SE SNe that introduced a dimensionless parameter β to the Arnett model.A robust β for each SE SN sub-type is still under investigation, e.g.Meza & Anderson (2020) adopted β values that were derived from the simulated SE SN LCs of Dessart et al. (2016), and Afsariardchi et al. (2021) instead derived β from a sample of literature SE SNe.As the largest untargeted Type Ibc survey to date, the ZTF BTS offers a large amount of SE SNe for calibrating β.

Figure 10 .
Figure 10.Comparison of MNi between Arnett fits and fits to the radioactive decay tail.The ZTF SNe Ibc (the subset of SNe in Paper I that clearly shows a tail) are shown in black dots, while the sample from Afsariardchi et al. (2021) (that is a selection from the literature, including 27 SE SNe) is shown in red dots.The blue dashed line is the one-to-one relation.As shown, the Arnett inferred MNi is systematically higher than those from the tails.

Figure 11 .
Figure 11.Various models fit to the bolometric LC of SN 2020bcq (the open circles).The realization with the best-fit Arnett and tail models are shown by models 1 and 2 (the solid cyan and red lines; see also the lower right panel of Fig.7).From model 1, we obtain the posterior distributions of MNi and τm, which can be translated into MEj and EKin together with a velocity measurement (∼ 10,000 km s −1 ).We use the parameters obtained from model 1 to reproduce a tail bolometric, model 3 (the brown line).We adapted its γ trapping opacity (model 4, κγ from 0.027 to 0.05 cm 2 g −1 ) or photospheric velocity (model 5, V ph from 10,000 to 5,000 km s −1 ) so that the tail can be brighter to match the observed data.
1. Including routines to query data from more open online resources, e.g.alert brokers such as Lasair 28 and Alerce 29 .

Figure 12 .
Figure 12.As shown in the upper panel of Fig. 7, we fit the multi-band LCs following analytic models of Bazin et al. (2009) with SN 2020bcq (ZTF20aajcdad) as an example.Such fits can be done in different routines, and in this plot we compare the fitting results between them.The parameter distributions from MCMC on r-band LC are shown as corner plots.The vertical dashed lines in the marginalized parameter histograms represent the 16 and 84 percentile of all burn-in samples, which are corresponding to the 1 sigma posterior parameter distributions from the scipy minimize routine (the green box).

Figure 13 .
Figure 13.Magnetar model fitting on SN 2015bn via HAFFET.We construct the bolometric LC of SN 2015bn with g and r magnitudes with the analytic bolometric correction for SE SNe derived in Lyman et al. (2014).They are shown in black and blue open circles.As shown, they are quite similar to the one from Nicholl et al. (2016), i.e. the red circles.The cyan dashed lines are reproduced with the fitted magnetar model samplings.The parameter contours are shown to the right, which is similar to the estimates of Nicholl et al. (2016, their Fig. 4).photometry service was funded under the Heising-Simons Foundation grant #12540303 (PI: Graham).This work has been supported by the research project grant "Understanding

Table 1 .
Table of built-in engines defined in HAFFET.

Table 2 .
Table of built-in models defined in HAFFET.Here we list only the basic models, and in HAFFET there are also models with multiple components, e.g. the Arnett model at the main peak plus the tail model, and a boundary of time between them is set as a free parameter as well.For such a case, we use a bol full engine to prepare bolometric LCs for model fitting.