Skip to content

Fix potential color rendering error in multifrequency plotting

Lukas Platz requested to merge fix_color_mf_plotting into mf_plotting_refactor

While refactoring the multifrequency plotting, I think I discoverd an error in the wavelength-color mapping.

To test the routine, I created an mf image in which each column contains contribution from only one wavelength. Below are images how the nifty plotting routine in the current NIFTy_8 branch renders this image ("original") and how my (supposedly) fixed routine does ("new_fixed").

original new_fixed

I expect a test image like described to be rendered into the familiar rainbow colors known of visualizations of the visibible light spectrum, but the original RGB mapping instead produces some red, lots of yellow, some turquise, and lots of violet.

The problem seems to be that the original routine first applies the rgb mapping and then the logarithmic "sensitivity" correction, while it should be the other way around. The source branch of this MR contains the code producing the "new_fixed" output.

@mtr @pfrank What do you think? Was the original behavior desireable, or is the new behavior better? I lean towards the latter, if our goal is to map spectral data to the visible spectrum without color distortion.

Merge request reports