Gaussian Process
The Gaussian Process module is used to fit the SN light curves and mangle the SED template (PISCOLA makes use of tinygp). This module is documented bellow:
- piscola.gaussian_process.fit_gp_model(times, wavelengths, fluxes, flux_errors, k1='Matern52', fit_mean=False, fit_type='flux', wave_log=True, time_scale=None, wave_scale=None, add_noise=True)
Fits a Gaussian Process model to a SN multi-colour light curve.
All input arrays MUST have the same length.
- Parameters:
times (ndarray) – Light-curve epochs.
wavelengths (ndarray) – Light-curve effective wavelength.
fluxes (ndarray) – Light-curve fluxes.
flux_errors (ndarray) – Light-curve flux errors.
k1 (str) – Kernel to be used for the time axis. Either
Matern52,Matern32orExpSquared.fit_type (str) – Transformation used for the light-curve fits:
flux,log,arcsinh.wave_log (bool, default
True.) – Whether to use logarithmic (base 10) scale for the wavelength axis.time_scale (float, default
None) – If given, the time scale is fixed using this value, in units of days.wave_scale (float, default
None) – If given, the wavelength scale is fixed using this value, in units of angstroms. Note that if ‘wave_log=True’, the logarithm base 10 of this value is used.add_noise (bool, default
True) – Whether to add a white-noise component to the GP model. This “inflates” the errors.
- Returns:
gp_model – Gaussian Process multi-colour light-curve model.
- Return type:
GaussianProcess
- piscola.gaussian_process.fit_single_lightcurve(times, fluxes, flux_errors, k1='Matern52')
Fits a Gaussian Process model to a single SN light curve.
All input arrays MUST have the same length.
- Parameters:
times (ndarray) – Light-curve epochs.
fluxes (ndarray) – Light-curve fluxes.
flux_errors (ndarray) – Light-curve flux errors.
k1 (str) – Kernel to be used for the time axis. Either
Matern52,Matern32orExpSquared.
- Returns:
gp_model – Gaussian Process light-curve model.
- Return type:
GaussianProcess
- piscola.gaussian_process.prepare_gp_inputs(times, wavelengths, fluxes, flux_errors, fit_type, wave_log)
Prepares the inputs for the Gaussian Process model fitting.
- Parameters:
times (ndarray) – Light-curve epochs.
wavelengths (ndarray) – Light-curve effective wavelength.
fluxes (ndarray) – Light-curve fluxes.
flux_errors (ndarray) – Light-curve flux errors.
fit_type (str) – Transformation used for the light-curve fits:
flux,log,arcsinh.wave_log (bool) – Whether to use logarithmic (base 10) scale for the wavelength axis.
- Returns:
X (ndarray) – X-axis array for the Gaussian Process model.
y (ndarray) – Y-axis array for the Gaussian Process model.
yerr (ndarray) – Y-axis errors for the Gaussian Process model.
y_norm (float) – Normalisation used for the fluxes and errors. The maximum of the fluxes is used.