snsim.sample¶
SimSample class used to store simulations.
Classes¶
Class to store simulated SN sample. |
Module Contents¶
- class snsim.sample.SimSample(sample_name, sim_lcs, header, dir_path=None)[source]¶
Class to store simulated SN sample.
- Parameters:
- classmethod fromDFlist(sample_name, sim_lcs, header, dir_path=None)[source]¶
Initialize the class from a list of pandas.DataFrame.
- Parameters:
- Returns:
A SimSample class with the simulated lcs.
- Return type:
SimSample class object
- classmethod fromFile(sim_file, engine='pyarrow')[source]¶
Initialize the class from a fits or pickle file.
- Parameters:
- Returns:
A SimSample class with the simulated lcs.
- Return type:
SimSample class object
- get_obj_sim_model(obj_ID)[source]¶
Get th sim model of one obj.
- Parameters:
obj_ID (int) – ID of the obj.
- Returns:
sncosmo sim model of the obj.
- Return type:
- set_fit_model(model, model_dir=None, mw_dust=None)[source]¶
Set the fit with a given SNCosmo Model.
- Parameters:
model (sncosmo.models.Model or str) – A sncosmo Model or a model name for utils.init_sn_model(model, model_dir).
model_dir (str, opt) – In case you want to set your model via utils.init_sn_model(model, model_dir).
mw_dust (dict, opt) – Milky Wat dust model to apply. | mw_dust | ├── model : str (model name) | └── rv : float, opt
- Returns:
Set the self._fit_model attribute.
- Return type:
None
- fit_lc(obj_ID=None, **kwargs)[source]¶
Fit all or just one SN lightcurve(s).
- Parameters:
ID (int, default is None) – The SN ID, if not specified all SN are fit.
- Returns:
Directly modified the _fit_res attribute.
- Return type:
None
Notes
Use snc_fitter from utils
- write_fit(fit_model_name, write_path=None)[source]¶
Write fits results in fits format.
- Returns:
Write an output file.
- Return type:
None
Notes
Use write_fit from utils.
- plot_lc(obj_ID, plot_sim=True, plot_fit=False, **kwargs)[source]¶
Plot the given SN lightcurve.
- Parameters:
obj_ID (int) – The Object ID.
mag (boolean, default = False) – If True plot the magnitude instead of the flux.
zp (float) – Used zeropoint for the plot.
plot_sim (boolean, default = True) – If True plot the theorical simulated lightcurve.
plot_fit (boolean, default = False) – If True plot the fitted lightcurve.
Jy (boolean, default = False) – If True plot in Jansky.
mod (boolean, default = False) – If True use the self.modified_lcs rather than self.sim_lcs
- Returns:
Just plot the SN lightcurve !
- Return type:
None
Notes
Use plot_lc from utils.
- plot_ra_dec(plot_vpec=False, field_dic=None, field_size=None, **kwarg)[source]¶
Plot a mollweide map of ra, dec.
- get(key, mod=False)[source]¶
Get an array of sim_lc metadata.
- Parameters:
key (str) – The metadata to access.
- Returns:
The array of the key metadata for all SN.
- Return type:
- get_peakmags(band, magsys='ab')[source]¶
Get peak apparent magnitude in any band.
- Parameters:
- Returns:
The array of the peak apparent magnitude for all SN.
- Return type:
- property name¶
Get sample name.
- property header¶
Get header.
- property n_obj¶
Get SN number.
- property sim_lcs¶
Get sim_lcs.
- property meta¶
Get lcs meta dict.
- property sim_model¶
Get sim model.
- property fit_model¶
Get fit model.
- property fit_res¶
Get fit results list.