Where can I find info on how to create scripts?
-
Topic authorthefallenghost
- Posts: 42
- Joined: 08.05.2009
- With us: 15 years 6 months
Where can I find info on how to create scripts?
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?
http://www.celestiamotherlode.net/
Lots of useful information including links to documents describing CEL and CELX scripting.
Cheers.
Lots of useful information including links to documents describing CEL and CELX scripting.
Cheers.
-
Topic authorthefallenghost
- Posts: 42
- Joined: 08.05.2009
- With us: 15 years 6 months
Re: Where can I find info on how to create scripts?
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?
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.
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.
Selden
-
Topic authorthefallenghost
- Posts: 42
- Joined: 08.05.2009
- With us: 15 years 6 months
Re: Where can I find info on how to create scripts?
.
Last edited by thefallenghost on 03.03.2010, 23:50, edited 1 time in total.
-
Topic authorthefallenghost
- Posts: 42
- Joined: 08.05.2009
- With us: 15 years 6 months
Re: Where can I find info on how to create scripts?
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?
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?
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?
Selden
-
- Developer
- Posts: 1356
- Joined: 07.01.2005
- With us: 19 years 10 months
- Location: Nancy, France
Re: Where can I find info on how to create scripts?
Yep!selden wrote:I have a distinct memory of someone already having written that CelX script, although I don't remember who. Vincent, maybe?
viewtopic.php?f=9&t=14208
Note that Google returns the above link as its first match using the following key words: celestia+script+mark+stars+exoplanet
http://www.google.fr/#hl=fr&source=hp&q ... abdc2d39f4
@+
Vincent
Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3
Vincent
Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3
-
Topic authorthefallenghost
- Posts: 42
- Joined: 08.05.2009
- With us: 15 years 6 months
Re: Where can I find info on how to create scripts?
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?
-
- Developer
- Posts: 1356
- Joined: 07.01.2005
- With us: 19 years 10 months
- Location: Nancy, France
Re: Where can I find info on how to create scripts?
Well, a celx scripting tutorial is available here: http://en.wikibooks.org/wiki/Celestia/C ... ua_Methodsthefallenghost 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, the script shouldn't be too hard to modify to suit your specific needs.
@+
Vincent
Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3
Vincent
Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3
-
Topic authorthefallenghost
- Posts: 42
- Joined: 08.05.2009
- With us: 15 years 6 months
Re: Where can I find info on how to create scripts?
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).
-
- Developer
- Posts: 1356
- Joined: 07.01.2005
- With us: 19 years 10 months
- Location: Nancy, France
Re: Where can I find info on how to create scripts?
You may want to try adding some magic words like please and thank you...
@+
Vincent
Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3
Vincent
Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3
-
Topic authorthefallenghost
- Posts: 42
- Joined: 08.05.2009
- With us: 15 years 6 months
Re: Where can I find info on how to create scripts?
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:
Please help!
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!
-
- Developer
- Posts: 1356
- Joined: 07.01.2005
- With us: 19 years 10 months
- Location: Nancy, France
Re: Where can I find info on how to create scripts?
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:
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
@+
Vincent
Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3
Vincent
Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3
-
Topic authorthefallenghost
- Posts: 42
- Joined: 08.05.2009
- With us: 15 years 6 months
Re: Where can I find info on how to create scripts?
Thanks! I've made some progress; here's my new script:
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!
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!
-
- Developer
- Posts: 1356
- Joined: 07.01.2005
- With us: 19 years 10 months
- Location: Nancy, France
Re: Where can I find info on how to create scripts?
This is because "And 10" is not in your star database, so celestia:find returns Sol.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!
I think that making celestia:find return nil in such a case would be more coherent, though...
@+
Vincent
Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3
Vincent
Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3
-
Topic authorthefallenghost
- Posts: 42
- Joined: 08.05.2009
- With us: 15 years 6 months
Re: Where can I find info on how to create scripts?
Ok, merci!!!
-
Topic authorthefallenghost
- Posts: 42
- Joined: 08.05.2009
- With us: 15 years 6 months
Re: Where can I find info on how to create scripts?
Could someone please tell me how many stars hosting exoplanets there are in Celestia by default?
-
- Developer
- Posts: 1356
- Joined: 07.01.2005
- With us: 19 years 10 months
- Location: Nancy, France
Re: Where can I find info on how to create scripts?
There are 328 stars with exoplanets in the SVN (development) version.thefallenghost wrote:Could someone please tell me how many stars hosting exoplanets there are in Celestia by default?
I can provide a list with their names if needed, or better, a script to
extract them from the Celestia star database.
@+
Vincent
Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3
Vincent
Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3
-
Topic authorthefallenghost
- Posts: 42
- Joined: 08.05.2009
- With us: 15 years 6 months
Re: Where can I find info on how to create scripts?
Thanks & wow! How did you put them on the H-R diagram?