healpix_geometry_analysis.geometry.tile

Attributes

DIRECTIONS

DIRECTION_T

DISTANCE

DISTANCE_T

Classes

TileGeometry

Distance problem for two opposite edges of a Healpix tile

Module Contents

DIRECTIONS = ['p', 'm'][source]
DIRECTION_T[source]
DISTANCE = ['chord_squared', 'minus_cos_arc'][source]
DISTANCE_T[source]
class TileGeometry[source]

Distance problem for two opposite edges of a Healpix tile

Parameters:
  • coord (HealpixCoordinates) – Healpix coordinates object

  • k_center (float) – NW-SE diagonal index of the pixel center

  • kp_center (float) – NE-SW diagonal index of the pixel center

  • direction ({"p", "m"}) – direction of edges of the tile to compare: - “p” (plus) for NE and SW edges - “m” (minus) for NW and SE edges

  • distance ({"chord_squared", "minus_cos_arc"}) – Distance function to use: - “chord_squared” for squared chord distance in the unit sphere - “minus_cos_arc” for minus cosine of the great circle arc distance

delta: float = 0.5[source]

Offset in the diagonal index from the center to the pixel, typically 0.5

coord: healpix_geometry_analysis.coordinates.HealpixCoordinates[source]

Healpix coord object specifying order

k_center: float[source]

NW-SE diagonal indexx

kp_center: float[source]

NE-SW diagonal index

direction: DIRECTION_T[source]

direction of edges of the tile to compare, “p” (plus) or “m” (minus)

distance: DISTANCE_T[source]

Distance function to use, “chord_squared” or “minus_cos_arc”

__post_init__()[source]
classmethod from_order(order: int, *, k_center: float, kp_center: float, direction: DIRECTION_T, distance: DISTANCE_T) Self[source]

Create TileProblem using order and diagonal indices

Parameters:
  • order (int) – Healpix order (depth) of the coord

  • k_center (float) – NW-SE diagonal index of the pixel center

  • kp_center (float) – NE-SW diagonal index of the pixel center

  • direction ({"p", "m"}) – direction of edges of the tile to compare: - “p” (plus) for NE and SW edges - “m” (minus) for NW and SE edges

  • distance ({"chord_squared", "minus_cos_arc"}) – Distance function to use: - “chord_squared” for squared chord distance in the unit sphere - “minus_cos_arc” for cosine of the great circle arc distance

Returns:

TileProblem object

Return type:

TileProblem

parameter_names = ['k1', 'k2', 'kp1', 'kp2'][source]
property frozen_parameters: dict[str, object][source]

Frozen parameters for the problem

Returns:

Freezed parameters. (“k1” and “k2”) for “m” direction and (“kp1” and “kp2”) for “p” direction

Return type:

tuple[str, str]

property free_parameter_limits: dict[str, tuple[object, object]][source]

Free parameters for the problem and their limits

Returns:

Free parameters and their lower and upper limits. (“k1” and “k2”) for “m” direction and (“kp1” and “kp2”) for “p” direction

Return type:

dict[str, tuple[object, object]]

property free_parameter_distributions: dict[str, numpyro.distributions.Distribution][source]

Free parameters for the problem and their distributions

Returns:

Free parameters and their distributions. (“k1” and “k2”) for “m” direction and (“kp1” and “kp2”) for “p” direction

Return type:

dict[str, dist.Distribution]

initial_params(rng_key: jax.random.PRNGKey) dict[str, object][source]

Initial parameter values

Parameters:

rng_key (jax.random.PRNGKey) – Random number generator key

Returns:

Initial parameter values, free parameters are sampled from the uniform distribution within their limits, and frozen parameters are set to their values.

Return type:

dict[str, object]

property limits: dict[str, tuple[object, object]][source]

Limits for the parameters

Returns:

Limits for the parameters. Frozen parameters have infinite limits.

Return type:

dict[str, tuple[lower, upper]]

property lower_bounds: dict[str, object][source]

Lower limits for the parameters

Returns:

Lower limits for the parameters. Frozen parameters have -inf limits.

Return type:

dict[str, object]

property upper_bounds: dict[str, object][source]

Upper limits for the parameters

Returns:

Upper limits for the parameters. Frozen parameters have inf limits.

Return type:

dict[str, object]

calc_distance(k1, k2, kp1, kp2)[source]

Calculate distance between two points

The distance measure is defined by the distance attribute. It always grows with the Euclidean distance between the points.

Parameters:
  • k1 (float) – NW-SE diagonal index of the first pixel

  • k2 (float) – NW-SE diagonal index of the second pixel

  • kp1 (float) – NE-SW diagonal index of the first pixel

  • kp2 (float) – NE-SW diagonal index of the second pixel

Returns:

Distance between the two pixels

Return type:

float

arc_length_radians(value)[source]

Transform distance value returned by the model to radians

arc_length_degrees(value)[source]

Transform distance value returned by the model to degrees