A script to mark ALL Fridger's galaxies

All about writing scripts for Celestia in Lua and the .cel system
Vincent
Developer
Posts: 1356
Joined: 07.01.2005
With us: 19 years 10 months
Location: Nancy, France

Post #21by Vincent » 11.03.2007, 10:06

This script is really interesting Cham. :)
With a few more celx commands, this kind of very informative scripts about DSO could be written with only 10 lines...

Indeed, the object:getinfo() celx command currently returns only 3 elements in the case of deepsky objects :
- type (= "deepsky")
- name
- radius

As a comparison, the same object:getinfo() command returns much more information in the case of stars :
- type (="star")
- catalogNumber
- stellarClass
- absoluteMagnitude
- luminosity
- radius
- temperature
- rotationPeriod
...

So it would be nice to have a few more information returned by the object:getinfo() celx command in the case of DSO, such as :
- catalogNumber
- subtype ("galaxy", "nebula", "opencluster",...)
- hubbletype ("S0", "Sa", "Sb", "Sc", "Sba", ...)
- absoluteMagnitude
...

Also, the celestia:getdeepsky(catalog, number) would return a specific deepsky object identified by its number, in the specified catalog "M", "NGC", "IC"... (as the celestia:getstar() command already does for stars)

I can try to work on it if Chris, Fridger, and the other devs think that it would represent a useful addition to celx. Just let me know...
Last edited by Vincent on 11.03.2007, 22:19, edited 1 time in total.
@+
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

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

Post #22by t00fri » 11.03.2007, 11:42

Vincent wrote:I can try to work on it if Chris, Fridger, and the other devs think that it would represent a useful addition to celx. Just let me know...


I am most enthusiastic about this!

++++++++++++++++++
Since long I am working to really fill the Celestia Universe with LOTS of those objects that belong there ;-) .
++++++++++++++++++

In my view it is really instructive and thus of high EDUCATIONAL value if --by the time-- Celestia offers a set of CELX scripts with the help of which one may investigate/display characteristic (statistical) properties of these objects populating the Universe.

What we really should address ASAP among the devs is to arrive at an adequate auto-adapting (!) set of STANDARD coordinate grids, including alt-azimuth, equatorial, /galactic/ coordinates. Such a grid system is overdue since YEARS!

As an example, Cham's nice display of my galaxies would have looked even more instructive, if the void wedge had become apparent as the equatorial region by means of a superimposed /galactic/ coordinate grid!

There is a host of related useful displays one can envisage with Lua:

1) e.g. also redshifts by means of colored dots ranging from white to (dark) red. Using Hubble's law, the redshift is available to good accuracy from the galaxy distance for many galaxies of my catalog. One might even want to input in addition a catalog with the /peculiar/ velocities which would allow to color-mark also the blueshifted galaxies (of our local group), where the peculiar velocities due to gravitational effects in galaxy clusters dominate over the redshifts due to the expansion of the Universe...

2) Cham's great overlay of the quasar locations in the MilkyWay.

3) asteroid belts are another great application, once we have incorporated thousands of asteroids. Here the problem is the (octree) culling, since asteroids are not stationary objects. But as I often wrote, I have many ideas here...Just need more time.

...

Bye Fridger
Image

buggs_moran
Posts: 835
Joined: 27.09.2004
With us: 20 years 1 month
Location: Massachusetts, USA

Post #23by buggs_moran » 11.03.2007, 12:16

t00fri wrote: But as I often wrote, I have many ideas here...Just need more time.


Don't we all... :wink:
Homebrew:
WinXP Pro SP2
Asus A7N8X-E Deluxe
AMD Athlon XP 3000/333 2.16 GHz
1 GB Crucial RAM
80 GB WD SATA drive
ATI AIW 9600XT 128M

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

Post #24by t00fri » 11.03.2007, 12:45

buggs_moran wrote:
t00fri wrote: But as I often wrote, I have many ideas here...Just need more time.

Don't we all... :wink:


I am not so sure how many others would really know how to address THAT particular and pretty tough problem of octree culling of MOVING asteroids...Ever heard about action-angle variables, for example? ;-)

Bye Fridger
Image

ElChristou
Developer
Posts: 3776
Joined: 04.02.2005
With us: 19 years 9 months

Post #25by ElChristou » 11.03.2007, 13:01

Tx Cham!

Indeed it's a pretty interesting rendering, but definitively something should be done at dev level because of the poor fps with the markers... Also as for the Galaxy labels a minimum of culling should be implemented to accentuate the 3D feeling...

I'm confident our Dev team will find something out for those problems :wink:
Image

Vincent
Developer
Posts: 1356
Joined: 07.01.2005
With us: 19 years 10 months
Location: Nancy, France

Post #26by Vincent » 11.03.2007, 14:34

OK,

I've added some of the new celx commands that I described in my previous post.
Here's a patch built against the current CVS : http://vincent.gian.club.fr/celestia/dso_info.patch

Cham's script can now be written in celx using the following lines :

Code: Select all

function mark_dso()
    ndso = celestia:getdsocount()
    i = 0
    while i < ndso do
        dso = celestia:getdso(i)
        hubbleType = dso:getinfo().hubbleType
      if string.find(hubbleType, "E") then
         dso:mark( "red", "circle", 1, 0.5 )
      elseif string.find(hubbleType, "Irr") then
         dso:mark( "yellow", "circle", 1, 0.5 )
      elseif string.find(hubbleType, "SB") then
         dso:mark( "green", "circle", 1, 0.5 )
      elseif string.find(hubbleType, "S") then
         dso:mark( "blue", "circle", 1, 0.5 )
      end
        i = i + 1
    end
end

celestia:unmarkall()
mark_dso()


Image

I'm currently trying to make the markers' transparency vary according to the distance to the observer to accentuate the 3D feeling, as suggested by ElChristou...
Last edited by Vincent on 12.03.2007, 14:20, edited 4 times in total.
@+
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

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

Post #27by t00fri » 11.03.2007, 15:36

Neat!, Vincent.

Bye Fridger
Image

Avatar
Topic author
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 months
Location: Montreal

Post #28by Cham » 11.03.2007, 16:50

We also need the markers to be drawn on the background, BEHIND foreground objetcs.

If you navigate inside our solar system, the markers are getting very confusing, if you have, say, the Earth on the foreground.
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

ElChristou
Developer
Posts: 3776
Joined: 04.02.2005
With us: 19 years 9 months

Post #29by ElChristou » 11.03.2007, 17:44

Tx, Vince, works great!

I split your celx by type, don't know if the code is right but it works fine...


E galaxies:

Code: Select all

celestia:print(" M a r k i n g   E l l i p t i c a l   G a l a x i e s  . . . ", 5, 0, 0, 0, 0)


function mark_dso()
    obs = celestia:getobserver()
    ndso = celestia:getdsocount()
    i = 0
    while i < ndso do
        dso = celestia:getdso(i)
        hubbleType = dso:getinfo().hubbleType
      if string.find(hubbleType, "E") then
         dso:mark( "red", "disk", 1, 0.5 )
      end
        i = i + 1
    end
end

mark_dso()


S galaxies:

Code: Select all

celestia:print(" M a r k i n g   S p i r a l   g a l a x i e s  . . . ", 5, 0, 0, 0, 0)


function mark_dso()
    obs = celestia:getobserver()
    ndso = celestia:getdsocount()
    i = 0
    while i < ndso do
        dso = celestia:getdso(i)
        hubbleType = dso:getinfo().hubbleType
      if string.find(hubbleType, "S") then
         dso:mark( "blue", "disk", 1, 0.5 )
      end
        i = i + 1
    end
end

mark_dso()


SB galaxies:

Code: Select all

celestia:print(" M a r k i n g   B a r r e d   S p i r a l   G a l a x i e s  . . . ", 5, 0, 0, 0, 0)


function mark_dso()
    obs = celestia:getobserver()
    ndso = celestia:getdsocount()
    i = 0
    while i < ndso do
        dso = celestia:getdso(i)
        hubbleType = dso:getinfo().hubbleType
      if string.find(hubbleType, "SB") then
         dso:mark( "green", "disk", 1, 0.5 )
      end
        i = i + 1
    end
end

mark_dso()


Irr galaxies:

Code: Select all

celestia:print(" M a r k i n g   I r r e g u l a r  g a l a x i e s  . . . ", 5, 0, 0, 0, 0)


function mark_dso()
    obs = celestia:getobserver()
    ndso = celestia:getdsocount()
    i = 0
    while i < ndso do
        dso = celestia:getdso(i)
        hubbleType = dso:getinfo().hubbleType
      if string.find(hubbleType, "Irr") then
         dso:mark( "yellow", "disk", 1, 0.5 )
      end
        i = i + 1
    end
end

mark_dso()


if needed an unmark all (I remove the function in each previous)

Code: Select all

celestia:print(" U n m a r k i n g   a l l  . . . ", 2, 0, 0, 0, 0)
celestia:unmarkall()
Image

ElChristou
Developer
Posts: 3776
Joined: 04.02.2005
With us: 19 years 9 months

Post #30by ElChristou » 12.03.2007, 02:26

Remember Vincent's Edu tools? Why not a specialized tool for DSO survey?

It could look like this: (it's just a quick start, I'm sure Fridger will have better ideas of the functions of such a tool)

Image
Image

ElChristou
Developer
Posts: 3776
Joined: 04.02.2005
With us: 19 years 9 months

Post #31by ElChristou » 13.03.2007, 11:28

No? too bad... :?
Image

ElChristou
Developer
Posts: 3776
Joined: 04.02.2005
With us: 19 years 9 months

Post #32by ElChristou » 13.03.2007, 12:25

BTW, can Vincent's patch be integrated to CVS?
Image

starfleetengineer
Posts: 41
Joined: 18.01.2007
With us: 17 years 10 months

Post #33by starfleetengineer » 13.03.2007, 14:12

My 1.4.1 celestia crashes when I run these celx scripts. I assume this is because they are using 1.5.x features.
Can someone tell me what is the 1.5.x specific feature(s) being used?

Perhaps I can rewrite for 1.4.1 by excluding the 1.5.x feature(s)...
"Once you're in Earth orbit you're half way to almost anywhere in the Universe" - Robert Heinlein

CLICK HERE TO DOWNLOAD THE WARPDRIVE

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

Post #34by t00fri » 13.03.2007, 14:43

starfleetengineer wrote:My 1.4.1 celestia crashes when I run these celx scripts. I assume this is because they are using 1.5.x features.
Can someone tell me what is the 1.5.x specific feature(s) being used?

Perhaps I can rewrite for 1.4.1 by excluding the 1.5.x feature(s)...


For this celx script to work, you first need to implement Vincent's patch (which he posted a few mails back) into the current CVS version. One reason for the patch is to properly read out required info about the DSOs. So I don't see how you can get along without the patch.

Bye Fridger
Last edited by t00fri on 13.03.2007, 15:18, edited 1 time in total.
Image

Vincent
Developer
Posts: 1356
Joined: 07.01.2005
With us: 19 years 10 months
Location: Nancy, France

Post #35by Vincent » 13.03.2007, 15:11

I'll commit the changes into CVS when I'm back home, in a few hours...
Users who can't compile the CVS version can still use Cham's cel version of the script, or wait for the release of 1.5pre3.
@+
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

Avatar
Topic author
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 months
Location: Montreal

Post #36by Cham » 14.03.2007, 01:31

Thanks Vincent. I recompiled Celestia, and the new script commands are working very well. I would prefer an orange color for the elliptical galaxies, like in my cel script, but this is just a matter of taste.

Now, these galactic markers are VERY usefull. With their help, I located a nice galactic cluster which I would never have found without the markers ! By moving arbitrarily in the markers, I suddenly noticed some high concentration of red dots :

Image

Traveling closer carried out to this cluster :

Image

Pretty nice ! :o

Unfortunately, this cluster isn't a real one, since looking at it from the side shows a perfectly aligned set of galaxies, which is, of course, associated to some poorly estimated distances :

Image

Well, such is astronomy.

By the way, I think that this script (Vincent's version, since it's much smaller than mine) should be included in the official distribution, and we URGENTLY NEED a script menu in Celestia, associated to a "scripts" folder. This galactic script is a good example why.
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

starfleetengineer
Posts: 41
Joined: 18.01.2007
With us: 17 years 10 months

Post #37by starfleetengineer » 14.03.2007, 11:38

t00fri wrote:For this celx script to work, you first need to implement Vincent's patch (which he posted a few mails back) into the current CVS version. One reason for the patch is to properly read out required info about the DSOs. So I don't see how you can get along without the patch.

Bye Fridger

Thanks for the explanation. I agree with you...these scripts will therefore never work in 1.4 version.

I like the idea of being able to selectively enable different types of objects as ElCristou contributed. Some key bindings would be nice in this context, however I think we are already running out of available keys in Celestia (as I found with my Warpdrive).
I think we should give some time for scripts such as these to mature with ideas from other people before including in a distribution, if at all. IMO they need to be fairly generic before you can justify including in a distribution. (ie. there are many other classes or situations of objects in Celestia for which it may be useful to mark and categorise)
Useful though they are, I also don't see any great advantage or need to include scripts such as these in a distribution unless they were bound to keys, and there aren't many free keys available.

Personally, I'm quite happy to just have them as extras.
Thanks for the contributions guys. I'll look forward to using these in 1.5, whether as extras or part of the release.

SFE
"Once you're in Earth orbit you're half way to almost anywhere in the Universe" - Robert Heinlein



CLICK HERE TO DOWNLOAD THE WARPDRIVE

starfleetengineer
Posts: 41
Joined: 18.01.2007
With us: 17 years 10 months

Post #38by starfleetengineer » 14.03.2007, 11:43

BTW,

I think the journey I suggested earlier in this post: http://celestiaproject.net/forum/viewtopic.php?p=84433#84433

may be quite interesting with these coloured markers enabled.

(The URL is a 1.4.1 version, but this shouldn't matter at the scales involved :lol: )
"Once you're in Earth orbit you're half way to almost anywhere in the Universe" - Robert Heinlein



CLICK HERE TO DOWNLOAD THE WARPDRIVE

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

Post #39by t00fri » 14.03.2007, 13:59

As I wrote already elsewhere, another similarly interesting application
would be scripts that mark the 10000+ asteroids from the official catalog (once they are all implemented ;-) ).

I had done such a plot of the asteroid belt already years ago

Image

based on the official catalog
ftp://ftp.lowell.edu/pub/elgb/astorb.dat.gz

I have read out by means of PERL (of course ;-) )

Another nice apllication would be to color the galaxies according to their redshift z that one may easily obtain. One may color them increasingly read for increasing redshift, for example...

Bye Fridger
Image

ElChristou
Developer
Posts: 3776
Joined: 04.02.2005
With us: 19 years 9 months

Post #40by ElChristou » 14.03.2007, 17:01

t00fri wrote:...Another nice apllication would be to color the galaxies according to their redshift z that one may easily obtain. One may color them increasingly read for increasing redshift, for example...


Could you release a new deepsky.dsc with those new datas? I'm pretty sure Vincent could modify CVS just like he does recently to extract and use those new arguments via celx...
Image


Return to “Scripting”