gollum
gollum copied to clipboard
Interpolating between points on a model grid
This is partly a feature request but also partly an example of how this might be done.
You can load a grid of models, for example PHOENIX models like so
grid = PHOENIXGrid(wl_lo=wave_range[0], wl_hi=wave_range[1], path=path_to_pheonix_models, teff_range=[8000, 11000], logg_range=[3.5, 5.0], metallicity_range=[-0.5,0.5])
which you can then fit with the dashboard (for example see this Tutorial https://gollum-astro.readthedocs.io/en/latest/tutorials/gollum_demo_Sonora_and_BDSS.html).
grid.show_dashboard(data=std_spec)
While (as far as I know) there is no current implementation of interpolating between models on a grid, I found I could load two models and combine them, given a chosen fraction of how much to use from each. In the following example, I combine two PHOENIX model synthetic spectra which are identical, but one has a log g=4.5 and the other has log g =5.0, into one and then proceed to process and normalize it:
synth_spec_uno = PHOENIXSpectrum(path=path_to_pheonix_models, wl_lo=wave_range[0], wl_hi=wave_range[1],
teff=10000, logg=4.5, metallicity=-0.5)
synth_spec_dos = PHOENIXSpectrum(path=path_to_pheonix_models, wl_lo=wave_range[0], wl_hi=wave_range[1],
teff=10000, logg=5.0, metallicity=-0.5)
uno_fraction = 0.55
dos_fraction = 1.0 - uno_fraction
synth_spec = synth_spec_uno * uno_fraction + synth_spec_dos * dos_fraction
synth_spec = synth_spec.normalize(percentile=90.0)
synth_spec = synth_spec.rotationally_broaden(15.0)
synth_spec = synth_spec.rv_shift(25.0)
Something like this could form the basis for interpolating between points on a model grid to generate synthetic spectra with stellar parameters with values between grid points. In the meantime, the above example I have seems to work, for anyone who needs this functionality.