Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I added the model_selection function, to find the best-fit model spectra and get the conversion from model units to the Gaia flux units. For model selection, I use the AMBRE library from the Pollux database, with temperatures 6000-7750. I have two subfolders with the models:
In this function, we also check for the possible velocity offsets in each branch, which can be used later to correct them.
In the fluxcal_standard_stars and standard_sentitivity functions, I added new inputs: model_list (with the list of best-fit model names) and model_coef (with coefficients to convert the model units to the Gaia units), and the keyword «mode», which can be set as «GAIA» or «model» to choose the version for sensitivity curves calculation. The model_list and model_coef are the outputs from the model_selection function.
If we choose the «model» option (default behaviour in this version), then the standard_sentitivity function will call the calc_sensitivity_from_model function (instead of simply calculating sens = stdflux / spec).
calc_sensitivity_from_model function needs the wavelength array, observed standard spectra fluxes, spectrograph lsf, name of best-fit models, and conversion coefficient (from model to Gaia units). This function reads the best-fit model spectra with good resolution, convolves it with spectrograph LSF, and calculates the sensitivity curve as: sens = model_convolved_spec_lsf * model_to_gaia_median / obs_spec, where model_convolved_spec_lsf - model convolved with spectrograph LSF, model_to_gaia_median- conversion from model to Gaia units, obs_spec - observed standard spectra.