Code papers (please cite these if you use Korg):
- Korg: A Modern 1D LTE Spectral Synthesis Package. This is also a good overview of how spectral synthesis works, the inputs and outputs, etc.
- Korg: fitting, model atmosphere interpolation, and Brackett lines
Tutorials:
using Korg, PyPlot
wls, flux, continuum = synth(
Teff=5000, # effective temperature of 5000 Kelvin
logg=4.32, # surface gravity of 10^(4.32) cm/s²
m_H=-1.1, # metallicity, [m/H]. Overridden for individual elements by alpha_H and individual abundances
C=-0.5, # The Carbon abundance, [C/H]. Works for anything from He to U.
linelist=Korg.get_GALAH_DR3_linelist(),
wavelengths=(5850, 5900)
)
# plot
figure(figsize=(12, 4))
plot(wls, flux, "k-")
xlabel(L"$\lambda$ [Å]")
ylabel(L"$F_\lambda/R_\mathrm{star}^2$ [erg s$^{-1}$ cm$^{-5}$]");
See the documentation for synth
, or the documentation for synthesize
for advanced usage.
See the documentation for setup instructions.
from juliacall import Main as jl
jl.seval("using Korg"); Korg = jl.Korg
# calling Korg.synth is exactly the same as in Julia.
wls, flux, continuum = Korg.synth(
Teff=5000,
logg=4.32,
m_H=-1.1,
C=-0.5,
linelist=Korg.get_GALAH_DR3_linelist(),
wavelengths=(5850, 5900)
)
Korg can use multithreading to speed up line opacity calculation, the most epxensive step for for syntheses.
To use it launch Julia with more than one thread, using the -t
command-line argument, or by setting the $JULIA_NUM_THREADS
environment variable.