Page 1 of 1

[pre6] Adding Sol?

Posted: 13.03.2004, 23:01
by Evil Dr Ganymede
I don't know whether this should go under "bugs" or "addons" or what... so I'll post it here.

In the new 1.3.2pre6 version of Celestia, Chris added the ability to load the program without stars.dat (comment out the relevant line in the celestia.cfg). This creates an empty universe that one can then populate with one's own stcs.

To test it out, I installed Grant's nearstar2.zip collection of stc files, but Sol isn't included in them. So I tried adding it myself by adding this:


Code: Select all

100000 "Sol"
{
   RA 0
   Dec 0
   Distance 0
   SpectralType "G2V"
   AppMag 5.4
}


(I guessed at the AppMag)

But this seems to make Celestia go a bit crazy. It claims that the parameters for Sol are:

Abs(App)mag: 1.#J (1.#J)
Luminosity: 1.#Rx Sun
Class: G2 V
Surface Temperature: 5,860 K
Radius: -1.#J Rsun
Rotation Period: 25.400 days

if I try actually going to Sol (using the G button), I end up going to random points scattered across the universe (some up to trillions of lightyears away!)

Does anyone have any idea what's going on? How can I just add Sol to this 'empty universe' in the position that it ought to be?

Re: [pre6] Adding Sol?

Posted: 14.03.2004, 00:51
by granthutchison
A distance of zero and an apparent magnitude of 5.4 makes it an infinitely dim star!
Because Celestia uses the Hipparcos distance and apparent magnitude listed in stars.dat to calculate luminosity and therefore size, the Sun (assigned Hipparcos number zero) can't be placed at the zero point of the coordinate system without incurring infinities. It's actually assigned a parallax of 1000000mas, and a suitable apparent magnitude to go with that. So the following stc should drop Sol back into its original Celestia position:

Code: Select all

100000 "Sol"
{
   RA 0
   Dec 0
   Distance 0.00326167
   SpectralType "G2V"
   AppMag -15.16797
}

Grant

Posted: 14.03.2004, 01:13
by Evil Dr Ganymede
OK, I think I've solved the problem. Just use a very small number for distance.

Code: Select all

300000 "Sol"
{
   RA 0.00
   Dec 0.00
   Distance 0.00001
   SpectralType "G2V"
   AppMag -27.74
}


However, I wonder if I've found another problem: I've always seen the apparent magnitude of the sun quoted as being -26.4 (or thereabouts).

If I use the -26.4 value, I get an absolute magnitude of 6.17, a luminosity of 0.292x Sun, and a radius of 0.54 Rsun.

If I use the -27.74 value, I get an absolute magnitude of 4.83, a luminosity of 1.00x Sun, and a radius of 1.00 Rsun.

I arrived at a value of -27.74 here by trial and error (that gives me a luminosity of 1.0 sols and a radius of 1.0 sols) - so there seems to be a discrepancy between the luminosity that Celestia figures out and reality.



Also, it seems that if I type "Sol" when I want to look for a target, it can't find it even though it's listed by name in the stc. I have to type HIP 300000 to select the star - why is this? I also noticed that all the other stars that aren't in the stc are listed when I try typing a name in (e.g. Sirius isn't in the stc, but it still shows up as an option in the Target Name window). Am I not allowed to use a name of a star that's already in the starnames.dat file?

It turns out the starnames.dat file is a text file, so I created an empty text file with the same name and that seemed to get rid of that problem. Just leaving 0:Sol as the only entry also works.

Though for some bizarre reason, when I first fired up Celestia after I did this, the sun and all its planets (the planets weren't there before) showed up! No other stars were reintroduced those, so this somehow seemed to re-introduce the planets to the program. I commented out the solarsystem.ssc files from celestia.cfg and that got rid of them.

Posted: 14.03.2004, 01:18
by Evil Dr Ganymede
Now I'm confused again.. :? 8O

Grant - why do you use an AppMag of -15.17?

And why that specific distance?

Posted: 14.03.2004, 01:25
by selden
just a quick comment on one point: a web search turns up a commonly quoted value for the apparent magnitude of the sun of -26.74 (+/- 0.1) It sounds like someone may have made a typo in the magnitude conversion.

Posted: 14.03.2004, 01:58
by granthutchison
Evil Dr Ganymede wrote:Grant - why do you use an AppMag of -15.17?

And why that specific distance?
Those are the figures used in stars.dat so it seemed reasonable to restore them - Celestia positions other stars relative to that locus, rather than the centre of the coordinate system, it appears.
But really any small distance would do, so long as you use an appropriate AppMag to go with it ... -15.17 is the apparent magnitude of a Sun-like star when viewed from .00326 light years away, and you've had to feel your way towards the apparent magnitude of a Sun-like star at .00001 light years. (Since that's equivalent to 0.63AU, of course the corresponding apparent magnitude of the Sun is going to be brighter than its apparent magnitude from Earth.) But if you don't want the stars.dat settings, why not just use

Code: Select all

AbsMag 4.82
in your stc and save yourself the hassle of doing the sums or iterating a solution?

Grant

Posted: 14.03.2004, 02:25
by Evil Dr Ganymede
granthutchison wrote:But really any small distance would do, so long as you use an appropriate AppMag to go with it ... -15.17 is the apparent magnitude of a Sun-like star when viewed from .00326 light years away, and you've had to feel your way towards the apparent magnitude of a Sun-like star at .00001 light years. (Since that's equivalent to 0.63AU, of course the corresponding apparent magnitude of the Sun is going to be brighter than its apparent magnitude from Earth.)

Ah, that makes sense. Ta.

But if you don't want the stars.dat settings, why not just use

Code: Select all

AbsMag 4.82
in your stc and save yourself the hassle of doing the sums or iterating a solution?


I'd love to, but it appears that if I use any AbsMag value, Celestia crashes! I start up the program, tell it to centre on Sol, it starts to rotate round, and then it says "the instruction at "0x092d776d" referenced memory at "0x00000000". The memory could not be "read"." Looks like an unhandled exception error...

The appmag method seems to work OK though, so I'll stick with that. BTW, I just changed the distance to 1 AU (0.00001584 ly) and the appmag value of -26.74 works fine now. So that's answered Selden's query - there's no mistake in the formulae.

Posted: 15.03.2004, 06:36
by Evil Dr Ganymede
Oh, now I see why the -15.17 value is better - because for Celestia starts off 206.4 AU from Sol, and that's the appmag from there. I was wondering why I was getting two Sols showing up when I turned the stars.dat file back on... 8O

Actually, through trial and error (ie fiddling with the distance til the two Sols merge exactly) the exact set up should be:

Code: Select all

340000 "Sol"
{
   RA 0.00
   Dec 0.00
   Distance 0.00326167   
   SpectralType "G2V"
   AppMag -15.17       # -26.74 from 1 AU
}


This is a bit odd, since 0.00326167 ly is 205.86 AU - which is not the distance at which Celestia starts from Sol (that seems to be 206.41 AU, which I can determine if I hit escape as it's loading up to cancel the start.cel script before it moves you anywhere).

With my distance value, the 'added' Sol is in exactly the same location as the default Sol - they overlap perfectly.

Posted: 15.03.2004, 08:09
by granthutchison
Um, Consty ... that's exactly the distance I suggested in my first post. :)
It's the distance in stars.dat, so of course it merges the two objects exactly.

Grant

Posted: 15.03.2004, 08:31
by Evil Dr Ganymede
granthutchison wrote:Um, Consty ... that's exactly the distance I suggested in my first post. :)
It's the distance in stars.dat, so of course it merges the two objects exactly.

Grant


Ooops. So you did. I must've missed that. :oops: :oops:

Sorry! Never mind. I blame tiredness ;)

Though why are the distances different? Shouldn't Celestia start at 205.86 AU instead of 206.4 AU? Or is the difference down to how I calculate how far a lightyear is (I find the distance in light-days and multiply that by 365.25 to get ly)?

Posted: 15.03.2004, 12:45
by selden
Oh evil one,

Celestia places the sun at an xyz of [0.00326167, 0, 0] if you use units of light years.

This is because Celestia uses a conversion factor of precisely 3.26167 light years/parsec.

Posted: 15.03.2004, 15:31
by granthutchison
Evil Dr Ganymede wrote:Though why are the distances different? Shouldn't Celestia start at 205.86 AU instead of 206.4 AU? Or is the difference down to how I calculate how far a lightyear is (I find the distance in light-days and multiply that by 365.25 to get ly)?
I guess we're seeing rounding errors in both calculations. A parsec is 206264.806 AU, so Celestia should be starting at 206.26 AU. But I've no idea what interconversion factors Celestia uses to get back and forth between parsecs, metres and AU.

Grant