channels_to_rgb#
- scarlet2.plot.channels_to_rgb(channels)[source]#
Get the linear mapping of multiple channels to RGB channels.
Channels are assumed to be ordered by wavelength, shortest first.
Each channel i is treated as occupying the unit interval
[i, i+1]in spectral-index space[0, N]. That space is divided into three equal contiguous bands allocated to B, G, and R:Blue: [0, N/3] Green: [N/3, 2N/3] Red: [2N/3, N]
The weight of channel i in each RGB output is the fractional overlap of
[i, i+1]with the corresponding band. By construction:Column sums equal 1 — 100% of each input channel’s intensity reaches the display (photon conservation).
Row sums all equal N/3 — every RGB output channel receives the same total weight (doubly balanced).
- Parameters:
channels (
int) – Number of channels (any positive integer).- Returns:
Shape
(3, channels)mapping input channels onto RGB.- Return type:
array