QSFit.jl

QSO spectral fitting made easy !!

Stars

Warn

This software is under active development and details may change at any time without notice. Also, documentation is not yet exhaustive.

QSFit started as an attempt to perform automatic analysis of optical spectra of AGNs and QSOs in a simple, replicable and shareable way. The first implementation in IDL language (see repo here has been used to analyze 71261 AGN and QSO spectra from SDSS DR10. The resulting spectral properties (such as emission line luminosities and widths, continuum slopes, etc.) are collected in a catalog in FITS format, as well as being publicly available here: https://qsfit.inaf.it/.

The details of the spectral analysis are presented in a paper: Calderone et al. 2017 (also available on arXiv).

The code has now been ported to Julia and the new package is dubbed QSFit.jl. It comes with the following advantages with respect to the IDL version:

  • Julia is released with a MIT license and doesn't require a paid license to be executed;
  • It provides better performances and allows to distribute workload on multiple CPUs or multiple host;
  • It provides several reusable Components and a few Recipes to perform automatic spectral analysis as well as interactive emissione line fitting;
  • It exploits the concept of customizable recipes (see Recipes) to customize the analysis for specific purposes;

QSFit.jl relies on the GModelFit.jl package to perform spectral fitting. A basic knowledge of such package is required to get the most out of QSFit.jl.

Installation

In the Julia REPL type:

using Pkg
Pkg.add("GModelFit")
Pkg.add("GModelFitViewer")
Pkg.add("QSFit")

To test the package type Pkg.test("QSFit").

Basic usage

The most important types used in QSFit.jl are:

  • Spectrum: it represent an observed spectrum of a AGN or QSO. It contains both the observed wavelengths and flux densities (with associated undertainties), as well as a map of "good" (i.e. reliable) spectral bins and an indication of spectral resolution. The Spectrum object can operate on spectra taken from any instrument (not only SDSS);

  • Recipe: it is a container for a specific recipe to be used to analyze a Spectrum, and for all recipe-specific options. QSFit.jl provides a few ready-to-use recipes to analyze the spectrum, which can optionally be customized by the user. New recipes can also be implemented.

The typical workflow for a spectral analysis is as follows:

using QSFit, QSFit.QSORecipes
# Download a spectrum
filename = download("http://dr10.sdss3.org/sas/dr10/sdss/spectro/redux/26/spectra/0752/spec-0752-52251-0323.fits")

# Read spectrum into a Spectrum Object
spec = Spectrum(Val(:SDSS_DR10), filename, label="My SDSS source")

# Create a Recipe object based on the Type1 recipe to analyze the spectrum
recipe = Recipe(Type1, redshift=0.3806, Av=0.21)

# Analyze the spectrum with the above recipe
res = analyze(recipe, spec)

# Display best fit parameter values:
show(res.bestfit)
Timestamp: 2024-04-29T17:07:35.773

Spectrum: My SDSS source
  resol.: 2000.000
    good:   88.671%, units: X=1.0 Å, Y=1.0e-17 erg Å^-1 cm^-2 s^-1
      Av:    0.210  (DustExtinction.OD94,  Rv: Float64 3.1,)
De-reddening factors @ 1450, 3000, 5100 AA: [1.6990216358789452, 1.4214289702517076, 1.2389351505225081]
       z:    0.381  (Cosmology.FlatLCDM{Float64}(0.7, 0.6999146929857499, 0.3, 8.53070142500527e-5))
┌ Warning: NV_1241 is a multiplet: using average wavelength: 1240.8125A
@ QSFit.ATL ~/.julia/dev/QSFit/src/ATL.jl:78
┌ Warning: OI_1306 is a multiplet: using average wavelength: 1304.3515733333334A
@ QSFit.ATL ~/.julia/dev/QSFit/src/ATL.jl:78
┌ Warning: CII_1335 is a multiplet: using average wavelength: 1335.3009A
@ QSFit.ATL ~/.julia/dev/QSFit/src/ATL.jl:78
┌ Warning: SiIV_1400 is a multiplet: using average wavelength: 1398.26215A
@ QSFit.ATL ~/.julia/dev/QSFit/src/ATL.jl:78
┌ Warning: CIV_1549 is a multiplet: using average wavelength: 1549.49A
@ QSFit.ATL ~/.julia/dev/QSFit/src/ATL.jl:78
┌ Warning: CIV_1549 is a multiplet: using average wavelength: 1549.49A
@ QSFit.ATL ~/.julia/dev/QSFit/src/ATL.jl:78
┌ Warning: OIII_1664 is a multiplet: using average wavelength: 1663.4794499999998A
@ QSFit.ATL ~/.julia/dev/QSFit/src/ATL.jl:78
┌ Warning: AlIII_1858 is a multiplet: using average wavelength: 1858.753A
@ QSFit.ATL ~/.julia/dev/QSFit/src/ATL.jl:78
┌ Warning: CII_2326 is a multiplet: using average wavelength: 2326.44A
@ QSFit.ATL ~/.julia/dev/QSFit/src/ATL.jl:78
┌ Warning: MgII_2798 is a multiplet: using average wavelength: 2799.9415A
@ QSFit.ATL ~/.julia/dev/QSFit/src/ATL.jl:78
┌ Warning: MgII_2798 is a multiplet: using average wavelength: 2799.9415A
@ QSFit.ATL ~/.julia/dev/QSFit/src/ATL.jl:78
┌ Warning: OII_3727 is a multiplet: using average wavelength: 3728.4835000000003A
@ QSFit.ATL ~/.julia/dev/QSFit/src/ATL.jl:78
┌ Warning: HeI_5876 is a multiplet: using average wavelength: 5877.305009833333A
@ QSFit.ATL ~/.julia/dev/QSFit/src/ATL.jl:78
Good samples before line coverage filter: 3389 / 3822
Line Lyb_na          coverage: 0.000 on range     1024.8 < λ <     1026.6, threshold is < 0.600, neglecting...
Line Lyb_br          coverage: 0.000 on range     1017.2 < λ <     1034.3, threshold is < 0.600, neglecting...
Line Lya_na          coverage: 0.000 on range     1214.6 < λ <     1216.7, threshold is < 0.600, neglecting...
Line Lya_br          coverage: 0.000 on range     1205.5 < λ <     1225.8, threshold is < 0.600, neglecting...
Line NV_1241_na      coverage: 0.000 on range     1239.7 < λ <     1241.9, threshold is < 0.600, neglecting...
Line OI_1306_br      coverage: 0.000 on range     1293.5 < λ <     1315.2, threshold is < 0.600, neglecting...
Line CII_1335_br     coverage: 0.000 on range     1324.2 < λ <     1346.4, threshold is < 0.600, neglecting...
Line SiIV_1400_br    coverage: 0.000 on range     1386.6 < λ <     1409.9, threshold is < 0.600, neglecting...
Line CIV_1549_na     coverage: 0.000 on range     1548.1 < λ <     1550.8, threshold is < 0.600, neglecting...
Line CIV_1549_br     coverage: 0.000 on range     1536.6 < λ <     1562.4, threshold is < 0.600, neglecting...
Line HeII_1640_br    coverage: 0.000 on range     1626.7 < λ <     1654.1, threshold is < 0.600, neglecting...
Line OIII_1664_br    coverage: 0.000 on range     1649.6 < λ <     1677.3, threshold is < 0.600, neglecting...
Line AlIII_1858_br   coverage: 0.000 on range     1843.3 < λ <     1874.2, threshold is < 0.600, neglecting...
Line CIII_1909_br    coverage: 0.000 on range     1892.6 < λ <     1924.4, threshold is < 0.600, neglecting...
Line CII_2326_br     coverage: 0.000 on range       2307 < λ <     2345.8, threshold is < 0.600, neglecting...
Line l2420p0_br      coverage: 0.000 on range     2399.8 < λ <     2440.2, threshold is < 0.600, neglecting...
Line MgII_2798_na    coverage: 0.000 on range     2797.5 < λ <     2802.4, threshold is < 0.600, neglecting...
Line MgII_2798_br    coverage: 0.000 on range     2785.9 < λ <       2814, threshold is < 0.600, neglecting...
Line NeV_3345        coverage: 1.000 on range     3343.5 < λ <     3349.3
Line NeV_3426        coverage: 1.000 on range     3423.5 < λ <     3429.5
Line OII_3727        coverage: 1.000 on range     3725.2 < λ <     3731.7
Line NeIII_3869      coverage: 1.000 on range     3866.8 < λ <     3873.5
Line Hd_br           coverage: 1.000 on range     4068.7 < λ <     4137.1
Line Hg_br           coverage: 1.000 on range     4305.5 < λ <     4377.9
Line OIII_4363       coverage: 1.000 on range     4360.6 < λ <     4368.2
Line HeII_4686_br    coverage: 1.000 on range     4647.9 < λ <     4726.1
Line Hb_na           coverage: 1.000 on range     4858.5 < λ <     4866.9
Line Hb_br           coverage: 1.000 on range     4822.1 < λ <     4903.2
Line OIII_4959       coverage: 1.000 on range       4956 < λ <     4964.6
Line OIII_5007       coverage: 1.000 on range     5003.9 < λ <     5012.6
Line OIII_5007_bw    coverage: 1.000 on range     4983.2 < λ <     5033.3
Line HeI_5876_br     coverage: 0.971 on range     5828.3 < λ <     5926.3
Line OI_6300         coverage: 1.000 on range     6296.6 < λ <     6307.5
Line OI_6364         coverage: 0.600 on range       6360 < λ <     6371.1
Line NII_6549        coverage: 0.000 on range     6544.2 < λ <     6555.5, threshold is < 0.600, neglecting...
Line Ha_na           coverage: 0.000 on range     6558.9 < λ <     6570.3, threshold is < 0.600, neglecting...
Line Ha_br           coverage: 0.118 on range     6509.9 < λ <     6619.3, threshold is < 0.600, neglecting...
Line Ha_bb           coverage: 0.284 on range     6345.8 < λ <     6783.4, threshold is < 0.600, neglecting...
Line NII_6583        coverage: 0.000 on range     6579.6 < λ <       6591, threshold is < 0.600, neglecting...
Line SII_6716        coverage: 0.000 on range     6712.4 < λ <     6724.1, threshold is < 0.600, neglecting...
Line SII_6731        coverage: 0.000 on range     6726.8 < λ <     6738.5, threshold is < 0.600, neglecting...

Updated coverage:
Line NeV_3345        coverage: 1.000 on range     3343.5 < λ <     3349.3
Line NeV_3426        coverage: 1.000 on range     3423.5 < λ <     3429.5
Line OII_3727        coverage: 1.000 on range     3725.2 < λ <     3731.7
Line NeIII_3869      coverage: 1.000 on range     3866.8 < λ <     3873.5
Line Hd_br           coverage: 1.000 on range     4068.7 < λ <     4137.1
Line Hg_br           coverage: 1.000 on range     4305.5 < λ <     4377.9
Line OIII_4363       coverage: 1.000 on range     4360.6 < λ <     4368.2
Line HeII_4686_br    coverage: 1.000 on range     4647.9 < λ <     4726.1
Line Hb_na           coverage: 1.000 on range     4858.5 < λ <     4866.9
Line Hb_br           coverage: 1.000 on range     4822.1 < λ <     4903.2
Line OIII_4959       coverage: 1.000 on range       4956 < λ <     4964.6
Line OIII_5007       coverage: 1.000 on range     5003.9 < λ <     5012.6
Line OIII_5007_bw    coverage: 1.000 on range     4983.2 < λ <     5033.3
Line HeI_5876_br     coverage: 0.971 on range     5828.3 < λ <     5926.3
Line OI_6300         coverage: 1.000 on range     6296.6 < λ <     6307.5
Line OI_6364         coverage: 0.000 on range       6360 < λ <     6371.1, threshold is < 0.600, neglecting...
Good samples after line coverage filter: 3309 / 3822

Fit continuum components...
Fit results: #data: 3309, #free pars: 5, red. fit stat.:      1.957, Status: OK      
Cont. norm. (before): 0.0500043656823391
Cont. norm. (after) : 0.03889446369092905

Fit iron templates...
Ignoring ironuv component (threshold: 0.3)
Fit results: #data: 3309, #free pars: 2, red. fit stat.:     3.6618, Status: OK      

Fit known emission lines...
Fit results: #data: 3309, #free pars: 42, red. fit stat.:      2.307, Status: OK      

Fit nuisance emission lines...
Fit results: #data: 3309, #free pars: 3, red. fit stat.:     2.2622, Status: OK      
Fit results: #data: 3309, #free pars: 3, red. fit stat.:     2.0814, Status: OK      
Fit results: #data: 3309, #free pars: 3, red. fit stat.:     1.9265, Status: OK      
Fit results: #data: 3309, #free pars: 3, red. fit stat.:     1.6367, Status: OK      
Fit results: #data: 3309, #free pars: 3, red. fit stat.:     1.6367, Status: OK      
Fit results: #data: 3309, #free pars: 3, red. fit stat.:     1.6174, Status: OK      
Fit results: #data: 3309, #free pars: 3, red. fit stat.:     1.5864, Status: OK      
Fit results: #data: 3309, #free pars: 3, red. fit stat.:     1.5317, Status: OK      
Fit results: #data: 3309, #free pars: 3, red. fit stat.:     1.5302, Status: OK      
Fit results: #data: 3309, #free pars: 3, red. fit stat.:     1.5086, Status: OK      

Last run with all parameters free...

Model (dof=3233) evaluations: 1992    Time: 0:00:00 ( 0.27 ms/it)
  fit_stat:  1.2097993941430831


Model (dof=3233) evaluations: 2240    Time: 0:00:00 ( 0.27 ms/it)
Fit results: #data: 3309, #free pars: 76, red. fit stat.:     1.2098, Status: OK      
Disabling nuisance6 (unc. / norm. > 3)
Disabling nuisance7 (norm. = 0)

Re-run fit...
Fit results: #data: 3309, #free pars: 70, red. fit stat.:     1.2021, Status: OK      

Total elapsed time: 1.2762959003448486 s
Components:
────────────────────┬─────────────────────┬───────┬─────────────┬───────────┬───────────┬───────────┬─────────╮
 Component           Type                 #Free  Eval. count  Min        Max        Mean       NaN/Inf 
├────────────────────┼─────────────────────┼───────┼─────────────┼───────────┼───────────┼───────────┼─────────┤
 main                SumReducer                  4683           0.03973      0.128    0.06867  0       
 ├─╴Continuum        SumReducer                  4683           0.03793      0.112    0.06449  0       
 │  ├─╴QSOcont       QSFit.powerlaw       2      209            0.01506     0.1072    0.04845  0       
 │  ├─╴Galaxy        QSFit.hostgalaxy     1      139           0.001967    0.02548    0.01546  0       
 │  └─╴Balmer        QSFit.balmercont     2      291                  0   0.001815  0.0005802  0       
 ├─╴Iron             SumReducer                  4617                 0   0.008193   0.001366  0       
 │  ├─╴Ironoptbr     QSFit.ironopt        1      132                  0   0.007198   0.001167  0       
 │  └─╴Ironoptna     QSFit.ironopt        1      129                  0   0.002142  0.0001991  0       
 ├─╴NarrowLines      SumReducer                  4602                 0    0.04509  0.0006799  0       
 │  ├─╴NeV_3345      QSFit.SpecLineGauss  3      351                  0    0.01158  6.458e-06  0       
 │  ├─╴NeV_3426      QSFit.SpecLineGauss  3      351                  0    0.01572  0.0001466  0       
 │  ├─╴OII_3727      QSFit.SpecLineGauss  3      351                  0    0.03511  8.489e-05  0       
 │  ├─╴NeIII_3869    QSFit.SpecLineGauss  3      351                  0    0.01062  9.911e-05  0       
 │  ├─╴OIII_4363     QSFit.SpecLineGauss  3      351                  0   0.008787  5.815e-06  0       
 │  ├─╴Hb_na         QSFit.SpecLineGauss  3      351                  0    0.02003  4.911e-05  0       
 │  ├─╴OIII_4959     QSFit.SpecLineGauss  2      419                  0    0.01697   2.66e-05  0       
 │  ├─╴OIII_5007     QSFit.SpecLineGauss  3      351                  0    0.04179  0.0001058  0       
 │  ├─╴OIII_5007_bw  QSFit.SpecLineGauss  3      487                  0   0.004322  0.0001067  0       
 │  └─╴OI_6300       QSFit.SpecLineGauss  3      322                  0   0.005786  4.879e-05  0       
 ├─╴BroadLines       SumReducer                  4602                 0    0.02039   0.001032  0       
 │  ├─╴Hd_br         QSFit.SpecLineGauss  3      351                  0   0.002242  0.0001555  0       
 │  ├─╴Hg_br         QSFit.SpecLineGauss  1      419                  0    0.00925  0.0002086  0       
 │  ├─╴HeII_4686_br  QSFit.SpecLineGauss  3      351                  0   0.001796   1.94e-05  0       
 │  ├─╴Hb_br         QSFit.SpecLineGauss  3      351                  0    0.02039  0.0004605  0       
 │  └─╴HeI_5876_br   QSFit.SpecLineGauss  3      351                  0   0.003388  0.0001877  0       
 └─╴NuisanceLines    SumReducer                  3345                 0    0.02452   0.001105  0       
    ├─╴nuisance1     QSFit.SpecLineGauss  3      227                  0    0.01192  4.672e-05  0       
    ├─╴nuisance2     QSFit.SpecLineGauss  3      228                  0    0.00716  0.0003335  0       
    ├─╴nuisance3     QSFit.SpecLineGauss  3      239                  0    0.02452  6.913e-05  0       
    ├─╴nuisance4     QSFit.SpecLineGauss  3      219                  0     0.0095  0.0004425  0       
    ├─╴nuisance5     QSFit.SpecLineGauss         10                   0          0          0  0       
    ├─╴nuisance6     QSFit.SpecLineGauss         180                  0          0          0  0       
    ├─╴nuisance7     QSFit.SpecLineGauss         169                  0          0          0  0       
    ├─╴nuisance8     QSFit.SpecLineGauss  3      223                  0   0.003874  0.0001804  0       
    ├─╴nuisance9     QSFit.SpecLineGauss  3      281                  0   0.009056  8.121e-06  0       
    └─╴nuisance10    QSFit.SpecLineGauss  3      200                  0   0.003777  2.485e-05  0       
╰────────────────────┴─────────────────────┴───────┴─────────────┴───────────┴───────────┴───────────┴─────────╯

Parameters:
───────────────────┬─────────────────────┬────────┬─────────────────┬───────────┬───────────┬───────────┬──────────────────────────────────╮
 Component          Type                 Param.  Range            Value      Uncert.    Actual     Patch                            
├───────────────────┼─────────────────────┼────────┼─────────────────┼───────────┼───────────┼───────────┼──────────────────────────────────┤
 QSOcont            QSFit.powerlaw       norm    6.4e-05:Inf        0.04228    0.00132                                              
                                         x0      0:Inf                 4152   (fixed)                                               
                                         alpha   -3:1                -2.435     0.0853                                              
├───────────────────┼─────────────────────┼────────┼─────────────────┼───────────┼───────────┼───────────┼──────────────────────────────────┤
 Galaxy             QSFit.hostgalaxy     norm    0:Inf              0.02373   0.001193                                              
├───────────────────┼─────────────────────┼────────┼─────────────────┼───────────┼───────────┼───────────┼──────────────────────────────────┤
 Balmer             QSFit.balmercont     norm    0:0.5              0.02808    0.03612   0.001187  (m, v)->v * (m[:QSOcont]).norm   
                                         ratio   0.1:1               0.6664      0.712                                              
├───────────────────┼─────────────────────┼────────┼─────────────────┼───────────┼───────────┼───────────┼──────────────────────────────────┤
 Ironoptbr          QSFit.ironopt        norm    0:Inf                4.481      0.391                                              
├───────────────────┼─────────────────────┼────────┼─────────────────┼───────────┼───────────┼───────────┼──────────────────────────────────┤
 Ironoptna          QSFit.ironopt        norm    0:Inf               0.7027     0.2421                                              
├───────────────────┼─────────────────────┼────────┼─────────────────┼───────────┼───────────┼───────────┼──────────────────────────────────┤
 NeV_3345           QSFit.SpecLineGauss  norm    0:Inf              0.01645     0.0109                                              
                                         center  0:Inf                 3346   (fixed)                                               
                                         fwhm    1e+02:2e+03            100                                                         
                                         voff    -1e+03:1e+03         420.3      35.21                                              
├───────────────────┼─────────────────────┼────────┼─────────────────┼───────────┼───────────┼───────────┼──────────────────────────────────┤
 NeV_3426           QSFit.SpecLineGauss  norm    0:Inf               0.3822     0.0496                                              
                                         center  0:Inf                 3426   (fixed)                                               
                                         fwhm    1e+02:2e+03           2000                                                         
                                         voff    -1e+03:1e+03         448.6      142.6                                              
├───────────────────┼─────────────────────┼────────┼─────────────────┼───────────┼───────────┼───────────┼──────────────────────────────────┤
 OII_3727           QSFit.SpecLineGauss  norm    0:Inf               0.2412    0.02799                                              
                                         center  0:Inf                 3728   (fixed)                                               
                                         fwhm    1e+02:2e+03          519.2      67.06                                              
                                         voff    -1e+03:1e+03        -63.19      28.57                                              
├───────────────────┼─────────────────────┼────────┼─────────────────┼───────────┼───────────┼───────────┼──────────────────────────────────┤
 NeIII_3869         QSFit.SpecLineGauss  norm    0:Inf               0.2918    0.04367                                              
                                         center  0:Inf                 3870   (fixed)                                               
                                         fwhm    1e+02:2e+03           2000                                                         
                                         voff    -1e+03:1e+03         484.1      169.5                                              
├───────────────────┼─────────────────────┼────────┼─────────────────┼───────────┼───────────┼───────────┼──────────────────────────────────┤
 Hd_br              QSFit.SpecLineGauss  norm    0:Inf               0.4895     0.1791                                              
                                         center  0:Inf                 4103   (fixed)                                               
                                         fwhm    9e+02:1.5e+04      1.5e+04                                                         
                                         voff    -3e+03:3e+03          3000                                                         
├───────────────────┼─────────────────────┼────────┼─────────────────┼───────────┼───────────┼───────────┼──────────────────────────────────┤
 Hg_br              QSFit.SpecLineGauss  norm    0:Inf               0.6913    0.08493                                              
                                         center  0:Inf                 4342   (fixed)                                               
                                         fwhm    9e+02:1.5e+04         5000   (fixed)        4851  Hb_br                            
                                         voff    -3e+03:3e+03             0   (fixed)      -68.07  Hb_br                            
├───────────────────┼─────────────────────┼────────┼─────────────────┼───────────┼───────────┼───────────┼──────────────────────────────────┤
 OIII_4363          QSFit.SpecLineGauss  norm    0:Inf              0.01934     0.0131                                              
                                         center  0:Inf                 4364   (fixed)                                               
                                         fwhm    1e+02:2e+03          141.9      104.2                                              
                                         voff    -1e+03:1e+03        -75.35      46.49                                              
├───────────────────┼─────────────────────┼────────┼─────────────────┼───────────┼───────────┼───────────┼──────────────────────────────────┤
 HeII_4686_br       QSFit.SpecLineGauss  norm    0:Inf              0.06962    0.04477                                              
                                         center  0:Inf                 4687   (fixed)                                               
                                         fwhm    9e+02:1.5e+04         2332       1625                                              
                                         voff    -3e+03:3e+03         -1538      651.8                                              
├───────────────────┼─────────────────────┼────────┼─────────────────┼───────────┼───────────┼───────────┼──────────────────────────────────┤
 Hb_na              QSFit.SpecLineGauss  norm    0:Inf                0.182     0.0251                                              
                                         center  0:Inf                 4863   (fixed)                                               
                                         fwhm    1e+02:1e+03          521.5       68.6                                              
                                         voff    -1e+03:1e+03        -139.5      26.59                                              
├───────────────────┼─────────────────────┼────────┼─────────────────┼───────────┼───────────┼───────────┼──────────────────────────────────┤
 Hb_br              QSFit.SpecLineGauss  norm    0:Inf                1.707    0.08901                                              
                                         center  0:Inf                 4863   (fixed)                                               
                                         fwhm    9e+02:1.5e+04         4851      266.6                                              
                                         voff    -3e+03:3e+03        -68.07      99.02                                              
├───────────────────┼─────────────────────┼────────┼─────────────────┼───────────┼───────────┼───────────┼──────────────────────────────────┤
 OIII_4959          QSFit.SpecLineGauss  norm    0:Inf               0.1005    0.01778                                              
                                         center  0:Inf                 4960   (fixed)                                               
                                         fwhm    1e+02:2e+03          334.9      60.69                                              
                                         voff    -1e+03:1e+03             0   (fixed)      -2.081  OIII_5007                        
├───────────────────┼─────────────────────┼────────┼─────────────────┼───────────┼───────────┼───────────┼──────────────────────────────────┤
 OIII_5007          QSFit.SpecLineGauss  norm    0:Inf               0.4039    0.02616                                              
                                         center  0:Inf                 5008   (fixed)                                               
                                         fwhm    1e+02:2e+03          539.1      36.63                                              
                                         voff    -1e+03:1e+03        -2.081      12.06                                              
├───────────────────┼─────────────────────┼────────┼─────────────────┼───────────┼───────────┼───────────┼──────────────────────────────────┤
 OIII_5007_bw       QSFit.SpecLineGauss  norm    0:Inf                0.423    0.09405                                              
                                         center  0:Inf                 5008   (fixed)                                               
                                         fwhm    0:5e+03               4969       1285       5508  (m, v)->v + (m[:OIII_5007]).fwhm 
                                         voff    0:2e+03               1689      606.9       1686  (m, v)->v + (m[:OIII_5007]).voff 
├───────────────────┼─────────────────────┼────────┼─────────────────┼───────────┼───────────┼───────────┼──────────────────────────────────┤
 HeI_5876_br        QSFit.SpecLineGauss  norm    0:Inf                1.042     0.2579                                              
                                         center  0:Inf                 5877   (fixed)                                               
                                         fwhm    9e+02:1.5e+04    1.475e+04       3286                                              
                                         voff    -3e+03:3e+03          2905       1117                                              
├───────────────────┼─────────────────────┼────────┼─────────────────┼───────────┼───────────┼───────────┼──────────────────────────────────┤
 OI_6300            QSFit.SpecLineGauss  norm    0:Inf               0.2588    0.06124                                              
                                         center  0:Inf                 6302   (fixed)                                               
                                         fwhm    1e+02:2e+03           2000                                                         
                                         voff    -1e+03:1e+03        -318.7      297.1                                              
├───────────────────┼─────────────────────┼────────┼─────────────────┼───────────┼───────────┼───────────┼──────────────────────────────────┤
 nuisance1          QSFit.SpecLineGauss  norm    0:Inf                0.345    0.06333                                              
                                         center  6.1e+03:6.1e+03       6081       2.31                                              
                                         fwhm    6e+02:1e+04           1340      272.9                                              
                                         voff    -Inf:Inf                 0   (fixed)                                               
├───────────────────┼─────────────────────┼────────┼─────────────────┼───────────┼───────────┼───────────┼──────────────────────────────────┤
 nuisance2          QSFit.SpecLineGauss  norm    0:Inf               0.8908     0.1811                                              
                                         center  3.5e+03:3.5e+03       3507                                                         
                                         fwhm    6e+02:1e+04          1e+04                                                         
                                         voff    -Inf:Inf                 0   (fixed)                                               
├───────────────────┼─────────────────────┼────────┼─────────────────┼───────────┼───────────┼───────────┼──────────────────────────────────┤
 nuisance3          QSFit.SpecLineGauss  norm    0:Inf               0.1554     0.0383                                              
                                         center  3e+03:3e+03           2950                                                         
                                         fwhm    6e+02:1e+04            600                                                         
                                         voff    -Inf:Inf                 0   (fixed)                                               
├───────────────────┼─────────────────────┼────────┼─────────────────┼───────────┼───────────┼───────────┼──────────────────────────────────┤
 nuisance4          QSFit.SpecLineGauss  norm    0:Inf                1.075     0.1597                                              
                                         center  3.2e+03:3.2e+03       3188                                                         
                                         fwhm    6e+02:1e+04          1e+04                                                         
                                         voff    -Inf:Inf                 0   (fixed)                                               
├───────────────────┼─────────────────────┼────────┼─────────────────┼───────────┼───────────┼───────────┼──────────────────────────────────┤
 nuisance5 (fixed)  QSFit.SpecLineGauss  norm    0:Inf                    0   (fixed)                                               
                                         center  5.8e+03:5.8e+03       5789   (fixed)                                               
                                         fwhm    6e+02:1e+04           4364   (fixed)                                               
                                         voff    -Inf:Inf                 0   (fixed)                                               
├───────────────────┼─────────────────────┼────────┼─────────────────┼───────────┼───────────┼───────────┼──────────────────────────────────┤
 nuisance6 (fixed)  QSFit.SpecLineGauss  norm    0:Inf                    0   (fixed)                                               
                                         center  3.8e+03:3.8e+03       3826   (fixed)                                               
                                         fwhm    6e+02:1e+04          1e+04   (fixed)                                               
                                         voff    -Inf:Inf                 0   (fixed)                                               
├───────────────────┼─────────────────────┼────────┼─────────────────┼───────────┼───────────┼───────────┼──────────────────────────────────┤
 nuisance7 (fixed)  QSFit.SpecLineGauss  norm    0:Inf                    0   (fixed)                                               
                                         center  3e+03:3.1e+03         3058   (fixed)                                               
                                         fwhm    6e+02:1e+04          1e+04   (fixed)                                               
                                         voff    -Inf:Inf                 0   (fixed)                                               
├───────────────────┼─────────────────────┼────────┼─────────────────┼───────────┼───────────┼───────────┼──────────────────────────────────┤
 nuisance8          QSFit.SpecLineGauss  norm    0:Inf               0.4543     0.1486                                              
                                         center  3.3e+03:3.3e+03       3305      17.86                                              
                                         fwhm    6e+02:1e+04          1e+04                                                         
                                         voff    -Inf:Inf                 0   (fixed)                                               
├───────────────────┼─────────────────────┼────────┼─────────────────┼───────────┼───────────┼───────────┼──────────────────────────────────┤
 nuisance9          QSFit.SpecLineGauss  norm    0:Inf               0.1525    0.08816                                              
                                         center  6e+03:6e+03           6004      3.578                                              
                                         fwhm    6e+02:1e+04            629      326.9                                              
                                         voff    -Inf:Inf                 0   (fixed)                                               
├───────────────────┼─────────────────────┼────────┼─────────────────┼───────────┼───────────┼───────────┼──────────────────────────────────┤
 nuisance10         QSFit.SpecLineGauss  norm    0:Inf              0.06998    0.04715                                              
                                         center  3.7e+03:3.7e+03       3697      5.145                                              
                                         fwhm    6e+02:1e+04           1413       1022                                              
                                         voff    -Inf:Inf                 0   (fixed)                                               
╰───────────────────┴─────────────────────┴────────┴─────────────────┴───────────┴───────────┴───────────┴──────────────────────────────────╯

The best fit model can be displayed using either Gnuplot.jl (to open a plot window):

using Gnuplot
@gp res yrange=[0, 0.25]

or GModelFitViewer.jl (to display the plot in a browser):

using GModelFitViewer
viewer(res)

Also, the best fit parameter values can be accessed for any component with (e.g.):

println("Hb integrated luminosity: ",
        res.bestfit[:Hb_br].norm.val, " +/- ",
        res.bestfit[:Hb_br].norm.unc, " 10^42 erg s^-1")
println("Hb full width at half maximum: ",
        res.bestfit[:Hb_br].fwhm.val, " +/- ",
        res.bestfit[:Hb_br].fwhm.unc, " km/s")
println("Host galaxy lum. density at 5500A: ",
        res.bestfit[:Galaxy].norm.val, " +/- ",
        res.bestfit[:Galaxy].norm.unc, " 10^42 erg s^-1 A^-1")
Hb integrated luminosity: 1.706781347570594 +/- 0.08900754263913427 10^42 erg s^-1
Hb full width at half maximum: 4851.055146231188 +/- 266.55781895084795 km/s
Host galaxy lum. density at 5500A: 0.02373419063512193 +/- 0.001193418112910741 10^42 erg s^-1 A^-1