kinextract.plot_fit

kinextract.plot_fit(fit: dict) None[source]

Plot the observed spectrum against the best-fit model and residuals.

Draws a two-panel figure: the top panel overlays the observed spectrum (fit["state"].g) and the best-fit model spectrum (fit["outputs"]["gp"]), marking any masked/rejected pixels (gerr >= 1e9) in orange; the bottom panel shows the fractional residual (data - model) / model with the RMS (computed over good pixels only) annotated and marked with dashed reference lines. This is the primary quick-look diagnostic for judging overall fit quality.

Parameters:

fit (dict) – Output of run_spectral_fit(). Must contain fit["state"] (a FitState with the observed spectrum g, wavelength grid x, and per-pixel error gerr) and fit["outputs"]["gp"] (the best-fit model spectrum).

Returns:

Displays the figure via plt.show(); does not return a value.

Return type:

None