Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions data/linelists/GES/save_pruned_GES_linelist.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using Korg

linelist = Korg.get_GES_linelist()
A_X = format_A_X()
teff_loggs = [(6000, 4), (3000, 5), (4000, 2)]
atms = map(teff_loggs) do (Teff, logg)
interpolate_marcs(Teff, logg, A_X)
end
wls = Korg.Wavelengths(linelist[1].wl, linelist[end].wl)

all_pruned = map(atms) do atm
@time Korg.prune_linelist(atm, linelist, A_X, wls;
threshold=1e-6, sort_by_EW=false, max_distance=10)
end

pruned = sort(unique([all_pruned...;]); by=l -> l.wl)
println(length(pruned) / length(linelist), " of the GES linelist was retained.")

using PyPlot

map(atms, teff_loggs) do atm, (Teff, logg)
figure(; figsize=(12, 5))
@time spec1 = synthesize(atm, linelist, A_X, wls)
@time spec = synthesize(atm, pruned, A_X, wls)
title("Teff = $Teff, logg = $logg")
plot(spec.wavelengths, (spec.flux - spec1.flux) ./ spec.cntm)
ylabel("rect flux residuals")
xlabel("Wavelength (Å)")
savefig("GES_pruned_T_$(Teff)_logg_$(logg).png")
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
end
end

Loading