ywyw / dat-wise

Importer for the WISE All-Sky Data Products
3 stars 3 forks source link

implement indexing / querying on healpix geohashes #4

Open ywyw opened 9 years ago

ywyw commented 9 years ago

Currently, there is a base 12 / base 16 geohash implemented. First it determines which bin of 12 a coordinate falls in, and then the "remainder" healpix, each is converted into hex and concatenated together: hex(bin) + hex(remainder).

However, the implementation of querying has not been done. For example, for a rectangular bbox ra/dec query, how do we figure out which healpix to grab? Ideally the query would only grab the relevant healpix of varying sizes.

demitri commented 9 years ago

I think what is needed is the ability to make a couple of types of queries, of increasing complexity:

For any of these queries, the return value is a list of Trixels the query area covers. I haven't looked at it yet, but are there polygon queries in Healpix/Healpy?

ywyw commented 9 years ago

A point source should be quite easy. For all points within a given distance, this gets quite hard I think, but there are utilities for adjacent healpix. Polygon queries can probably be handled with a polygon to rectangle conversion of sorts that @maxogden linked me a couple days ago, but as far as I know, there are no functions dedicated to it in Healpy.

ywyw commented 9 years ago

Correction, there seems to be a hidden utility for corner coordinates as well. I think I will have a solution up soon.

ywyw commented 9 years ago

@demitri @maxogden Illustrated bounding box query on Healpix cases now in the README!