Commit 585fa849 authored by Giorgio Calderone's avatar Giorgio Calderone
Browse files

Updated

parent db1a9ab4
Loading
Loading
Loading
Loading
+4 −19
Original line number Diff line number Diff line
@@ -52,10 +52,9 @@ res = qsfit(source);
viewer(res, showcomps=[:qso_cont, :galaxy, :balmer],
       filename="$(path)/results_boller.html")
println(res.model[:OIII_5007].norm.val )
# 0.0002913095378291511
# 0.0002904273540659144
println(res.model[:OIII_5007].norm.val / res.model[:galaxy].norm.val )
# 61.34678931179987

# 60.25349678748317


if !isfile("$(path)/scale_fwhm.dat")
@@ -156,24 +155,10 @@ for loop in 1:Nloop
        viewer(res, showcomps=[:qso_cont, :galaxy, :balmer], filename="$(path)/results_$(job)_$(loop).html")
        viewer(res, showcomps=[:qso_cont, :galaxy, :balmer], filename="$(path)/results_$(job)_$(loop)_rebin4.html", rebin=4)

        # Find best normalization for [OIII]
        multi2 = deepcopy(res.multi);
        for id in 1:length(chosen_epochs)
            for cname in collect(keys(multi2[id]))
                if cname == :OIII_5007
                    multi2[id][cname].norm.fixed = false
                    multi2[id][cname].fwhm.fixed = true  # degenerate with norm
                else
                    freeze(multi2[id], cname)
                end
            end
        end
        bestfit2 = fit!(res.source, multi2, res.pspecs)
        
        OIII_norm = fill(0., length(chosen_epochs))
        for id in 1:length(chosen_epochs)
            OIII_norm[id] = multi2[id][:OIII_5007].norm.val
            all_scale[chosen_epochs[id]] *= ((1 + multi2[id][:OIII_5007].norm.val) / 2)
            OIII_norm[id] = res.multi[id][:OIII_5007].norm.val
            all_scale[chosen_epochs[id]] *= res.multi[id][:OIII_5007].norm.val
        end
        JLD2.jldsave(file; res, all_scale, OIII_norm)
    else