So, not only have I gone and followed Fridger's advice to get OpenSUSE, it seems I'm becoming a Perl hacker as well...
A question that's come up a few times in this forum is the colour of the sky on planets orbiting stars different to our Sun. While this has been discussed qualitatively, I decided it might be interesting to do something a bit more quantitative.
The model I'm using is blackbody radiation and Rayleigh scattering. The blackbody spectrum is multiplied by 1/(wavelength^4) to simulate Rayleigh scattering. Absorption lines, multiple scattering, particulates, etc. are not modelled here, because that kind of thing makes the maths difficult.
Plugged the resultant spectrum and the CIE colour matching functions into a quick bit of Perl code to do integration and colour conversion (written with the aid of the code at this site).
The results I got are:
Temperature=3500 K (red dwarf, e.g. Gliese 581)
### Star colour (RGB) = (255,135,63)
### Sky colour (RGB) = (217,237,255)
Temperature=5800 K (yellow dwarf, e.g. Sun)
### Star colour (RGB) = (255,223,211)
### Sky colour (RGB) = (58,120,255)
Temperature=9300 K (A-type star, e.g. Vega)
### Star colour (RGB) = (152,183,255)
### Sky colour (RGB) = (25,79,255)
I personally can't tell much difference between the sky colour for the Sun and Vega, but the sky colour for a planet orbiting a red dwarf is rather grey and washed-out, though still noticeably bluish.
Alien sky colours: a numerical approach
Further results: sky goes white around 3300 K star temperature. Below this, the sky apparently starts turning pinkish yellow.
For example, for T=3000 K, the RGB sky colour is (255,221,179), which looks like this.
On the other hand, increasing the star temperature further beyond Vega just results in the colour going more blue, rather than ending up with violet skies.
For example, for T=3000 K, the RGB sky colour is (255,221,179), which looks like this.
On the other hand, increasing the star temperature further beyond Vega just results in the colour going more blue, rather than ending up with violet skies.
- t00fri
- Developer
- Posts: 8772
- Joined: 29.03.2002
- Age: 22
- With us: 22 years 7 months
- Location: Hamburg, Germany
You did not write whether your OpenSuse installation went fine?
I can really recommend everyone to learn a bit of PERL. It's so tremendously useful and easy to try (an interpreted language!) ...
Did you install the Math::Libm and/or the Math::Trig PERL modules?
Then you can do any kind of sophisticated math calculations very easily as well.
Bye Fridger
I can really recommend everyone to learn a bit of PERL. It's so tremendously useful and easy to try (an interpreted language!) ...
Did you install the Math::Libm and/or the Math::Trig PERL modules?
Then you can do any kind of sophisticated math calculations very easily as well.
Bye Fridger
Yes the OpenSUSE installation went fine, though persuading it to deal with my wireless card was rather more tricky (ended up resorting to ndiswrapper). Haven't installed Celestia on it yet though - probably I will wait until the next version comes out.
Looks like I don't have those modules, thanks for the pointers!
Looks like I don't have those modules, thanks for the pointers!
-
- Posts: 4
- Joined: 03.06.2007
- With us: 17 years 5 months
-
- Posts: 691
- Joined: 13.11.2003
- With us: 21 years
The poster 'Stainless' is working on some software-derived depictions of alien skies; here is the thread concerned.
http://www.bautforum.com/showthread.php?t=60031
He claims to be taking into account Rayleigh scattering, Mie scattering, extinction and something he calls 'sunrise/sunset red shift' which appears to be the way the Sun turns red at low angles and red light is scattered about.
I am very interested to see if you have any comments on Stainless' models; also have you made any visual representations yourself?
http://www.bautforum.com/showthread.php?t=60031
He claims to be taking into account Rayleigh scattering, Mie scattering, extinction and something he calls 'sunrise/sunset red shift' which appears to be the way the Sun turns red at low angles and red light is scattered about.
I am very interested to see if you have any comments on Stainless' models; also have you made any visual representations yourself?
That thread's quite interesting, thanks for the pointer. Stainless is using a more advanced model than myself: I'm just modelling Rayleigh scattering, and not taking into account Mie theory. I haven't tried doing images using my code for two reasons: one, I haven't figured out how to do it (and I'd have to implement more than just Rayleigh scattering), and secondly my computer has intermittent hardware faults which makes everything run really slowly
I did the same thing as Chaos Syndrome a couple of years ago to simulate sky colour. I wrote a Delphi program and I got similar results.
I added another factor into the calculations that Chaos Syndrome has not, and that is the frequency response of the human eye to light. I did this so as to get a more accurate representation of the colour as seen by the human eye. I calculated the frequency response of the human eye in steps of 5 nm and added the results to get the final colour.
There is one thing both of us did that I feel is incorrect. Setting the brightest RGB value to 255 appears to be somewhat adhoc and does not allow for the possibility that the sky colour may be relatively dark. I have no good way to resolve this potential inaccuracy.
I added another factor into the calculations that Chaos Syndrome has not, and that is the frequency response of the human eye to light. I did this so as to get a more accurate representation of the colour as seen by the human eye. I calculated the frequency response of the human eye in steps of 5 nm and added the results to get the final colour.
There is one thing both of us did that I feel is incorrect. Setting the brightest RGB value to 255 appears to be somewhat adhoc and does not allow for the possibility that the sky colour may be relatively dark. I have no good way to resolve this potential inaccuracy.
I based my frequency response of the human eye on the absorption characteristics of the three colour pigments in the human eye.
In each 5-nm slice of the black body spectrum, I multiplied the intensity at that frequency against the frequency responses from a lookup table for each of the three pigments. I added the results of these calculations to produce the RGB values.
I don't know if this is the best method or if there's a much simpler method that produces better results. It does provide a useful way to convert the blackbody spectrum into a colour that we would probably see.
I am not satisfied with the results because it normalises the highest RGB value to 255. Perhaps a better way is to normalise it against the peak of the blackbody curve?
In each 5-nm slice of the black body spectrum, I multiplied the intensity at that frequency against the frequency responses from a lookup table for each of the three pigments. I added the results of these calculations to produce the RGB values.
I don't know if this is the best method or if there's a much simpler method that produces better results. It does provide a useful way to convert the blackbody spectrum into a colour that we would probably see.
I am not satisfied with the results because it normalises the highest RGB value to 255. Perhaps a better way is to normalise it against the peak of the blackbody curve?
My thoughts regarding the normalisation to 255 are that the intensity depends on various factors including thickness and composition of the atmosphere, distance of the planet from the star, etc. Also it depends how you set up your camera (or how far the eye adjusts to light levels!). Normalising to 255 allows comparison of the colours, and means I don't have to worry about all these other unknowns.
Temperature=3500 K (red dwarf, e.g. Gliese 581)
### Star colour (RGB) = (255,135,63)
### Sky colour (RGB) = (217,237,255)
Temperature=5800 K (yellow dwarf, e.g. Sun)
### Star colour (RGB) = (255,223,211)
### Sky colour (RGB) = (58,120,255)
Temperature=9300 K (A-type star, e.g. Vega)
### Star colour (RGB) = (152,183,255)
### Sky colour (RGB) = (25,79,255)
I get different results:
Temperature=3500 K
### Star colour (RGB) = (255,244,109)
### Sky colour (RGB) = (217,255,249)
Temperature=5800 K (yellow dwarf, e.g. Sun)
### Star colour (RGB) = (231,255,214)
### Sky colour (RGB) = (119,145,255)
Temperature=9300 K (A-type star, e.g. Vega)
### Star colour (RGB) = (187,217,255)
### Sky colour (RGB) = (91,108,255)
Given that there is no "correct answer" for the choice of whitepoint and the position of R,G,B in XYZ space, it is not surprising that you have got different values! However your results are not far off mine.
I'll post the xyz colours here (normalisation x+y+z=1), which is probably a more useful comparison.
Star colours are:
3500 K: (xyz)=(0.408, 0.390, 0.202)
5800 K: (xyz)=(0.326, 0.335, 0.339)
9300 K: (xyz)=(0.281, 0.292, 0.427)
Sky colours are:
3500 K: (xyz)=(0.302, 0.321, 0.377)
5800 K: (xyz)=(0.234, 0.241, 0.525)
9300 K: (xyz)=(0.206, 0.196, 0.598)
Nevertheless, Mie scattering apparently introduces some interesting effects on the sky colour: according to the thread linked by eburacum45 earlier in the thread, Mie scattering turns the sky of an M-star planet green, though I haven't verified this myself.
I'll post the xyz colours here (normalisation x+y+z=1), which is probably a more useful comparison.
Star colours are:
3500 K: (xyz)=(0.408, 0.390, 0.202)
5800 K: (xyz)=(0.326, 0.335, 0.339)
9300 K: (xyz)=(0.281, 0.292, 0.427)
Sky colours are:
3500 K: (xyz)=(0.302, 0.321, 0.377)
5800 K: (xyz)=(0.234, 0.241, 0.525)
9300 K: (xyz)=(0.206, 0.196, 0.598)
Nevertheless, Mie scattering apparently introduces some interesting effects on the sky colour: according to the thread linked by eburacum45 earlier in the thread, Mie scattering turns the sky of an M-star planet green, though I haven't verified this myself.