On Tue, Dec 17, 2013 at 3:51 PM, Dan Kennedy <danielk1...@gmail.com> wrote:

> On 12/18/2013 12:49 AM, Brian T. Carcich wrote:
>
>> [...]
>
> Points are fine. [...]
> Is it working now? How many more stars do you have data for?


Excellent, thanks for the info!

I forgot to mention that we do perform searches using magnitude.

Yes it is working now; I do the normal SQLite3 R*Tree INNER JOIN to get to
the index table (tyc2index) from the indexrtree table (tyc2indexrtree)
regions overlapping the user-supplied RA,DEC limits (hira = High RA limit;
lodec = Low DEC limit; etc), and then do another INNER JOIN ON the index
table start and end offsets with the offsets in the main catalog table
(tyc2catalog_uvs), so it all happens in one call.  The beauty is that all
the work is done up front when I load the data from the star catalog, and
then the SELECT does the rest.  Also, the approach should work for any
catalog that has RA,DEC and Magnitude, which almost all catalogs do.

I think the SELECT is in the Githup repo ... yeah, here it is:


SELECT tyc2catalog_uvs.offset ,tyc2catalog_uvs.x ,tyc2catalog_uvs.y
> ,tyc2catalog_uvs.z ,tyc2catalog_uvs.mag


> FROM tyc2indexrtree



INNER JOIN tyc2index
>         ON tyc2indexrtree.offset=tyc2index.offset



INNER JOIN tyc2catalog_uvs
>         ON tyc2index.catalogstart<=tyc2catalog_uvs.offset
>        AND tyc2index.catalogend>tyc2catalog_uvs.offset
>        AND tyc2catalog_uvs.mag<?



WHERE tyc2indexrtree.offset=tyc2index.offset
>   AND tyc2indexrtree.hira>?
>   AND tyc2indexrtree.lora<?
>   AND tyc2indexrtree.hidec>?
>   AND tyc2indexrtree.lodec<?


> ORDER BY tyc2catalog_uvs.mag asc;
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to