Converting genssky output to Watts per wavelength band

Is there any guidance on how to convert the radiance values from genssky to units of power? I usually use the assumption of 179 lumens per Watt in Radiance, but that assumes the powers in each channel to have been added or averaged already. Also, I assume that some of the power in that equivalence is outside of the 380-780 nm band and therefore not accounted for in the spectral sky. Ultimately, I’m interested in finding out how much power is present in each wavelength band.

Hi Nathaniel,

This will be a test of the reply function, which I’m now using because the upgrade to the Discourse server no longer supports my browser…

The equation for getting power per wavelength band is pretty simple. Just divide each wavelength value in the pattern by the number of spectral samples and multiply by the associated RGB channel (which should all be the same anyway). For example, the band centered at 390nm from:

void spectrum sunrad
0
0
22 390 770 0.460 0.802 0.827 1.038 1.115 1.110 1.105 1.134 1.139 1.139 1.134 1.109 1.097 1.057 1.049 1.008 0.969 0.939 0.904 0.866

sunrad light solar
0
0
3 7393773.4 7393773.4 7393773.4

is 0.460/20*7393773.4 or about 1.7e5 watts/sr/m^2. You don’t need the 179 lumens/watt conversion, since you never need to convert to lumens.

I realize that most systems specify spectral data in watts/sr/m^2/nm, but this gets confusing when converting between different spectral samplings in my opinion.

Hope this makes sense!

Cheers,
-Greg

Hi @Greg_Ward,

Thanks for the help. So the same would be true of rtrace spectral output, where if the value were previously read as Watts per square meter, then the power in each wavelength band can be found by dividing by the number of bands?

Also, do you mean to say that the bands are named for the center wavelength, rather than the extents? So In your example, the 0.460 value at 390 nm refers to a band from 380nm to 400 nm?

I tried running a test using rtrace -cs 12 -cw 380 580, expecting that this would give me roughly half the power that I get with rtrace -cs 24 -cw 380 780 because it is looking at only half the spectrum (that is to say, roughly the same amount within each wavelength band, but this doesn’t seem to be the case. What am I missing?

Thanks for the help. So the same would be true of rtrace spectral output, where if the value were previously read as Watts per square meter, then the power in each wavelength band can be found by dividing by the number of bands?

Yes, that is basically correct.

Also, do you mean to say that the bands are named for the center wavelength, rather than the extents? So In your example, the 0.460 value at 390 nm refers to a band from 380nm to 400 nm?

Yes. It is a little bit confusing. The scene specifications use centered bandwidth values, but the rendering calculations and spectral output are based on intervals. This is explained better on slide 14 of the SLC workshop presentation here https://www.radiance-online.org/community/workshops/2024-salt-lake-city-ut/presentations-1/T01_WhatsNew2024.pdf. The internal calcs always go from longest to shortest wavelength, and any information outside this range is considered equal to zero. The first interval therefore goes from the longest wavelength to (longest - (longest-shortest)/N) where N is the number of samples given by the -cs option. This is also true of the Radiance hyperspectral radiance (HSR) picture format, which is the one exception on input when using the “specpict” primitive.

I tried running a test using rtrace -cs 12 -cw 380 580, expecting that this would give me roughly half the power that I get with rtrace -cs 24 -cw 380 780 because it is looking at only half the spectrum (that is to say, roughly the same amount within each wavelength band, but this doesn’t seem to be the case. What am I missing?

Well, if you add up all the interval outputs divided by 12 in the first run and 24 in the second run, you should get the expected ratio, unless the light is strongly skewed towards long or short wavelengths. Can you give me some example results?

Cheers,
-Greg

Hi @Greg_Ward,

Okay, I believe I understand my problem now. I was measuring irradiance at an unobstructed sensor aimed at the sky. The -cs 12 -cw 380 580 and -cs 24 -cw 380 780 gave me the same readings in corresponding wavelength bin, but as the first simulation had fewer bins, I was dividing by a smaller number and getting a larger irradiant power per bin. I think the error was that the output from genssky defaults to 380-780 nm, so confining the simulation to a narrower set of wavelengths to rtrace was not decreasing the total irradiance coming from the sky as far as the model was concerned.

So I guess this means that spectral simulations using genssky output should maintain the same wavelength bands that genssky uses, that is -cs 20 -cw 380 780. Is that right? And is there any way to set genssky to output a larger number of wavelength bands, or to get the entire solar spectrum (instead of just the visible portion)?

Yes, that makes sense. The output doesn’t change for the spectral channels as it’s still working from the same input, just over a different range. I suppose the best way to think about the calculation is that the spectral bin flux is per wavelength, but not per nanometer. To get to radiance per nm, you need to divide by the number of calculation bins and the total wavelength range.

In any case, I don’t know how or if genssky can be computed over a different wavelength range or a different number of bins. That’s a question for @taoning_wang1. I see there is an NSSAMP macro in “gen/atmos.h” but there really should be some command-line options to control these parameters. This might have been a “to do” item for later. When I use genssky or gensdaymtx, I always use the same calculation range that they use to avoid issues, but we really should be flexible about it.

-Greg

Yes, I can confirm that it’s on the to-do list.