While you are free to use your own fitter to use the SNEMO spectral time series templates, the SNCosmo Python library, which now includes the SNEMO models, is suggested for simplicity. If you don't already use SNCosmo, it can be installed following the instructions here. If your version of SNCosmo was installed before October 2018, you probably need to do an update.
Please note that the spectral time series provided for use with SNCosmo have first and last epochs added with zero flux. This is necessary to control the extrapolation done in SNCosmo. However, the choice that supernovae have zero flux at -20 and +60 days, which is made in the provided files, is relatively arbitrary and is not based on the training data. The user is free to edit their copy of the templates to make different assumptions about the first and last epochs where there is measurable flux.
Here is an example of how to use SNCosmo to fit your data with one of the SNEMO models:
import sncosmo
import matplotlib.pyplot as plt
# Load some example data, or load your own data in an astropy table:
data = sncosmo.load_example_data()
# Load the model:
model = sncosmo.Model(source='snemo7') # Or choose 'snemo2' or 'snemo15'
# List the model parameters that will be fit:
fit_params = ['z', 't0', 'As', 'c0', 'c1', 'c2', 'c3', 'c4', 'c5', 'c6']
# Fit the data with the model:
result, fitted_model = sncosmo.fit_lc(data, model, fit_params)
# Alternatively, if you know the redshift of the SN, this can be fixed:
model.set(z=0.5)
fit_params = ['t0', 'As', 'c0', 'c1', 'c2', 'c3', 'c4', 'c5', 'c6']
result, fitted_model = sncosmo.fit_lc(data, model, fit_params)
# Pring the best fit values:
print "model parameters:", result.parameters
# Plot the data and the best fit model:
sncosmo.plot_lc(data, model=fitted_model, errors=result.errors)
plt.show()
See the SNCosmo documentation for more usage examples.Clare Saunders (CV) Laboratoire de Physique Nucléaire et de Hautes Énergies (LPNHE) IN2P3/Sorbonne Université 4 Place Jussieu 75005 Paris, France csaunders@lpnhe.in2p3.fr