Skip to content

palumbom/FormationTemps.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

167 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FormationTemps.jl

Stable Dev Build Status arXiv

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.

Installation

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 FormationTemps

Alternatively, 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")

Basic Julia Example

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()

formation_temps

More detail on the above example can be found in the Basic Tutorial and the high-level API documentation.

Calling FormationTemps.jl from Python

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.

Caveats

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

Citation

DOI arXiv

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).

Author & Contact

GitHub followers

This repo is maintained by Michael Palumbo. You may may contact him via his email - mpalumbo@flatironinstitute.org

About

Model formation temperatures for stellar spectra

Topics

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •