phot_class.fitting¶
The fitting module runs a series of fits on individual light-curves and
tabulates the results. This includes the ability to fit each bandpass
independently (like in SiFTO) or to fit restframe blue/red band passes os
separate, collective sets.
Function Documentation¶
-
phot_class.fitting.create_empty_table(parameters, **kwargs)[source]¶ Create an empty table for storing fit results
- Columns:
Parameters: - parameters (iter) – List of parameter names to add columns for
- arguments to pass astropy.Table (Any) –
Returns: A masked astropy Table
-
phot_class.fitting.fit_results_to_dict(data, obj_id, band_set, results, fitted_model)[source]¶ Format sncosmo fit results so they can be appended to an astropy table
See the
create_empty_tablefunction for information on the assumed table format.Parameters: - data (Table) – The data used in the fit
- obj_id (str) – The id of the object that was fit
- band_set (str) – The name of the band set (‘all’, ‘blue’, ‘red’)
- results (Result) – Fitting results returned by
sncosmo - fitted_model (Model) – A fitted
sncosmomodel
Returns: Fit results as a dictionary
-
phot_class.fitting.run_band_fits(obj_id, data, fit_func, priors_hs=None, priors_bg=None, kwargs_hs=None, kwargs_bg=None, show_plots=False)[source]¶ Run light curve fits on a given target using the Hsiao and 91bg model
Fits are run using both the
hsiao_x1andsn91bgmodels for all available bands and then for each band individually.Varied parameters include
z,t0,amplitude,x1, andc. If thezis specified in the priors for both models, it is not varied in any fit. The parameterst0andzare not varied in the individual band fits.Parameters: - obj_id (str) – Id of the object being fitted
- data (Table) – Table of photometric data
- fit_func (func) – Function to use to run fits (eg.
fit_funcs.fit_lc) - priors_hs (dict) – Priors to use when fitting hsiao
- priors_bg (dict) – Priors to use when fitting sn91bg
- kwargs_hs (dict) – Kwargs to pass
fit_funcwhen fitting salt2 - kwargs_bg (dict) – Kwargs to pass
fit_funcwhen fitting sn91bg - show_plots (bool) – Plot and display each individual fit
Returns: A table with results each model / dataset combination
-
phot_class.fitting.run_collective_fits(obj_id, data, fit_func, band_names, lambda_eff, priors_hs=None, priors_bg=None, kwargs_hs=None, kwargs_bg=None, show_plots=False)[source]¶ Run light curve fits on a given target using the Hsiao and 91bg model
Parameters: - obj_id (str) – Id of the object being fitted
- data (Table) – Table of photometric data
- fit_func (func) – Function to use to run fits (eg.
fit_funcs.fit_lc) - band_names (list) – Name of bands included in
data_iter - lambda_eff (list) – Effective wavelength for bands in
band_names - priors_hs (dict) – Priors to use when fitting hsiao
- priors_bg (dict) – Priors to use when fitting sn91bg
- kwargs_hs (dict) – Kwargs to pass
fit_funcwhen fitting salt2 - kwargs_bg (dict) – Kwargs to pass
fit_funcwhen fitting sn91bg - show_plots (bool) – Plot and display each individual fit
Returns: A table with results each model / dataset combination