Planetary magnitudes Calculator - update
Planetary magnitudes Calculator - update
I figure that one good way to learn about scripting would be to come up with one of my own, but I'll ask first - would it be theoretically possible to come up with a celx script that would display the apparent magnitude of a planet (currently not supported in Celestia's core code) from the observer's position?
The equations to do this can be found here:
http://www.answers.com/topic/absolute-magnitude
(about halfway down).
If it is possible then I'll see if I can figure out how to do a script for this (if one isn't out there already). If it's not possible, then someone let me know and I can use my time for other things
I guess one possible limitation is whether or not there's a way for a script to return the Phase Angle between the observer-sun-object.
The equations to do this can be found here:
http://www.answers.com/topic/absolute-magnitude
(about halfway down).
If it is possible then I'll see if I can figure out how to do a script for this (if one isn't out there already). If it's not possible, then someone let me know and I can use my time for other things
I guess one possible limitation is whether or not there's a way for a script to return the Phase Angle between the observer-sun-object.
Last edited by Malenfant on 01.11.2005, 06:33, edited 2 times in total.
Re: Planetary magnitudes
Malenfant wrote:I guess one possible limitation is whether or not there's a way for a script to return the Phase Angle between the observer-sun-object.
Since CELX provides access to the xyz coordinates of the observer, the planet, and its sun(s), and Lua provides a math library with all the usual trig functions, it should indeed be possible to compute the phase angle(s).
- Hank
Update: I've got the basic number crunching sorted out (just about. Got a question though that I've posted on the Astronomy board). Now it's just a matter of getting the formatting of what is displayed sorted out... but it's close to being done.
I may write some wiki articles once I've got everything solidified in my mind.
I may write some wiki articles once I've got everything solidified in my mind.
-
- Posts: 164
- Joined: 18.03.2004
- Age: 63
- With us: 20 years 8 months
- Location: Victoria, BC Canada
I just suffered a Catastrophic Razing And Systemic Halt, courtesy of our benevolent dictator, Mr. Gates. So I've been tied up rebuilding my XP environment.
As soon I get things back in working order, I'll be checking out your script. . In the meantime, congrats on getting your script going.
BTW: if you don't already do full backups, look into a utility called ERUNT. It's a lot like the Windows 9x utility ERU. I wish I'd had it 24 hours ago.
As soon I get things back in working order, I'll be checking out your script. . In the meantime, congrats on getting your script going.
BTW: if you don't already do full backups, look into a utility called ERUNT. It's a lot like the Windows 9x utility ERU. I wish I'd had it 24 hours ago.
Clive Pottinger
Victoria, BC Canada
Victoria, BC Canada
http://www.lpl.arizona.edu/~rhill/alpo/ ... em2005.htm
29/10/2005 => -2.3 mag
planmag.celx
29/10/2005 => -1.9 mag
29/10/2005 => -2.3 mag
planmag.celx
29/10/2005 => -1.9 mag
windows 10 directX 12 version
celestia 1.7.0 64 bits
with a general handicap of 80% and it makes much d' efforts for the community and s' expimer, thank you d' to be understanding.
celestia 1.7.0 64 bits
with a general handicap of 80% and it makes much d' efforts for the community and s' expimer, thank you d' to be understanding.
symaski62 wrote:http://www.lpl.arizona.edu/~rhill/alpo/marstuff/ephems/ephem2005.htm
29/10/2005 => -2.3 mag
planmag.celx
29/10/2005 => -1.9 mag
OK, I'm not going to explain this in french, it's too complicated .
Yes, I know the results are different to what's predicted. I have no idea how they calculate the "official" magnitudes that appear in almanacs, observer handbooks and astronomy magazines. The equation used in the script is taken from the wiki webpage and is explicitly stated to be an approximation - it assumes a Lambertian surface (and ideal diffuse reflecting sphere), which is not what real planets are. So you WILL get different values (sometimes they'll be VERY different). If you read what I say above you'll see I'm already investigating this - this is why I want to track down the Phase Integrals.
I'm trying to figure out how to make it more realistic but I don't seem to be getting anywhere with it right now. I suspect I'd have to actually ask the people who compile the original ephemerides and planetary data for the almanacs, but I have to find who they are first...
I've found someone who seems to be directly involved in the visual magnitude calculations in the USNO astronomical almanac! I've fired off an email to him, hopefully I'll hear back next week.
Meanwhile, keep in mind that the results of this script are NOT accurate. Hopefully he'll be able to send me some correct equations to use...
(if anyone has access to it, the guy I've got in touch with wrote an interesting paper on this for the Astronomical Journal, vol 129, pg 2902-2905, 2005. It only covers Mercury and Venus though. He provides a more accurate equation to calculate Venus' apparent magnitude, which makes it about 0.1 magnitudes brighter than the books say it is right now ).
Meanwhile, keep in mind that the results of this script are NOT accurate. Hopefully he'll be able to send me some correct equations to use...
(if anyone has access to it, the guy I've got in touch with wrote an interesting paper on this for the Astronomical Journal, vol 129, pg 2902-2905, 2005. It only covers Mercury and Venus though. He provides a more accurate equation to calculate Venus' apparent magnitude, which makes it about 0.1 magnitudes brighter than the books say it is right now ).
First, I've taken down the script I posted here earlier - it needs a lot of corrections now.
But the good news is that James Hilton (the guy from USNO) got back to me and pointed me in the right direction - I got hold of a copy of the Explanatory Supplement for the Astronomical Almanac and it has all the phase functions for the planets (and a lot of moons too).
The equations on the wikipedia page are completely wrong too. The annoying thing is that there doesn't seem to be an equation now that does work that can calculate the Absolute Magnitudes - it's all empirically determined. Might have to fudge something up for any extrasolar/fictional planets.
And I have no idea what happens to magnitude when a planet is illuminated by multiple suns...
But still, I've got enough to go on now to seriously update the script and make it realistic. The results that the updated script yields should closely match the "official" values, since the Almanac is the source .
But the good news is that James Hilton (the guy from USNO) got back to me and pointed me in the right direction - I got hold of a copy of the Explanatory Supplement for the Astronomical Almanac and it has all the phase functions for the planets (and a lot of moons too).
The equations on the wikipedia page are completely wrong too. The annoying thing is that there doesn't seem to be an equation now that does work that can calculate the Absolute Magnitudes - it's all empirically determined. Might have to fudge something up for any extrasolar/fictional planets.
And I have no idea what happens to magnitude when a planet is illuminated by multiple suns...
But still, I've got enough to go on now to seriously update the script and make it realistic. The results that the updated script yields should closely match the "official" values, since the Almanac is the source .
Not sure if anyone even cares about my progress with this, but I'll keep going anyway...
I'm now using phase functions from the USNO Astronomical Almanac. This are, as far as I can tell, the reference for every other astronomical publication out there. So the values calculated here will agree with official sources.
Apparent magnitude of planets is calculated by:
V = 5log(r.d) + V(1,0) + Dm(i)
V(1,0) + Dm(i) is the phase function. r is the distance of the planet from the sun in AU, and d is the distance of the planet from the Earth (the observer is assumed to be on Earth here). V(1,0) is the absolute magnitude of the planet - the magnitude of a body seen at a distance of 1 AU from both the Sun and the Earth and at a phase angle of 0 degrees (thinking about this will reveal that this is not actually physically possible. I think it's the equivalent of putting the planet at 1 AU and looking at it from the centre of the sun)
Dm(i) is either of the form X(i/100) + Y(i/100)^2 + Z(i/100)^3 for Mercury or Venus, or X.i for planets outside Earth's orbit (X,Y,Z are constants, and i is the phase angle). The reason for this difference is that we can see Mercury and Venus going through all their phases (ie we see them at all phase angles) but we only see the outer planets close to a phase angle of 0 since we just seem them nearly fully illuminated by the sun. What this means is that the full phase functions for the outer planets is not known, because we only see them at low phase angles. A linear approximation works for them when viewed from Earth, but we have no idea how the phase function varies at higher phase angles for them.
I've updated the phase functions for the planets in the script now, but there are three significant problems:
1) I don't have phase functions for most of the satellites or any of the asteroids.
2) More importantly, the phase functions are defined empirically - using observational data. This means that (a) there isn't a phase function for Earth itself and (b) the phase functions for the outer planets is only defined for small phase angles. So if our viewpoint moves from Earth to somewhere else where we can see those planets at higher phase angles (eg crescents, half-full) then we may not get accurate results if the phase function isn't actually linear at those angles (for all I know, all planets should technically have phase functions that look like the ones for Mercury and Venus). I know that some spacecraft have taken images of the outer planets at higher phase angles, but I'm not sure if anyone's used these to extend the phase functions... I'll try to look into that.
3) There's no general equation to figure all this out. Even the V(1,0) value is determined by observation, not by calculation. That said, the equation for Absolute Magnitude that is in the wikipedia article seems to work fairly well for the Jovians in our own solar system. It goes rather askew for terrestrial worlds though. But at least we may be able to use that equation to find V(1,0) for extrasolar jovians.
I'm now using phase functions from the USNO Astronomical Almanac. This are, as far as I can tell, the reference for every other astronomical publication out there. So the values calculated here will agree with official sources.
Apparent magnitude of planets is calculated by:
V = 5log(r.d) + V(1,0) + Dm(i)
V(1,0) + Dm(i) is the phase function. r is the distance of the planet from the sun in AU, and d is the distance of the planet from the Earth (the observer is assumed to be on Earth here). V(1,0) is the absolute magnitude of the planet - the magnitude of a body seen at a distance of 1 AU from both the Sun and the Earth and at a phase angle of 0 degrees (thinking about this will reveal that this is not actually physically possible. I think it's the equivalent of putting the planet at 1 AU and looking at it from the centre of the sun)
Dm(i) is either of the form X(i/100) + Y(i/100)^2 + Z(i/100)^3 for Mercury or Venus, or X.i for planets outside Earth's orbit (X,Y,Z are constants, and i is the phase angle). The reason for this difference is that we can see Mercury and Venus going through all their phases (ie we see them at all phase angles) but we only see the outer planets close to a phase angle of 0 since we just seem them nearly fully illuminated by the sun. What this means is that the full phase functions for the outer planets is not known, because we only see them at low phase angles. A linear approximation works for them when viewed from Earth, but we have no idea how the phase function varies at higher phase angles for them.
I've updated the phase functions for the planets in the script now, but there are three significant problems:
1) I don't have phase functions for most of the satellites or any of the asteroids.
2) More importantly, the phase functions are defined empirically - using observational data. This means that (a) there isn't a phase function for Earth itself and (b) the phase functions for the outer planets is only defined for small phase angles. So if our viewpoint moves from Earth to somewhere else where we can see those planets at higher phase angles (eg crescents, half-full) then we may not get accurate results if the phase function isn't actually linear at those angles (for all I know, all planets should technically have phase functions that look like the ones for Mercury and Venus). I know that some spacecraft have taken images of the outer planets at higher phase angles, but I'm not sure if anyone's used these to extend the phase functions... I'll try to look into that.
3) There's no general equation to figure all this out. Even the V(1,0) value is determined by observation, not by calculation. That said, the equation for Absolute Magnitude that is in the wikipedia article seems to work fairly well for the Jovians in our own solar system. It goes rather askew for terrestrial worlds though. But at least we may be able to use that equation to find V(1,0) for extrasolar jovians.
-
- Posts: 164
- Joined: 18.03.2004
- Age: 63
- With us: 20 years 8 months
- Location: Victoria, BC Canada
Wow
Who would have thought it would be so complicated. I would have thought the variables would simply be a) the absolute magnitude, b) the distance from the sun, c) the phase angle and d) the distance from the planet.
I'm still not sure why there are different phase functions for each of the planets. A reflecting ball is a reflecting ball is a reflecting ball. The absolute magnitude should account for the albedo, any differences in colour, reflectivity, etc.
The only other factors I could see coming into it are the planetography - different amounts of light reflected from one area as opposed to another, and the oblateness. Both of these should have very minor effects for the major planets though.
(Personally, I think these scientists just complicate things to keep us laypeople on the outside. Come on! Who's with me for simplifying pi to 3.0, using circular orbits, and changing all these trigonometric curves to linear functions? Think about it - if we did, we could hack so much extraneous code out of Celestia that it could be loaded as a Java applet and run on your cell phone! )
Back to reality...
Did your contact give a reason for the need for separate phase functions? Why doesn't the equation for Mercury work for Venus, etc? I would be interested in knowing.
Who would have thought it would be so complicated. I would have thought the variables would simply be a) the absolute magnitude, b) the distance from the sun, c) the phase angle and d) the distance from the planet.
I'm still not sure why there are different phase functions for each of the planets. A reflecting ball is a reflecting ball is a reflecting ball. The absolute magnitude should account for the albedo, any differences in colour, reflectivity, etc.
The only other factors I could see coming into it are the planetography - different amounts of light reflected from one area as opposed to another, and the oblateness. Both of these should have very minor effects for the major planets though.
(Personally, I think these scientists just complicate things to keep us laypeople on the outside. Come on! Who's with me for simplifying pi to 3.0, using circular orbits, and changing all these trigonometric curves to linear functions? Think about it - if we did, we could hack so much extraneous code out of Celestia that it could be loaded as a Java applet and run on your cell phone! )
Back to reality...
Did your contact give a reason for the need for separate phase functions? Why doesn't the equation for Mercury work for Venus, etc? I would be interested in knowing.
Clive Pottinger
Victoria, BC Canada
Victoria, BC Canada
cpotting wrote:Who would have thought it would be so complicated. I would have thought the variables would simply be a) the absolute magnitude, b) the distance from the sun, c) the phase angle and d) the distance from the planet.
Well, you're right, and they are - those are the values that vary for each planet . In the equation, Absolute magnitude is V(1,0), distance from the sun is r, and distance from the planet is d. What's different are the constants that they are multiplied by - which are in the phase function Dm(i).
I'm still not sure why there are different phase functions for each of the planets. A reflecting ball is a reflecting ball is a reflecting ball.
Hate to tell you this, but nope.
This all goes back to photometry - the way an object/surface reflects and scatters light. Celestia doesn't handle this realistically at all - to illustrate this have a look at the full moon in Celestia. You'll notice that it's brightest at the subsolar point and dims around the edges? Now compare that with how the full moon really looks - you'll see that the real moon doesn't get dimmer around the edges, and that actually (surface variation notwithstanding) it's the same brightness throughout the lit hemisphere. The brightness of the moon doesn't change with distance from the sub-solar point.
You can also see this by looking at photos from the surface of the moon. If you look at photos taken with the sun directly behind the astronaut you'll see that there's a lot of glare - the ground is brightest directly ahead of the astronaut's shadow. That's because the lunar regolith is strongly back-scattering - photons bounce back off it in the direction they came from.
Atmospheres also scatter light in odd ways (next time you're in an aeroplane flying over clouds, take a look at how they reflect the sunlight).
All of these factors are different for each planet, and are subsumed into the Dm(i) function.
The absolute magnitude should account for the albedo, any differences in colour, reflectivity, etc.
It does. But remember, the absolute magnitude is the (theoretical) magnitude of the object at zero phase angle, at a distance of 1 AU from both sun and earth. the 5log(rd) term tells us how that changes with real distance, and the Dm(i) term tells us how that changes when the phase angle isn't zero.
The only other factors I could see coming into it are the planetography - different amounts of light reflected from one area as opposed to another, and the oblateness. Both of these should have very minor effects for the major planets though.
There's about two pages of text explaining about oblateness in the chapter from the Explanatory Supplement that I'm using for all this - it changes the size of the disk seen from Earth. Surface variations also do change the visible magnitude - the surface markings on Mars (and dust storms) for example can cause a variation of up to 0.25 magnitudes.
(Personally, I think these scientists just complicate things to keep us laypeople on the outside. Come on! Who's with me for simplifying pi to 3.0, using circular orbits, and changing all these trigonometric curves to linear functions? Think about it - if we did, we could hack so much extraneous code out of Celestia that it could be loaded as a Java applet and run on your cell phone! )
*Slapslapslap* Get a grip man, science is supposed to be complicated!
Did your contact give a reason for the need for separate phase functions? Why doesn't the equation for Mercury work for Venus, etc? I would be interested in knowing.
See above . It's all down to photometry - Venus' atmosphere reflects light in a different way to the regolith on the surface of Mercury. For example:
V(1,0) for Mercury: -0.60
V(1,0) for Venus: -4.40
(these values are the most up-to-date. In fact, they're not even used in the almanac yet, but they will be from next year so they give slightly different (but much more realistic) results to the official ones we know today).
Dm(i) for Mercury: 4.98(i/100) - 4.88(i/100)^2 + 3.02(i/100)^3
Dm(i) for Venus: 1.03(i/100) + 0.57(i/100)^2 + 0.13(i/100)^3
And technically, Venus actually starts to get brighter at high phase angles (when it's nearly new) because the atmosphere scatters light through it that increases its magnitude. But I've not accounted for this in the script.
-
- Posts: 164
- Joined: 18.03.2004
- Age: 63
- With us: 20 years 8 months
- Location: Victoria, BC Canada
Okay. I see that. I'm just surprised that there is that much difference between the photometry of the planets as to actually affect the calculation to such a degree. I figured it might account for a .01 magnitude error or thereabouts.Malenfant wrote:Hate to tell you this, but nope.
This all goes back to photometry - the way an object/surface reflects and scatters light.
I never really noticed before... amazing, isn't it - the things you can stare at for years and years and never realise or question?Celestia doesn't handle this realistically at all - to illustrate this have a look at the full moon in Celestia. You'll notice that it's brightest at the subsolar point and dims around the edges? Now compare that with how the full moon really looks - you'll see that the real moon doesn't get dimmer around the edges, and that actually (surface variation notwithstanding) it's the same brightness throughout the lit hemisphere. The brightness of the moon doesn't change with distance from the sub-solar point.
Again, I knew they were factors, I just grossly underestimated their magnitude as factors.There's about two pages of text explaining about oblateness in the chapter from the Explanatory Supplement that I'm using for all this - it changes the size of the disk seen from Earth. Surface variations also do change the visible magnitude - the surface markings on Mars (and dust storms) for example can cause a variation of up to 0.25 magnitudes.
*Slapslapslap* Get a grip man, science is supposed to be complicated!(Personally, I think these scientists just complicate things to keep us laypeople on the outside. Come on! Who's with me for simplifying pi to 3.0, using circular orbits, and changing all these trigonometric curves to linear functions? Think about it - if we did, we could hack so much extraneous code out of Celestia that it could be loaded as a Java applet and run on your cell phone! )
Aha! - you're one them - aren't you?
Thanks for all the info. There's a fair amount of new-to-me material here for me to mull over. BTW: were you aware of how many worms were going to crawl out from under this rock when you started? (I know I had no idea how much rotations and quaternions were going hurt my head when I started doing the Guide)
Clive Pottinger
Victoria, BC Canada
Victoria, BC Canada
cpotting wrote:Thanks for all the info. There's a fair amount of new-to-me material here for me to mull over. BTW: were you aware of how many worms were going to crawl out from under this rock when you started? (I know I had no idea how much rotations and quaternions were going hurt my head when I started doing the Guide)
Honestly? No, I wasn't. It seems obvious now I've read up a little more on the subject, but for example I didn't realise that V(1,0) and the phase functions had to be determined observationally.
But that's usually the case with such voyages of discovery .
I've now put a basic version (that works for the 9 planets plus Jupiter's big moons) on a page on my website, so you can download it there.
Link should be in my sig below. I'll probably put it on the motherlode once I've ironed out a few more creases in it.
EDIT: My sig doesn't appear to be visible, so go here to grab the script.
Link should be in my sig below. I'll probably put it on the motherlode once I've ironed out a few more creases in it.
EDIT: My sig doesn't appear to be visible, so go here to grab the script.
Greetings,
A year or two ago I raised the question of planet/satellite magnitudes in this forum and (I think) with Grant Hutchison. I mentioned that I have some FORTRAN code put together that incorporates many of the sources mentioned in this thread, plus some others. It is a work in progress and has most of the planets and satellites in the solar system. It has observed (or reasonably assumed) phase functions for most of them. Perhaps a look at this code (if I can email it or post it when I'm back in my office) would be useful for Celestia script development?
A year or two ago I raised the question of planet/satellite magnitudes in this forum and (I think) with Grant Hutchison. I mentioned that I have some FORTRAN code put together that incorporates many of the sources mentioned in this thread, plus some others. It is a work in progress and has most of the planets and satellites in the solar system. It has observed (or reasonably assumed) phase functions for most of them. Perhaps a look at this code (if I can email it or post it when I'm back in my office) would be useful for Celestia script development?
http://stevealbers.net
scalbers wrote:Greetings,
A year or two ago I raised the question of planet/satellite magnitudes in this forum and (I think) with Grant Hutchison. I mentioned that I have some FORTRAN code put together that incorporates many of the sources mentioned in this thread, plus some others. It is a work in progress and has most of the planets and satellites in the solar system. It has observed (or reasonably assumed) phase functions for most of them. Perhaps a look at this code (if I can email it or post it when I'm back in my office) would be useful for Celestia script development?
Well, my current script already uses the phase functions that are known for the planets and some of the moons, taken from the 1992 Explanatory Supplement. I don't know if there phase functions for other bodies are known (I'm misising one for Luna), but basically I'd need to know V(1,0) and the phase function to use it in the script.
It doesn't have asteroids in it, but magnitudes for those are calculated differently anyway.
The final version of my script can be downloaded from here.
My Celestia page: Spica system, planetary magnitudes script, updated demo.cel, Quad system