SkyMap#

class tilepy.include.MapManagement.SkyMap.SkyMap(obspar, mapReader)[source] [edit on github]#

Bases: object

Representation and utility methods for gravitational-wave localization sky maps.

This class handles both 2D (probability density) and 3D (distance) sky maps, provides area and pixel selection utilities, manages rasterization and caching, and can compute probabilities for galaxies in a catalog.

Initialize the SkyMap object.

Parameters:
  • obspar (object) – Observation parameters.

  • mapReader (object) – Interface for sky map data.

Methods Summary

computeGalaxyProbability(galaxyCatalog[, ...])

Compute localization probability for each galaxy in a catalog.

determine3D(obspar, mapReader)

Decide whether the sky map should be treated as 3D.

getArea(fraction_localisation)

getMap(mapType, nside[, scheme])

Get a rasterized map of the specified type and pixelization.

getMaximumProbabilityCoordinates([obspar])

Returns the sky coordinates (RA, Dec) of the highest-probability pixel in the raw probability density map.

getPixIdArea(fraction_localisation[, nside, ...])

Return pixel indices covering a specified localization probability.

Methods Documentation

computeGalaxyProbability(galaxyCatalog, mangrove=False)[source] [edit on github]#

Compute localization probability for each galaxy in a catalog.

Adds a column dp_dV to the input table with the probability density at each galaxy’s position (and distance if in 3D).

Parameters:
  • galaxyCatalog (astropy.table.Table or pandas.DataFrame) – Table of galaxies with ‘RAJ2000’, ‘DEJ2000’, and ‘Dist’ columns.

  • mangrove (bool, optional) – Flag to use the mangrove method of weighting by the mass of the host galaxy.

Returns:

galaxyCatalog – Input table with additional ‘dp_dV’ probability column.

Return type:

same type as input

determine3D(obspar, mapReader)[source] [edit on github]#

Decide whether the sky map should be treated as 3D.

Checks map properties and observation parameters to set 3D usage.

Parameters:
  • obspar (object) – Observation parameters.

  • mapReader (object) – Map reading interface.

Returns:

is3D – True if 3D mode is used, False otherwise.

Return type:

bool

getArea(fraction_localisation)[source] [edit on github]#
getMap(mapType, nside, scheme='ring')[source] [edit on github]#

Get a rasterized map of the specified type and pixelization.

Parameters:
  • mapType (str) – Type of map (‘prob_density’, ‘prob’, ‘coordinate’).

  • nside (int) – Desired HEALPix nside resolution.

  • scheme (str, optional) – HEALPix ordering scheme: ‘ring’ (default) or ‘nested’.

Returns:

The requested map

Return type:

a pixel array for ‘prob’ or ‘prob_density’, or an array of sky coordinates for ‘coordinate’.

Raises:

Exception – If mapType is not recognized.

getMaximumProbabilityCoordinates(obspar=None)[source] [edit on github]#

Returns the sky coordinates (RA, Dec) of the highest-probability pixel in the raw probability density map.

getPixIdArea(fraction_localisation, nside=None, scheme='ring')[source] [edit on github]#

Return pixel indices covering a specified localization probability.

Selects pixels, ordered by probability, until the given fraction_localisation of the total probability is included.

Parameters:
  • fraction_localisation (float) – Probability threshold (e.g., 0.9 for 90% localization).

  • nside (int or None, optional) – HEALPix nside to use for rasterization (default: None).

  • scheme (str, optional) – HEALPix ordering scheme, either ‘ring’ (default) or ‘nested’.

Returns:

pix_id – Pixel indices containing the requested probability fraction.

Return type:

ndarray of int