Skip to content

Conversation

@ajwheeler
Copy link
Owner

This is a rough draft of a fitting routine based on some of the ideas of Bacchus.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 25, 2025

Benchmark Results (Julia v1)

Time benchmarks
main 97fd66b... main / 97fd66b...
synthesis/M dwarf/100 Å of APOGEE w/ water 7.63 ± 0.016 s 7.51 ± 0.0046 s 1.02 ± 0.0022
synthesis/M dwarf/4000 Å - 8000 Å VALD solar 12.5 ± 0.017 s 12.6 ± 0.12 s 0.998 ± 0.0094
synthesis/M dwarf/APOGEE DR17 w/o water 9.69 ± 0.021 s 9.63 ± 0.018 s 1.01 ± 0.0029
synthesis/M dwarf/one wavelength 0.306 ± 0.00066 s 0.306 ± 0.00076 s 1 ± 0.0033
synthesis/sun/100 Å of APOGEE w/ water 0.866 ± 0.0021 s 0.863 ± 0.0023 s 1 ± 0.0037
synthesis/sun/4000 Å - 8000 Å VALD solar 5.92 ± 0.0065 s 5.9 ± 0.015 s 1 ± 0.0028
synthesis/sun/APOGEE DR17 w/o water 4.97 ± 0.013 s 4.94 ± 0.0076 s 1.01 ± 0.0031
synthesis/sun/one wavelength 0.129 ± 0.00039 s 0.128 ± 0.0004 s 1 ± 0.0044
time_to_load 2.81 ± 0.019 s 2.82 ± 0.019 s 0.995 ± 0.0093
Memory benchmarks
main 97fd66b... main / 97fd66b...
synthesis/M dwarf/100 Å of APOGEE w/ water 1.74 M allocs: 3.24 GB 1.74 M allocs: 3.24 GB 1
synthesis/M dwarf/4000 Å - 8000 Å VALD solar 8.62 M allocs: 7.11 GB 8.62 M allocs: 7.11 GB 1
synthesis/M dwarf/APOGEE DR17 w/o water 5.6 M allocs: 5.22 GB 5.6 M allocs: 5.22 GB 1
synthesis/M dwarf/one wavelength 1.15 M allocs: 0.286 GB 1.15 M allocs: 0.286 GB 1
synthesis/sun/100 Å of APOGEE w/ water 1.17 M allocs: 0.238 GB 1.17 M allocs: 0.238 GB 1
synthesis/sun/4000 Å - 8000 Å VALD solar 8.49 M allocs: 2.86 GB 8.49 M allocs: 2.86 GB 1
synthesis/sun/APOGEE DR17 w/o water 5.29 M allocs: 2.17 GB 5.29 M allocs: 2.17 GB 1
synthesis/sun/one wavelength 0.785 M allocs: 0.117 GB 0.785 M allocs: 0.117 GB 1
time_to_load 0.159 k allocs: 11.2 kB 0.159 k allocs: 11.2 kB 1

@ajwheeler ajwheeler mentioned this pull request Aug 8, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Sep 8, 2025

TODOs and @show instances found in this PR:

src/Fit/fit_via_multimethod.jl:8:TODO
src/Fit/fit_via_multimethod.jl:9:TODO don't hardcode Fe / [m/H]
src/Fit/fit_via_multimethod.jl:10:TODO make sure solar abundances are flexible. I think they currently are.
src/Fit/fit_via_multimethod.jl-11-
src/Fit/fit_via_multimethod.jl-12-# Keyword arguments:
src/Fit/fit_via_multimethod.jl-13-
--
src/Fit/fit_via_multimethod.jl:16:# TODO kwarg everything?
src/Fit/fit_via_multimethod.jl-17-"""
src/Fit/fit_via_multimethod.jl-18-function multimethod_abundances(linelist, element, guess, lines_to_fit, obs_flux, obs_wls, R,
src/Fit/fit_via_multimethod.jl-19-                                err=ones(length(obs_flux)); verbose=true,
--
src/Fit/fit_via_multimethod.jl:21:    # TODO check no conflicting R specification
src/Fit/fit_via_multimethod.jl-22-    # check that lines_to_fit are within the range of obs_wls
src/Fit/fit_via_multimethod.jl-23-
src/Fit/fit_via_multimethod.jl:24:    # wavelengths, windows and LSF, TODO refactor
src/Fit/fit_via_multimethod.jl:25:    windows = [(l - 1, l + 1) for l in lines_to_fit] # TODO kwarg
src/Fit/fit_via_multimethod.jl-26-    merged_windows, _ = Korg.merge_bounds(windows, 0.0)
src/Fit/fit_via_multimethod.jl-27-    synthesis_wls, obs_wl_mask, LSF = Korg.Fit._setup_wavelengths_and_LSF(obs_wls,
src/Fit/fit_via_multimethod.jl-28-                                                                          nothing,
--
src/Fit/fit_via_multimethod.jl:64:    # TODO better
src/Fit/fit_via_multimethod.jl:65:    pseudocontinuum_mask = abs.(model_spectra[:, end] - model_spectra[:, 1]) .< 0.01 # TODO kwarg
src/Fit/fit_via_multimethod.jl-66-    model_pseudocontinua = [calculate_pseudocontinuum(obs_wls, m, pseudocontinuum_mask)
src/Fit/fit_via_multimethod.jl-67-                            for m in eachcol(model_spectra)]
src/Fit/fit_via_multimethod.jl-68-    model_pseudocontinua = hcat(model_pseudocontinua...)
--
src/Fit/fit_via_multimethod.jl:134:        # TODO everthing about this is terrible
src/Fit/fit_via_multimethod.jl-135-        firstind = r[1] + length(r) ÷ 2 - 2
src/Fit/fit_via_multimethod.jl-136-        lastind = firstind + 4
src/Fit/fit_via_multimethod.jl-137-        firstind = max(1, firstind)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant