The relative spectral power distribution of a CIE D-Illuminant is computed from its chromaticity coordinates. (The chromaticity coordinates may be computed from the correlated color temperature as described here.)
$$S_D (\lambda) = S_0 (\lambda) + M_1 S_1 (\lambda) + M_2 S_2 (\lambda)$$where:
$$M_1 = (-1.3515 - 1.7703 x_D + 5.9114 y_D) / M$$ $$M_2 = (0.0300 - 31.4424 x_D + 30.0717 y_D) / M$$ $$M = 0.0241 + 0.2562 x_D - 0.7341 y_D$$The $S_n (\lambda)$ distributions are provided as a spreadsheet in ZIP format.
Implementation Notes: