Newer
Older
Giorgio Calderone
committed
using QSFit, DataStructures, GFit, Statistics, Dierckx
import QSFit: AbstractSpectralLine, DefaultRecipe, CombinedLine, NarrowLine, BroadLine, BroadBaseLine, ComboBroadLine,
default_options, qso_cont_component, line_component, line_group_name, known_spectral_lines, fit, multi_fit, spectral_coverage
abstract type q1927p654 <: DefaultRecipe end
export q1927p654
function default_options(::Type{T}) where T <: q1927p654
out = default_options(supertype(T))
out[:use_host_template] = true
#out[:host_template] = "S0"
#out[:wavelength_range][1] = 4000
out[:n_unk] = 0
out[:wavelength_range] = [3500., 7200.] # use same range at all epochs
out[:min_spectral_coverage][:OIII_5007] = 0.5 # ensure line is taken into account
function qso_cont_component(::Type{T}) where T <: q1927p654
comp = qso_cont_component(supertype(T))
comp.alpha.low = -5
comp.alpha.high = 5
return comp
end
struct AsymmNarrowLine <: AbstractSpectralLine
λ::Float64
end
line_group_name(::Type{T}, name::Symbol, line::AsymmNarrowLine) where T <: q1927p654 = :NarrowLines
function known_spectral_lines(::Type{T}) where T <: q1927p654
list = OrderedDict{Symbol, AbstractSpectralLine}()
#list[:Lyb ] = CombinedLine( 1026.0 )
list[:Lya ] = CombinedLine( 1215.24 )
list[:NV_1241 ] = NarrowLine( 1240.81 )
list[:OI_1306 ] = BroadLine( 1305.53 )
list[:CII_1335 ] = BroadLine( 1335.31 )
list[:SiIV_1400 ] = BroadLine( 1399.8 )
list[:CIV_1549 ] = CombinedLine( 1549.48 )
#list[:HeII ] = BroadLine( 1640.4 )
#list[:OIII ] = BroadLine( 1665.85 )
#list[:AlIII ] = BroadLine( 1857.4 )
list[:CIII_1909 ] = BroadLine( 1908.734)
list[:CII ] = BroadLine( 2326.0 )
list[:F2420 ] = BroadLine( 2420.0 )
list[:MgII_2798 ] = CombinedLine( 2799.117)
#list[:NeVN ] = NarrowLine( 3346.79 )
list[:NeVI_3426 ] = NarrowLine( 3426.85 )
list[:OII_3727 ] = NarrowLine( 3729.875)
list[:NeIII_3869 ] = NarrowLine( 3869.81 )
#list[:Hd ] = BroadLine( 4102.89 )
Giorgio Calderone
committed
list[:Hg ] = CombinedLine( 4341.68 )
list[:bb_Hg ] = BroadBaseLine( 4341.68 )
list[:OIII_4363 ] = NarrowLine( 4363.00 ) # TODO: Check wavelength is correct
list[:HeII ] = BroadLine( 4686. )
list[:Hb ] = CombinedLine( 4862.68 )
list[:bb_Hb ] = BroadBaseLine( 4862.68 )
list[:OIII_4959 ] = NarrowLine( 4960.295)
list[:OIII_5007 ] = NarrowLine( 5008.240) # AsymmNarrowLine
#list[:OIII_5007_bw] = NarrowLine( 5008.240)
list[:HeI_5876 ] = BroadLine( 5877.30 )
list[:OI_6300 ] = NarrowLine( 6300.00 ) # TODO: Check wavelength is correct
list[:OI_6364 ] = NarrowLine( 6364.00 ) # TODO: Check wavelength is correct
list[:NII_6549 ] = NarrowLine( 6549.86 )
list[:Ha ] = CombinedLine( 6564.61 )
list[:bb_Ha ] = BroadBaseLine( 6564.61 )
list[:NII_6583 ] = NarrowLine( 6585.27 )
list[:SII_6716 ] = NarrowLine( 6718.29 )
list[:SII_6731 ] = NarrowLine( 6732.67 )
function line_component(::Type{T}, line::AsymmNarrowLine) where T <: q1927p654
comp = QSFit.SpecLineAsymmGauss(line.λ)
comp.fwhm.val = 5e2
comp.fwhm.low = 100
comp.fwhm.high = 2e3
comp.voff.low = -1e3
comp.voff.high = 1e3
return comp
end
function line_component(::Type{T}, line::ComboBroadLine) where T <: q1927p654
comp = QSFit.SpecLineAsymmGauss(line.λ)
comp.fwhm.val = 5e3
comp.fwhm.low = 900
comp.fwhm.high = 1.5e4
comp.voff.low = -3e3
comp.voff.high = 3e3
return comp
Giorgio Calderone
committed
include("Recipe_single.jl")
include("Recipe_multi.jl")