[Kstars-devel] Drawing deepsky objects on the fly

Jan Kotek opencoeli at gmail.com
Thu Jun 24 19:53:29 CEST 2010


Hi,

not sure if it helps, in Asterope I had similar problem while querying
large number of objects. I solved it by:

1) generate Set of pixel od
2) sort pixel numbers
3) create iterator over sorted BTree Map which have pixel id as key
and object as value (dont use hash map)
4) create iterator over sorted pixel numbers
5) move on both iterators and create result set

Not the trick is that ONE iteration over sorted tree is faster that
MANY queries to hash map.

Major difference is that I use Healpix which produces sorted ranges
very fast. 10 degree query over 300000 stars with 1' pixel resolution
takes about 32ms.

More at:
  http://code.google.com/p/healpix-rangeset/
  http://code.google.com/p/asterope/

Regards,
Jan Kotek

On Sat, Jun 19, 2010 at 4:29 PM, Victor Carbune
<victor.carbune at gmail.com> wrote:
> Hello,
>
> Since the deep sky objects database will have a lot of data added, I
> have been discussing with Akarsh on a method of optimising the way
> they are accessed.
> The optimisation would be doing something similar as it's done with the stars.
>
> 1. The objects will be initially painted on the sky, but no hash
> between names and pointers to the object will exist (less memory used,
> specially when the catalog will have a lot of other objects).
>
> 2. If one searches for an object (in the search dialog - you may see
> it under tools, in my branch), then, instead of keeping the list of
> DeepSkyObject * in the trixel (which might be impossible) the backend
> would query the database (with the id of the object) and retrieve all
> its parameters.
> Further, a new instance of the DeepSkyObject is created, with the
> parameters of the object, and the draw method is called again (maybe
> not all the deep sky objects will be painted from the beginning) and
> the object is centered using the SkyMap focus method. This means
> combining the old method with the database.
>
> 3. If one right clicks on the sky, then the methods objectsInArea,
> nearestObject etc. will be using a query on the database to retrieve
> the object with the coordinates matching the point coords clicked by
> the user and the process follows similarly as above (if the instance
> is still created on point 2), then maybe we will still hold a hash map
> only for clicked and searched objects).
>
> I remember that Akarsh told me to avoid using hashmaps at all and
> these might be avoided without the user to notify any changes at all
> (just doing the query trick all the time).
>
> Please let me know what you think.
>
> Victor
> _______________________________________________
> Kstars-devel mailing list
> Kstars-devel at kde.org
> https://mail.kde.org/mailman/listinfo/kstars-devel
>


More information about the Kstars-devel mailing list