FormationTemps.jl wraps Korg.jl to produce model spectra and formation temperatures given fundamental stellar parameters and a linelist as input. We encourage users to read the paper that presents FormationTemps.jl. The scripts used to generate the plots and other quantitative results presented therein can be found in the scripts/ directory of the GitHub repo.
FormationTemps.jl is written entirely in Julia and requires Julia v1.12 or greater. Installation instructions for Julia are available from julialang.org.
To install FormationTemps.jl from the Julia REPL:
using Pkg
Pkg.add("FormationTemps")
using FormationTempsAlternatively, if you'd like to tinker with the source of FormationTemps.jl, you can clone the repo from GitHub and add it in develop mode:
using Pkg
Pkg.develop(path="/path/to/FormationTemps.jl")To compute a basic formation temperature spectrum:
using Korg
using PyPlot
using FormationTemps; FT = FormationTemps
# get the linelist
linelist = Korg.read_linelist(joinpath(FT.datdir, "Sun_VALD.lin"))[16000:16100]
# set stellar parameters
Teff = 5777.0
logg = 4.44
A_X = Korg.asplund_2020_solar_abundances
Fe_H = 0.0
vsini = 2100.0
ζ_RT = 3400.0 # radial-tangential macroturbulent broadening
ξ = 850.0 # microturbulent broadening
# create StellarProps composite type to hold everything
star_props = StellarProps(Teff=Teff, logg=logg, Fe_H=Fe_H,
vsini=vsini, v_macro=ζ_RT, v_micro=ξ)
# get the flux + formation temperature spectra
form_temp_result = FT.calc_formation_temp(star_props, linelist; Δλ=0.01)
# parse the result
wavs = form_temp_result.wavs
flux = form_temp_result.flux
temp = form_temp_result.form_temps
# plot the result
fig, ax1 = plt.subplots()
ax1.plot(wavs, temp, c="k")
ax1.set_xlabel("Vacuum Wavelength [Å]")
ax1.set_ylabel("Formation Temperature [K]")
plt.show()More detail on the above example can be found in the Basic Tutorial and the high-level API documentation.
Warning
Calling FormationTemps.jl from Python is currently somewhat fragile and a work in progress.
FormationTemps.jl can be called from Python. The instructions can be found in the Python Tutorial.
Caution
Users should be aware of the technical and "philosophical" discussion on formation temperatures in Sections 4.2 and 4.3 of the paper presenting FormationTemps.jl.
In brief:
- Formation temperatures are modeled and not measured quantities
- The definition/concept of a formation temperature can belie some realities of radiative transfer (see the contribution function comparison in the relevant tutorial)
- Korg.jl only assumes LTE, and the MARCS model atmospheres used by default do not have chromospheres
- The model atmospheres are 1D, and do not handle the effects of convection (limb shift, line asymmetry, etc.) or magnetism
If you use FormationTemps.jl in your research, please cite the relevant software release and paper. The cffconvert tool can be used to generate a bibtex entry from the included CITATION.cff (or just use the "cite this repository" button on the GitHub sidebar).
This repo is maintained by Michael Palumbo. You may may contact him via his email - mpalumbo@flatironinstitute.org
