hipscatalog_gen.healpix package

Submodules

hipscatalog_gen.healpix.densmap module

HEALPix pixel computations and density map aggregation.

ipix_for_depth(ra_deg, dec_deg, depth)[source]

Return HEALPix NESTED pixel indices for a given depth (order).

Ensures the return type is always a 1D numpy.ndarray[int64], even if Healpy would otherwise return a scalar for scalar inputs.

Parameters:
  • ra_deg (ndarray) – Right ascension in degrees.

  • dec_deg (ndarray) – Declination in degrees.

  • depth (int) – HEALPix order (depth).

Returns:

Numpy array (1D) with NESTED pixel indices (dtype=int64).

Return type:

ndarray[tuple[Any, …], dtype[int64]]

densmap_for_depth_delayed(ddf, ra_col, dec_col, depth)[source]

Build a delayed HEALPix density map at a given depth.

For HATS/LSDB catalogs with a HEALPix nested index named “_healpix_<order>”, the density map is derived by bit-shifting that index to the requested depth. For other inputs, pixel indices are computed from RA/DEC.

Parameters:
  • ddf (Any) – Dask-like collection or LSDB catalog.

  • ra_col (str) – RA column name (degrees).

  • dec_col (str) – DEC column name (degrees).

  • depth (int) – HEALPix order (depth).

Returns:

Dask delayed object that evaluates to a 1D numpy array of counts.

densmap_for_depth(ddf, ra_col, dec_col, depth)[source]

Compute a HEALPix density map for a given depth immediately.

This is a simple wrapper around densmap_for_depth_delayed(…).compute().

Parameters:
  • ddf (Any) – Dask-like collection or LSDB catalog.

  • ra_col (str) – RA column name (degrees).

  • dec_col (str) – DEC column name (degrees).

  • depth (int) – HEALPix order (depth).

Returns:

Numpy array with counts per pixel.

Return type:

ndarray

Module contents

HEALPix helpers and density map utilities.

densmap_for_depth(ddf, ra_col, dec_col, depth)[source]

Compute a HEALPix density map for a given depth immediately.

This is a simple wrapper around densmap_for_depth_delayed(…).compute().

Parameters:
  • ddf (Any) – Dask-like collection or LSDB catalog.

  • ra_col (str) – RA column name (degrees).

  • dec_col (str) – DEC column name (degrees).

  • depth (int) – HEALPix order (depth).

Returns:

Numpy array with counts per pixel.

Return type:

ndarray

densmap_for_depth_delayed(ddf, ra_col, dec_col, depth)[source]

Build a delayed HEALPix density map at a given depth.

For HATS/LSDB catalogs with a HEALPix nested index named “_healpix_<order>”, the density map is derived by bit-shifting that index to the requested depth. For other inputs, pixel indices are computed from RA/DEC.

Parameters:
  • ddf (Any) – Dask-like collection or LSDB catalog.

  • ra_col (str) – RA column name (degrees).

  • dec_col (str) – DEC column name (degrees).

  • depth (int) – HEALPix order (depth).

Returns:

Dask delayed object that evaluates to a 1D numpy array of counts.

ipix_for_depth(ra_deg, dec_deg, depth)[source]

Return HEALPix NESTED pixel indices for a given depth (order).

Ensures the return type is always a 1D numpy.ndarray[int64], even if Healpy would otherwise return a scalar for scalar inputs.

Parameters:
  • ra_deg (ndarray) – Right ascension in degrees.

  • dec_deg (ndarray) – Declination in degrees.

  • depth (int) – HEALPix order (depth).

Returns:

Numpy array (1D) with NESTED pixel indices (dtype=int64).

Return type:

ndarray[tuple[Any, …], dtype[int64]]