Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

why multiply the angle by the lightness? #5

Open
makemeunsee opened this issue Feb 9, 2015 · 2 comments
Open

why multiply the angle by the lightness? #5

makemeunsee opened this issue Feb 9, 2015 · 2 comments
Labels

Comments

@makemeunsee
Copy link

https://github.com/jradavenport/cubehelix/blob/master/cubehelix.py#L99
Here you use the "fract" array to build the angles array, but "fract" contains the interpolation from minLight to maxLight, and not a simple [0..1] interpolation.
I'm not sure it's a bug but it seems weird enough to raise the question.

@jradavenport
Copy link
Owner

This is a valid point!

This goes back to the original Fortran code that D. A. Green published with his definition of the cubehelix: http://adsabs.harvard.edu/abs/2011arXiv1108.5083G

makemeunsee pushed a commit to makemeunsee/cubehelix that referenced this issue Feb 14, 2015
@makemeunsee
Copy link
Author

No, it's not in the Fortran code. In the Fortran code, the FRACT values always span from 0 to 1, by steps of 1/(NLEV-1), and does not allow to specify a minLight nor a maxLight like in the port. With specified values for minLight and maxLight, the angle value is not making sense anymore in term of hue (0 will not be blue, nor 1 red, etc.) and the behavior will not match that detailed in the documentation of the function.
See my (untested) pull request for a possible fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants