Full Index

FormationTemps.AtmosphereGPUMethod
AtmosphereGPU(atm_korg)

Construct an AtmosphereGPU with thermodynamic fields from Korg and velocity fields allocated on the GPU.

source
FormationTemps.StellarPropsMethod
StellarProps(; Teff=NaN, logg=NaN, Fe_H=NaN, vsini=0.0, v_macro=NaN, v_micro=NaN,
              ρstar=1.0, istar=90.0)

Container for stellar parameters and broadening properties used by FormationTemps.

Keyword arguments:

  • Teff: effective temperature (K).
  • logg: log10 surface gravity (cgs).
  • Fe_H: metallicity [Fe/H] (dex), used to build A_X.
  • vsini: projected rotation velocity (m/s).
  • v_macro: macroturbulent velocity (m/s); if NaN, uses vmac_fit(Teff, logg).
  • v_micro: microturbulent velocity (m/s); if NaN, uses vmic_fit(Teff).
  • ρstar: stellar radius scale factor for disk integration (dimensionless).
  • istar: inclination angle in degrees (90 = equator-on).
source
FormationTemps.calc_formation_tempMethod
calc_formation_temp(star, linelist; use_gpu=GPU_DEFAULT, Δλ=0.01, convolve=false,
                    minλ=NaN, maxλ=NaN, u1=NaN, u2=NaN, Nϕ=128, kwargs...)

Compute flux formation temperatures, normalized flux, and flux contribution function for a given star and linelist.

The wavelength grid is built from the line list (wl * 1e8) with padding and step Δλ. Use minλ/maxλ (Angstrom) to override the default bounds (first/last line ± 2 A).

Returns a FormTempResult with fields:

  • wavs: wavelength grid (Angstrom).
  • flux: normalized flux (sum(cfunc_dt_flux) / sum(cfunc_dt_flux_cont)).
  • form_temps: formation temperature defined at 50% of the cumulative flux contribution.
  • cont_func: contribution function, shape (Natm - 1, Nλ).
  • atmosphere: atmosphere structure used for the calculation.

If convolve=true, applies Hirano rotation + macroturbulent convolution using limb-darkening coefficients u1 and u2. Otherwise, performs numerical disk integration using latitude bins. Set use_gpu=true to use the GPU implementation when available.

Examples

star = StellarProps(Teff=5777.0, logg=4.44, Fe_H=0.0, vsini=2100.0)
linelist = Korg.read_linelist(joinpath(FT.datdir, "Sun_VALD.lin"))[1:500]
result = calc_formation_temp(star, linelist; Δλ=0.01, convolve=true, u1=0.43, u2=0.31)
source
FormationTemps.convolve_hirano_rotmacroMethod
convolve_hirano_rotmacro(xs, ys, vsini, ζ_rt, u1, u2; intres=intres_glob)

Convolve a spectrum with the Hirano et al. (2011) rotation+macroturbulence kernel.

TODO: finish docs.

source
FormationTemps.convolve_rt_macroMethod
convolve_rt_macro(xs, ys, ζ_rt, μ)
convolve_rt_macro(xs, ys, ζ_r, ζ_t, μ)

Convolve a spectrum with a radial-tangential macroturbulence kernel.

TODO: finish docs.

source
FormationTemps.elavMethod
elav(a::AbstractVector)
elav(a; dims)

Compute midpoints between adjacent elements along dims.

TODO: finish docs.

source
FormationTemps.rebin_spectrumMethod
rebin_spectrum(xs_old, ys_old, xs_new)
rebin_spectrum(xs_old, ys_old, σs_old, xs_new)

Rebin a spectrum (and optional uncertainties) from xs_old to xs_new.

Based on the SpectRes spectral resampling implementation: https://github.com/ACCarnall/SpectRes/blob/master/spectres/spectral_resampling.py

Note: the algorithm may introduce small shifts if the wavelength grids are misaligned.

source
FormationTemps.vmac_fitMethod
vmac_fit(teff, logg)
vmac_fit(teff)

Empirical macroturbulent velocity fits.

vmac_fit(teff, logg) uses the Doyle et al. (2014) relation with teff in K and logg in cgs. vmac_fit(teff) uses the Bruntt et al. (2010) relation with teff in K. Both return the macroturbulent velocity in m/s.

source
FormationTemps.vmic_fitMethod
vmic_fit(teff)

Empirical microturbulent velocity fit from Bruntt et al. (2010).

Input teff is in K; returns microturbulent velocity in m/s.

source