plot_spectrum¶
- msaexp.spectrum.plot_spectrum(inp='jw02767005001-02-clear-prism-nrs2-2767_11027.spec.fits', z=9.505, vel_width=100, scale_disp=1.3, nspline=27, bspl=None, show_cont=True, draws=100, figsize=(16, 8), ranges=[(3650, 4980)], full_log=False, eazy_templates=None, use_full_dispersion=True, get_init_data=False, scale_uncertainty_kwargs=None, plot_unit=None, trim_negative=True, sys_err=0.02, return_fit_results=False, use_aper_columns=False, label=None, **kwargs)[source]¶
Fit templates to a spectrum and make a diagnostic figure
- Parameters
- inpstr or
HDUListorSpectrumSampler Input spectrum file path or HDUList object or SpectrumSampler object. Default is
jw02767005001-02-clear-prism-nrs2-2767_11027.spec.fits.- zfloat, optional
Redshift value. Default is 9.505.
- vel_widthint, optional
Velocity width, km/s. Default is 100.
- scale_dispfloat, optional
Dispersion scale factor. Default is 1.3.
- nsplineint, optional
Number of spline continuum components. Default is 27.
- show_contbool, optional
Whether to show continuum. Default is True.
- drawsint, optional
Number of draws from the fit covariance to plot. Default is 100.
- figsizetuple, optional
Figure size. Default is (16, 8).
- rangeslist of tuples, optional
List of wavelength ranges to plot in zoom panels. Default is [(3650, 4980)].
- full_logbool, optional
Whether to use full log. Default is False.
- eazy_templatesNone or str, optional
Eazy templates to use for the fit. Default is None.
- use_full_dispersionbool, optional
Whether to use full dispersion. Default is True.
- get_init_databool, optional
If specified, just return the
SpectrumSamplerobject and the design matrix arrayA- scale_uncertainty_kwargsNone or dict, optional
Scale uncertainty keyword arguments. Default is None.
- plot_unitNone, str,
Unit, optional Plot unit. Default is None.
- sys_errfloat, optional
Systematic error added in quadrature with the spectrum uncertainties. Default is 0.02.
- return_fit_resultsbool
Just return the fit results without making a plot -
templates, coeffs, flam, eflam, _model, mask, full_chi2- use_aper_columnsbool, optional
Whether to use aperture columns in the spectrum table. Default is False.
- labelNone or str, optional
Label to add to the figure. Default is None.
- kwargsdict, optional
Additional keyword arguments passed to
SpectrumSamplerandmake_templates
- inpstr or
- Returns
- If
return_fit_results = True, returns a tuple containing the fit results: templates, coeffs, flam, eflam, _model, mask, full_chi2.- Otherwise, returns
None.
- If