fit_SN3¶
-
sitelle.fit.fit_SN3(source, cube, v_guess=None, lines=None, return_fit_params=False, kwargs_spec={}, kwargs_bkg={}, debug=False)¶ Function specialized to fit sources found in the SN3 cube. The background spectrum is not fitted, due to the presence of sky lines that would bias the estimation of the velocity. | It looks very similar to
fit_SN2()and the code should be refactored. It differs however in the philosophy behind the velocity estimation : this method has been designed to be performed after a SN2 fit, from which we already estimated the velocity of the source. Thus no guess is performed here.The method can be used in a parallel process. The SNR of the spec is estimated using the
stats_without_lines()method.Parameters: - source (
Series) – A row from aDataFramecontaining detected sources. Should have columnsxpos,ypos, assumed to correspond to the SN2 pixel coordinates. - cube (
SpectralCube) – The cube taken in SN3 filter. - v_guess (float) – (Optional) If None, looking for the element
source['v_guess'] - lines (list of str) – (Optinal) Names of the lines to fit. If None, SN3_LINES are used, except if no v_guess has been found; then we assume it’s only a Hbeta line at very fast velocity.
- return_fit_params (bool, Default = False) – (Optional) If True, returns the full parameters of the fit.
- kwargs_spec (dict) – (Optional) Additional keyword arguments to be used by
fit_spectrum()when fitting the source spectrum. - kwargs_bkg (dict) – (Optional) Additional keyword arguments to be used by
fit_spectrum()when fitting the background spectrum. - debug (bool, Default = False) – (Optional) If True, the velocity guess is verbose.
Returns: fit_res – A dict containg a lot of information about the fit.
Parameter Description err estimated noise value on the spectra guess_snr SNR guess exit_status code to identify cause of crash v_guess guessed velocity in km/s chi2 chi2 computed on the residual rchi2 reduced chi2 computed on the residual ks_pvalue ks test computed on the residuals logGBF log Gaussian Bayes Factor on the residuals rchi2 reduced chi2 computed on the residual broadening broadening estimation of the lines broadening_err error on the brodeaning estimation velocity estimated velocity velocity_err error on the fitted velocity flux_* flux estimation for * line, where * is the line name flux_*_err error on the flux estimation for * line, where * is the line name snr_* Estimated SNR of the * line Return type: dict
See also
- source (