Select to view content in your preferred language

Interpolation of a color sequence? - Kriging of cyclic values

1010
4
03-28-2013 05:38 AM
NicolasFüllemann
Emerging Contributor
Hello everyone,

For a few weeks I stay blocked with the same problem. I am trying to do an interpolation (Krigging) of a cyclic color sequence. In my case, this cyclic color sequence has 16 values. for instance, 1 corresponds to dark blue, 5 to violet, 9 to orange,13 to green and 16 to light blue. All other intermediate values are obtained by shading these colors.

My question is: How is it possible to make an interpolation (Krigging) of such a color sequence taking into account that colors are cyclic? In other words, how is it possible that a pixel located between a point having a dark blue color (value of 1) and another having a light blue color (value of 16) gets also a blue color (value of 1 or 16) and not an orange one (value of 😎 ?

An option could maybe be to use the RGB values of the different colors and to do separately the interpolation for the 3 colors (one for the Red, one for the Green and one for the Blue RGB values) and then to combine them again. However, I have no idea if it would work and how to manage at the end to come back to my 16 colors.

Any help or suggestion would be greatly appreciated!

Many thanks in advance,

Nicolas
0 Kudos
4 Replies
NicolasFüllemann
Emerging Contributor
whuber, Thank you very much for your answer, it is a good idea! It should indeed work and seems easy to do, I will try it next week.

Konstantin, thank you as well for your answer. However, doing a reclassification as you propose will not help me since I would like to get a visual result with continuous and cyclic colors.
0 Kudos
NicolasFüllemann
Emerging Contributor
I did today the interpolation using Cosine and Sine and it worked perfectly. Thanks once again for your help.
0 Kudos
DouglasPibal
New Contributor
One way is to express the color as an angle, cokrige the sine and cosine, and recombine the estimates with an arctangent.


My data is hour of the day (0-23) at regular grid points.  I changed them to angles, did the cokrige on the sine and cosine, and now have a raster of interpolated values from -1 to 1.  But how can I "recombine the estimates with an arctangent"?  The arctangent for these values can only output 1/4 of the possible angles (-pi/4 to pi/4).

Thanks for any advice.
0 Kudos
DouglasPibal
New Contributor
Nevermind, I figured out a result:

kriging based on sine, export to raster
kriging based on cosine, export to raster
atan2(sin_raster, cos_raster)

then some conversions
0 Kudos