Function specsyn::findMatchingSpectra
Defined in File SpecsynUtils.hpp
Function Documentation
-
auto specsyn::findMatchingSpectra(const std::string &spectraName, double fehMin, double fehMax, double afe = tracks::defaultAFe, double cfe = defaultCFe, double microTurb = defaultMicroTurb, double r = defaultR, const std::string ®istryName = defaultRegistry) -> std::pair<std::vector<double>, std::vector<std::string>>
Get list of HDF5 groups containing spectra matching given inputs.
Among the groups in the spectral model’s HDF5 file whose afe, cfe, microTurb (stored as “micro” in the file), and r attributes all match the corresponding input values (a group missing one of these is treated as matching regardless of the corresponding input value), this returns the minimal bracketing subset whose feh values encompass [fehMin, fehMax] – that is, the largest available feh <= fehMin (or the smallest available feh, if none is <= fehMin) through the smallest available feh >= fehMax (or the largest available feh, if none is >= fehMax), inclusive – mirroring TrackUtils::findMatchingTracks’s identical bracketing behavior (see its own comment for why: a query point exactly at fehMin or fehMax, or a caller like SpecsynLibChained that passes a star population’s own [Fe/H] range straight through, still needs a real bracketing grid point on each side to interpolate from, not just whatever feh values happen to fall strictly inside [fehMin, fehMax]). The returned vectors are sorted by increasing [Fe/H].
- Parameters:
spectraName – Name of the spectral model
fehMin – Minimum [Fe/H] value
fehMax – Maximum [Fe/H] value
afe – Value of [alpha/Fe]
cfe – Value of [C/Fe]
microTurb – Microturbulent velocity, in km/s
r – Spectral resolution
registryName – Name of the spectral library registry file
- Returns:
A pair consisting of a vector of [Fe/H] values and corresponding group names