HEALPixIndex

class nyx.emitter.catalogs.index.HEALPixIndex[source]

Bases: object

Cone search over ra/dec, indexed by nested-ordering HEALPix pixel.

Parameters:
  • ra (array-like) – Catalog positions in degrees.

  • dec (array-like) – Catalog positions in degrees.

  • nside (int) – HEALPix nside of the index.

Build the index; see the class docstring for the arguments.

Methods Summary

nearest(ra, dec, radius)

Closest catalog row to (ra, dec), if one is within radius.

query(ra, dec, radius)

Rows within radius of (ra, dec).

Methods Documentation

nearest(ra, dec, radius)[source]

Closest catalog row to (ra, dec), if one is within radius.

Parameters:
  • ra (float) – Query position in degrees.

  • dec (float) – Query position in degrees.

  • radius (float) – Match radius in degrees.

Returns:

  • index (int) – Row index into the original catalog, or -1 for no match.

  • separation (float) – Separation in degrees.

query(ra, dec, radius)[source]

Rows within radius of (ra, dec).

Parameters:
  • ra (float) – Cone centre in degrees.

  • dec (float) – Cone centre in degrees.

  • radius (float) – Search radius in degrees.

Returns:

Integer indices into the original catalog.

Return type:

numpy.ndarray

__init__(ra, dec, nside=256)[source]

Build the index; see the class docstring for the arguments.

classmethod __new__(*args, **kwargs)