Skip to content

Multiband parametric fit

light_curve.RainbowFit

Bases: BaseRainbowFit

Multiband blackbody fit to the light curve using functions to be chosen by the user Note, that m and corresponded sigma are assumed to be flux densities. Based on Russeil et al. 2023, arXiv:2310.02916.

Parameters:

Name Type Description Default
band_wave_cm dict

Dictionary of band names and their effective wavelengths in cm.

required
with_baseline bool

Whether to include an offset in the fit, individual for each band. If it is true, one more fit paramter per passband is added - the additive constant with the same units as input flux.

True
bolometric str or BaseBolometricTerm subclass

The shape of bolometric term. Default is 'bazin'. Other options are: 'sigmoid'

'bazin'
temperature str or BaseTemperatureTerm subclass

The shape of temperature term. Default is 'sigmoid'. Other options are: 'constant', 'delayed_sigmoid'. The sigmoid terms are parametrized by the mid temperature T = (Tmin + Tmax) / 2 and a relative amplitude T_amplitude = (Tmax - Tmin) / (Tmax + Tmin); a weak prior anchors T_amplitude to 0 (constant temperature) unless the data require a temperature change.

'sigmoid'
spectral str or BaseSpectralTerm subclass

The spectral SED model. Default is 'planck' (standard blackbody, no extra fit parameters). The other terms describe SEDs that deviate from a blackbody; each reduces to Planck at a null parameter value, with a weak Gaussian prior anchoring it there so a true blackbody is recovered unbiased:

  • 'blanketed' — UV-extincted blackbody B_nu(T) * exp(-tau); adds lambda_scale (blanketing strength, ~0 to 1). The extinction reach is anchored to the characteristic temperature T (shared with the temperature term) so the blanketing depth does not vary as the source cools.
  • 'modified_bb' — Planck tilted by a power law (lambda / lambda_ref) ** beta; adds beta (0 => Planck).
  • 'logparabola' — Planck times exp(a*L + b*L**2), L = ln(lambda / lambda_ref); adds sp_a, sp_b (0 => Planck).
  • 'genwien' — generalized Wien B_nu ~ nu**3 * exp(-x**spec_k), x = h*nu/(k_B*T); adds spec_k (1 => Wien tail). The fitted T is not a physical temperature for this term (see the class docstring).
'planck'
optimizer str

Optimizer backend: 'iminuit' (default, robust Migrad) or 'least_squares' (scipy Trust Region Reflective). The latter shares the same analytic Jacobian and is usually faster; it transparently falls back to iminuit for upper-limit fits, term combinations without analytic derivatives, or when it fails to converge.

'iminuit'

Methods:

Name Description
__call__

Evaluate the feature. Positional arguments are numpy arrays of the same length, band must consist of the same strings as keys in band_wave_cm. If sorted is True, t must be sorted in ascending order. If check is True, the input is checked for NaNs and Infs. If fill_value is not None, it is used to fill the output array if the feature cannot be evaluated.

model

Evaluate Rainbow model on the given arrays of times and bands. *params are fit parameters, basically the output of __call__ method but without the last parameter (reduced Chi^2 of the fit). See parameter names in the .name attribute.

peak_time

Return bolometric peak time for given set of parameters

fit_and_get_errors

The same as __call__ but also returns the parameter errors. Optionally sets the print_level (verbosity) for Minuit fitter. If get_initial is True, returns the initial parameters instead of fitted ones (useful for debugging)