Function phot::vegaSpectrum
Defined in File VegaSpectrum.hpp
Function Documentation
-
inline auto phot::vegaSpectrum(const std::string &vegaName = defaultVegaSpec) -> std::pair<const std::vector<double>&, const std::vector<double>&>
Return the global Vega reference spectrum.
The VegaSpectrum instance is a function-local static, so it is constructed on first use rather than before main() begins, and is shared by every caller for the remaining lifetime of the program (the same lazy construct-once model used by utils::uniqueID()/utils::rng()). This means vegaName only has any effect on the very first call to this function anywhere in the program; every later call, regardless of what vegaName it is given, returns the spectrum already loaded by that first call. A caller that needs a non-default Vega file must therefore call this function with that vegaName before anything else in the program can call it with the default (see SimControls::readFilters()). Not marked [[nodiscard]]: unlike VegaSpectrum::spectrum(), a caller is sometimes deliberately calling this only to force that first, file-selecting construction, with no use for the returned spectrum itself.
- Parameters:
vegaName – Name of the HDF5 file holding the Vega reference spectrum; only has any effect the first time this function is called anywhere in the program – see below
- Returns:
The same pair VegaSpectrum::spectrum() returns