actsnclass.LightCurve
- class actsnclass.LightCurve
Light Curve object, holding meta and photometric data.
- Variables:
bazin_features_names (list) – List of names of the Bazin function parameters.
bazin_features (list) – List with the 5 best-fit Bazin parameters in all filters. Concatenated from blue to red.
dataset_name (str) – Name of the survey or data set being analyzed.
filters (list) – List of broad band filters.
id (int) – SN identification number
photometry (pd.DataFrame) – Photometry information. Keys –> [mjd, band, flux, fluxerr, SNR, MAG, MAGERR].
redshift (float) – Redshift
sample (str) – Original sample to which this light curve is assigned
sim_peakmag (np.array) – Simulated peak magnitude in each filter
sncode (int) – Number identifying the SN model used in the simulation
sntype (str) – General classification, possibilities are: Ia, II or Ibc
- check_queryable(mjd: float, r_lim: float)
Check if this light can be queried in a given day.
- load_snpcc_lc(path_to_data: str)
Reads header and photometric information for 1 light curve
- fit_bazin(band: str) list
Calculates best-fit parameters from the Bazin function in 1 filter
- fit_bazin_all()
Calculates best-fit parameters from the Bazin func for all filters
- plot_bazin_fit(save: bool, show: bool, output_file: srt)
Plot photometric points and Bazin fitted curve
Examples
>>> from actsnclass import LightCurve
define path to light curve file
>>> path_to_lc = 'data/SIMGEN_PUBLIC_DES/DES_SN431546.DAT'
>>> lc = LightCurve() # create light curve instance >>> lc.load_snpcc_lc(path_to_lc) # read data >>> lc.photometry # display photometry mjd band flux fluxerr SNR 0 56207.188 g 9.6560 4.369 2.21 1 56207.195 r 6.3370 3.461 1.83 ... ... ... ... ... ... 96 56336.043 r 14.4300 3.098 4.66 97 56336.055 i 18.9500 5.029 3.77 [98 rows x 5 columns]
>>> lc.fit_bazin_all() # perform Bazin fit in all filters >>> lc.bazin_features # display Bazin parameters [62.0677260096896, -7.959383808822104, 47.37511467606875, 37.4919069623379, ... ... ... 206.65806244385922, -4.777010246622081]
plot light curve fit
>>> lc.plot_bazin_fit(output_file=str(lc.id) + '.png')
for fitting the entire sample…
>>> path_to_data_dir = 'data/SIMGEN_PUBLIC_DES/' # raw data directory >>> output_file = 'results/Bazin.dat' # output file >>> fit_snpcc_bazin(path_to_data_dir=path_to_data_dir, features_file=output_file)
a file with all Bazin fits for this data set was produced
- __init__()
Methods
__init__()check_queryable(mjd, r_lim)Check if this light can be queried in a given day.
fit_bazin(band)Extract Bazin features for one filter.
Perform Bazin fit for all filters independently and concatenate results.
load_snpcc_lc(path_to_data)Reads one LC from SNPCC data.
plot_bazin_fit([save, show, output_file])Plot data and Bazin fitted function.