Converting multi channel value to a Radiance value with Radiance command

In Radiance, we can use the following formula to convert 3-channel data (Red, Green, and Blue) into a single Radiance value:

Radiance = 0.265 × Red + 0.670 × Green + 0.065 × Blue

My question is: how can we extend this approach to convert multi-channel data (with more than 3 channels, up to 20) into a single Radiance or luminance value?

Hi Majid,

It is possible to come up with a formula like this for any number of components, which is what rcomb does if you give it spectral input and ask for luminance output (rcomb -C Y) you can get Y from any input. Note that “Y” will apply the appropriate lumens/watt conversion, where as lower case “y” will not. You probably want lower case.

If your goal is to discover the coefficients, then you can give rcomb a series of colors, where you use “1” for the desired coefficient and “0” for all the others. Note that the header should correspond to the desired spectral sampling using the NCOMP and WAVELENGTH_SPLITS settings.

Cheers,
-Greg

Hi Greg,

Thank you so much. As always, what you said is very useful.
So, I created a text file (test.txt) like this:

#?RADIANCE
NCOMP=20
NROWS=20
NCOLS=1
WAVELENGTH_SPLITS=380 480 588 780
FORMAT=ascii

1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1

Then I run this command:
rcomb test.txt -c Y -fa -h

I got this results:
#?RADIANCE
rcomb test.txt -c Y -fa -h
CAPDATE= 2025:07:30 22:05:17
GMT= 2025:07:30 18:35:17
NROWS=20
NCOLS=1
NCOMP=1
FORMAT=ascii

0.0000000e+00
0.0000000e+00
0.0000000e+00
0.0000000e+00
0.0000000e+00
0.0000000e+00
0.0000000e+00
0.0000000e+00
0.0000000e+00
0.0000000e+00
0.0000000e+00
0.0000000e+00
0.0000000e+00
0.0000000e+00
0.0000000e+00
0.0000000e+00
0.0000000e+00
0.0000000e+00
0.0000000e+00
0.0000000e+00

However, if I remove the WAVELENGTH_SPLITS from the header, I got different results.
So I do appreciate it if you can let me know what mistakes did I do?

Best regards,
Majid

Hi Majid,

You are very close. You just need to reverse the wavelength order, i.e.:

WAVELENGTH_SPLITS= 780 588 480 380

The reason is that spectra are always given in long-to-short order, to match RGB ordering. With this change, you should get the results you expect. Again, use “-c y” if you don’t want the 179 lumens/watt multiplier in there.

Best,
-Greg

P.S. You may have copied this improper order from the output of genssky or gensdaymtx, which had this bug in them. It has been corrected in the official 6.0 release.

Hi Greg,

Thank you so much Now everything is clear and works very well.

Best wishes,
Majid