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.
It is recommended to run the sncosmo fit using the optional argument phase_range=(-10, 46) to restrict the fit to the phase range covered by the model. To further control the fit, the spectral time series provided for use with SNCosmo have first and last epochs added with zero flux. This helps 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 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:
See the SNCosmo documentation for more usage examples.
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, phase_range=(-10, 46)) # 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, phase_range=(-10, 46)) # 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()
Clare Saunders (CV) Laboratoire de Physique Nucléaire et de Hautes Énergies (LPNHE) IN2P3/Sorbonne Université 4 Place Jussieu 75005 Paris, France firstname.lastname@example.org