I am in the process of writing a C function for a Particle-In-Cell simulation framework. I am trying to implement a method for simulating photoelectrons. To do so, I need to be able to sample the solar spectrum in vacuum. In other words, if I have N photons, what is an accurate distribution of their frequencies?