analysis.band_fitting¶
The band_fitting
module performs fits of individual bands of observed light-curves
Function Documentation¶
-
analysis.band_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
-
analysis.band_fitting.
fit_results_to_dict
(data, obj_id, band_name, results, fitted_model)[source]¶ Format sncosmo fit results so they can be appended to an astropy table
See the
create_empty_table
function 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_name (str) – The name of the band that was fit
- results (Result) – Fitting results returned by
sncosmo
- fitted_model (Model) – A fitted
sncosmo
model
Returns: Fit results as a dictionary
-
analysis.band_fitting.
fit_single_target
(fit_func, data, model, priors=None, kwargs=None, out_table=None, show_plots=False)[source]¶ Run fits to individual bands of an observed light-curves
Parameters: - data (Table) – Table of photometric data
- fit_func (func) – Function to use to run fits (eg.
sncosmo.fit_lc
) - model (Model) – The model to use when fitting
- priors (dict) – Priors to use when fitting
- out_table (Table) – Append results to an existing table
- kwargs (dict) – Kwargs to pass
fit_func
when fitting - show_plots (bool) – Plot and display each individual fit
Returns: A table with results each model / dataset combination
-
analysis.band_fitting.
tabulate_band_fits
(data_release, models, fit_func, config=None, out_path=None)[source]¶ Tabulate fit results for a collection of data tables
Results already written to out_path are skipped.
Parameters: - data_release (module) – An sndata data release
- models (list) – A list of sncosmo models
- fit_func (func) – Function to use to run fits
- config (dict) – Specifies priors / kwargs for fitting each model
- out_path (str) – Optionally cache results to file in real time
Returns: An astropy table with fit results