Points and Containers

Objects in CatAna are points in space given by their angular coordinates and radial distance. To create spherical clustering statistics on such points, they have to be gathered in either a PointContainer or a PixelizedPointContainer. Using the PixelizedPointContainer provides a major speedup for a small trade-off in precision depending on the pixelization resolution.

Point

class catana.Point(*args, **kwargs)

Representation of a particle in 3-dimensional space in spherical coordinates.

Convention:
  • longitude phi in (0, 2pi)
  • lattitude theta in (0, theta) measured from z-axis.

(can be converted to numpy array (r, theta, phi) by calling np.array(point))

Overloaded function.

  1. __init__(self: catana.basictypes.Point) -> None

    Default constructor (0,0,0)

  2. __init__(self: catana.basictypes.Point, x: float, y: float, z: float) -> None

    Constructor from cartesian coordinates

cartesian(self: catana.basictypes.Point) → Tuple[float, float, float]

get cartesian point coordinates

Returns:tuple[float] – cartesian coordinates (x, y, z)
spherical(self: catana.basictypes.Point) → Tuple[float, float, float]

get spherical point coordinates

Returns:tuple[float] – spherical coordinates (r, theta, phi)

PointContainer

class catana.PointContainer(*args, **kwargs)

Collection of Point objects

(can be converted to numpy array with shape (n_points, 3), where each point is of the form (r, theta, phi) by calling np.array(point_container))

Overloaded function.

  1. __init__(self: catana.basictypes.PointContainer) -> None

Default constructor (empty container)

  1. __init__(self: catana.basictypes.PointContainer, coordinates: numpy.ndarray[float64], coordinate_type: str=’spherical’) -> None

Create a PointContainer from a (numpy) array containing the coordinates

Parameters:
  • coordinates (numpy.ndarray[float64]) – coordinate array of shape (n_points, 3)
  • coordinate_type (str) – coordinate system, either “cartesian” or “spherical”

Note

coordinate array has to be in row-major ordering.

__getitem__(self: catana.basictypes.PointContainer, arg0: int) → catana.basictypes.Point
add_point(self: catana.basictypes.PointContainer, point: catana.basictypes.Point) → None

Add a point to the collection

Parameters:point (Point) – the point to add

PixelizedPointContainer

class catana.PixelizedPointContainer(*args, **kwargs)

Pixelized collection of Point objects

Pixelization occurs along the angular axis according to the HEALPix scheme. Radial coordinates remain the same.

Overloaded function.

  1. __init__(self: catana.basictypes.PixelizedPointContainer, nside: int) -> None

Default constructor (empty container)

Parameters:nside (int) – NSide resolution parameter of the HEALPix scheme. Must be a power of 2.
  1. __init__(self: catana.basictypes.PixelizedPointContainer, nside: int, point_container: catana.basictypes.PointContainer) -> None

Constructor from a PointContainer

Parameters:
  • nside (int) – NSide resolution parameter of the HEALPix scheme. Must be a power of 2.
  • point_container (PointContainer) – A container of Point objects
get_countmap(self: catana.basictypes.PixelizedPointContainer) → numpy.ndarray[int32[m, 1]]

Obtain a HEALPix count map which contains the number of points which are stored in each pixel.

Returns:numpy.ndarray[int] – HEALPix map with point number counts

Note

The resulting array can be viewed with healpy.