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) / modelwith 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 containfit["state"](aFitStatewith the observed spectrumg, wavelength gridx, and per-pixel errorgerr) andfit["outputs"]["gp"](the best-fit model spectrum).- Returns:
Displays the figure via
plt.show(); does not return a value.- Return type:
None