A Global Model of the Light Curves and Expansion Velocities of Type II-Plateau SupernovaeO. Pejcha1 and J. L. Prieto21 Hubble and Lyman Spitzer Jr. Fellow, Department of Astrophysical Sciences, Princeton, NJ, USALink to our paper
|
The fitting code can be downloaded here. The code is a minimally stripped down version of considerably more complex code and a lot of bells and whistles not interfering with the current functionality were not removed. Please beware when tinkering around, especially for segmenation faults resulting from array allocation and access. The code was tested under Linux and Cygwin, but is certainly not error-free.
The code reads in data of a single supernova, fits it with the model of our paper (using the global parameters from the paper) and returns the parameter values, their uncertainties (including modified fit with χ2/NDOF=1) and model fits. Two test datasets of SN2004et and SN2009N are supplied compiled from the work of Maguire et al. (2010), Pritchard et al. (2014), and Takats et al. (2014). Note that the fit results for these supernovae are slightly different from what was reported in our paper. The reason are the missing priors, and in case of SN2004et in NGC6946 we are obtaining the host galaxy distance only from one supernova and not three (SN2002hh and SN1980K in addition).
Go to directory cmpfit-1.2 and type make. This compiles the fitting routine CMPFIT, which has been modified to handle a large covariance matrix and reports χ2 in every iteration.
Now go back to the original directory and look in Makefile. If you are under Cygwin, change LDFLAGS_CYGWIN to LDFLAGS. This increases the stack size, but the requisite compiler command is not recognized under Linux. Now execute make fit_single, which should compile the code (with a bunch of warnings).
When you successfuly compile the code, then it should be set up so that you get results just by running ./fit_single.exe SN2004et.dat or ./fit_single.exe SN2009N.dat. The source code is only minimally documented, but proceeds along the general lines of reading in the data, initializing fit coefficients, choosing which variables to fit, and exporting the results. There are comments on how to impose limits on parameters or fix their values. This is important for explosion times and distances.
The columns in the data input file are
ref dset flt jd val err
where ref is the label for data reference (the code can in principle handle blocking individual data sources, photometric bands and individual data points, but most of the functionality is disabled in the public version), dset is 0 for expansion velocity and 1 for photometry, flt is the label of photometric band explained below or the line used to obtain expansion velocity (0 for Fe II 5169), val and err are the value and uncertainty of the measurement.
The filter labels are:
U 0 B 1 V 2 R 3 I 4 J 5 H 6 K 7 g 9 #SDSS DR7 SDSS = AB - 0.02 r 10 #SDSS DR7 SDSS = AB - 0.02 i 11 #SDSS DR7 SDSS = AB - 0.02 z 12 #SDSS DR7 SDSS = AB - 0.02 uvw2 13 #Swift uvw2 @ 1928A uvm2 14 #Swift uvm2 @ 2246A uvw1 15 #Swift uvw1 @ 2600A u 16 #Swift u @ 3465A b 17 #Swift b @ 4392A v 18 #Swift v @ 5468A Z 19 # Hamuy et al. (2001) - on 1999em Y 20 # in the YJHK series?Do not use filter numbers not listed here - these are placeholders for other filters, where we weren't able to obtain enough data to constrain global parameters. Using such bands will make the fits wrong.
The code prints to terminal parameter values and their uncertainties (both default and with χ2/DOF set to unity) and also nickel mass and bolometric luminosity at 50 days after the explosion. Note that the parameter values can be different from what we give in the paper, because this is a simpler version of the code without priors or simultaneous fitting of multiple supernovae.
The output file phot.dat outputs the photometric measurements and model parameters at each point. The columns are
JD mag mag_err filter star_no dy Pi tau 1-w
where star_no should be always equal to 0, dy is the relative difference between data and the model (data-model)/sigma, Pi is the dimensionless radius, tau is the temperature parameter, and 1-w is the weight function.
The output file velo.dat is the same but for velocities and the columns are
JD mag mag_err filter star_no dy Pi 1-w
The output file model_phot.dat has the results of the model on a uniform temporal grid with each column corresponding to a different passband explained in the file header. See filter codes above.
The output file model_velo.dat is the model predictions for velocity.
The output file lbol_err.dat has the bolometric luminosity as a function of time calculated according to our paper. The first column is JD, second column is bolometric luminosity in solar luminosities, third column is the uncertainty from the covariance matrix of the fitted supernova parameters, fourth column is the uncertainty from the covariance matrix of the global parameters obtained in the full fit of our model, and fifth column has these two uncertainties added in quadrature.