If a stellar parameter value is the same as the max or min value of the provided model atmospheres, it is not possible to find all bracketing models.
For example, if you want to interpolate around logg = 5.0 there are no model atmospheres with logg higher than that.
The program raises an error and does not proceed to generate a spectrum for this set of parameters.
If it is absolutely necessary to get models that follow the pattern provided by Turbospectrums interpolator, this solution is correct. Otherwise, the function could be changed to get the closest model with the same value. It would not follow the pattern, but a model atmosphere would be interpolated.
If a stellar parameter value is the same as the max or min value of the provided model atmospheres, it is not possible to find all bracketing models.
For example, if you want to interpolate around logg = 5.0 there are no model atmospheres with logg higher than that.
The program raises an error and does not proceed to generate a spectrum for this set of parameters.
If it is absolutely necessary to get models that follow the pattern provided by Turbospectrums interpolator, this solution is correct. Otherwise, the function could be changed to get the closest model with the same value. It would not follow the pattern, but a model atmosphere would be interpolated.