astropy-healpix icon indicating copy to clipboard operation
astropy-healpix copied to clipboard

Add overlap option for cone search

Open cdeil opened this issue 6 years ago • 4 comments

In Gammapy we currently call healpy.query_disc with both the inclusive=True and the inclusive=False option (see https://github.com/gammapy/gammapy/pull/1167#issuecomment-337156775).

As discussed in https://github.com/astropy/astropy-healpix/issues/41 , probably we don't want to spend the time to fully implement healpy.query_disc concerning the inclusive=False behaviour.

But maybe we could add an option to HEALPix.cone_search_lonlat that corresponds to the inclusive=True behaviour, i.e. restricts the pixels to the ones where the center is in the cone?

@astrofrog - OK to add this?

How about calling it overlap={'center', 'full'} which is maybe a bit more intuitive than inclusive = {True, False} and also more extensible should we want to add other options in the future? Concerning implementation: should it just be done at the end of the function in an if overlap == 'center' block using a Numpy expression, subsetting with a mask that's true if the pixel center is in the cone? Or would you suggest this be added in the C or Cython code somehow?

cdeil avatar Oct 17 '17 08:10 cdeil