Page 1 of 2
Where can I find info on how to create scripts?
Posted: 03.03.2010, 14:38
by thefallenghost
I want to create a script that displays the locations of exoplanet-host stars, but I never wrote any script in Celestia.
Re: Where can I find info on how to create scripts?
Posted: 03.03.2010, 15:19
by SiriusCG
http://www.celestiamotherlode.net/Lots of useful information including links to documents describing CEL and CELX scripting.
Cheers.
Re: Where can I find info on how to create scripts?
Posted: 03.03.2010, 17:31
by thefallenghost
I'm sorry, I realized I need to make some kind of plot of these objects, and not a script. I want to do something like "Galactic Redshift Survey" or "SIRAS PSCz Galaxies" on the motherlode. I haven't found any help on plotting though. Where can I get some?
Re: Where can I find info on how to create scripts?
Posted: 03.03.2010, 19:41
by selden
What do you mean by "plotting"?
Celestia can place markers around objects, if that's what you mean. That can be done with a Cel script.
Or you can write a Lua script to write out information that Celestia has to a file and then use some separate plotting program (Excel, perhaps) to translate that information into an appropriate 2D plot.
Re: Where can I find info on how to create scripts?
Posted: 03.03.2010, 22:09
by thefallenghost
.
Re: Where can I find info on how to create scripts?
Posted: 03.03.2010, 23:49
by thefallenghost
Well, I want to display the location of ~400 exoplanet-host stars (as dots or actual stars with planets, preferring the latter option) around Earth's location in 3D.
Re: Where can I find info on how to create scripts?
Posted: 04.03.2010, 11:20
by selden
That can be done in Celestia when using a Cel script with a separate command for each object, placing a marker around each one specified by name, which is rather painful,
or by using a CelX script which looks at every star and marks those which have an associated planet.
I have a distinct memory of someone already having written that CelX script, although I don't remember who. Vincent, maybe?
Re: Where can I find info on how to create scripts?
Posted: 04.03.2010, 14:11
by Vincent
selden wrote:I have a distinct memory of someone already having written that CelX script, although I don't remember who. Vincent, maybe?
Yep!
viewtopic.php?f=9&t=14208Note that Google returns the above link as its first match using the following key words:
celestia+script+mark+stars+exoplanethttp://www.google.fr/#hl=fr&source=hp&q ... abdc2d39f4
Re: Where can I find info on how to create scripts?
Posted: 05.03.2010, 03:22
by thefallenghost
Well, since I'm doing this for an important project, I would prefer going through the stars one by one to make sure they're all included (as they're not all in Celestia currently). Also, I looked at the mark-lg celx included in Celestia and I thought I saw some parameters to the mark function ("dso:mark( "green", "disk",10, 1 )" at line 20). Are there any parameters for the mark function in celx, and if yes, what are they?
Re: Where can I find info on how to create scripts?
Posted: 05.03.2010, 07:45
by Vincent
thefallenghost wrote:Well, since I'm doing this for an important project, I would prefer going through the stars one by one to make sure they're all included (as they're not all in Celestia currently). Also, I looked at the mark-lg celx included in Celestia and I thought I saw some parameters to the mark function ("dso:mark( "green", "disk",10, 1 )" at line 20). Are there any parameters for the mark function in celx, and if yes, what are they?
Well, a celx scripting tutorial is available here:
http://en.wikibooks.org/wiki/Celestia/C ... ua_MethodsWell, the script shouldn't be too hard to modify to suit your specific needs.
Re: Where can I find info on how to create scripts?
Posted: 05.03.2010, 17:12
by thefallenghost
This still doesn't answer wether or not there are any arguments to the mark function (there doesn't seem to be any on your link).
Re: Where can I find info on how to create scripts?
Posted: 05.03.2010, 17:34
by Vincent
You may want to try adding some magic words like please and thank you...
Re: Where can I find info on how to create scripts?
Posted: 05.03.2010, 17:44
by thefallenghost
Sorry... You're right, Thanks
!
I think that the arguments are :
1) Color of the marker
2) Shape of the marker
3) Size of the marker
4) Number:?
However, when I run my script, it returns a fatal error:
In line 6: Argument to find must be a string.
Here is my celx:
Code: Select all
-- Title: Mark exoplanet-host stars
-- Stars with planets discovered by the radial velocity method:
markRV = function(starName)
celestia:unmarkall()
celestia:setrenderflags{markers = true}
celestia:select(nil)
myStar = celestia:find(starName)
myStar:mark("green", "disk", 10, 1)
end
RVstars = {"HD 209458","HD 189733"}
markRV(RVstars)
Please help!
Re: Where can I find info on how to create scripts?
Posted: 05.03.2010, 18:02
by Vincent
This is a good start.
Now, the problem is that you're passing the RVstars table as argument to the markRV function.
You actually need to iterate over the elements contained in the table so that the string names
are successively passed as argument to the markRV function:
Code: Select all
RVstars = {"HD 209458","HD 189733"}
for k, starname in pairs(RVstars) do
markRV(starname)
end
Re: Where can I find info on how to create scripts?
Posted: 05.03.2010, 20:49
by thefallenghost
Thanks! I've made some progress; here's my new script:
Code: Select all
-- Title: Mark exoplanet-host stars
-- Listed in alphabetical order. The list is located at: http://www.planetary.org/exoplanets/list.php
celestia:unmarkall()
celestia:setrenderflags{markers = true}
celestia:select(nil)
-- Stars with planets discovered by the radial velocity method:
markRV = function(starName)
myStar = celestia:find(starName)
myStar:mark("green", "square", 10, 1)
end
RVstars = {
"Gliese 86 A",
"14 And",
"14 Her",
"16 Cyg B",
"18 Del",
"30 Ari B",
"4 UMa",
"42 Dra",
"51 Peg",
"55 Cnc",
"6 Lyn",
"61 Vir",
"70 Vir",
"81 Cet",
"HIP 30034",
"HIP 104780"
}
for k, starname in pairs(RVstars) do
markRV(starname)
end
---------------------------------------------------------------
-- Star with planet discovered by the astrometry method:
markAS = function(starName)
myStar = celestia:find(starName)
myStar:mark("green", "disk", 10, 1)
end
ASstars = {
"VB 10"
}
for k, starname in pairs(ASstars) do
markAS(starname)
end
---------------------------------------------------------------
-- Stars with planets discovered by the transit method:
markT = function(starName)
myStar = celestia:find(starName)
myStar:mark("blue", "square", 10, 1)
end
Tstars = {
"12 And"
}
for k, starname in pairs(Tstars) do
markT(starname)
end
---------------------------------------------------------------
-- Stars with planets discovered by the microlensing method:
markML = function(starName)
myStar = celestia:find(starName)
myStar:mark("white", "square", 10, 1)
end
MLstars = {
"13 And"------
}
for k, starname in pairs(MLstars) do
markML(starname)
end
---------------------------------------------------------------
-- Stars with planets discovered by direct imaging:
markDI = function(starName)
myStar = celestia:find(starName)
myStar:mark("red", "square", 10, 1)
end
DIstars = {
"2MASSW J1207334?393254"
}
for k, starname in pairs(DIstars) do
markDI(starname)
end
---------------------------------------------------------------
-- Stars with planets discovered by the timing method:
markTi = function(starName)
myStar = celestia:find(starName)
myStar:mark("yellow", "square", 10, 1)
end
Tistars = {
"And 10"
}
for k, starname in pairs(Tistars) do
markTi(starname)
end
However, there seems to be a problem with the last function (timing stars), as Sol is marked instead of the given star (I've tried a couple of different scenarios). Help!
Re: Where can I find info on how to create scripts?
Posted: 06.03.2010, 08:51
by Vincent
thefallenghost wrote:However, there seems to be a problem with the last function (timing stars), as Sol is marked instead of the given star (I've tried a couple of different scenarios). Help!
This is because "And 10" is not in your star database, so celestia:find returns Sol.
I think that making celestia:find return
nil in such a case would be more coherent, though...
Re: Where can I find info on how to create scripts?
Posted: 06.03.2010, 19:59
by thefallenghost
Ok, merci!!!
Re: Where can I find info on how to create scripts?
Posted: 07.03.2010, 00:28
by thefallenghost
Could someone please tell me how many stars hosting exoplanets there are in Celestia by default?
Re: Where can I find info on how to create scripts?
Posted: 07.03.2010, 09:59
by Vincent
thefallenghost wrote:Could someone please tell me how many stars hosting exoplanets there are in Celestia by default?
There are 328 stars with exoplanets in the SVN (development) version.
I can provide a list with their names if needed, or better, a script to
extract them from the Celestia star database.
Re: Where can I find info on how to create scripts?
Posted: 07.03.2010, 17:17
by thefallenghost
Thanks & wow! How did you put them on the H-R diagram?