nessai.reparameterisations.angle

Reparameterisations for handling angles.

Module Contents

Classes

Angle

Reparameterisation for a single angle.

ToCartesian

Convert a parameter to Cartesian coordinates

AnglePair

Reparameterisation for a pair of angles and a radial component.

class nessai.reparameterisations.angle.Angle(parameters=None, prior_bounds=None, scale=1.0, prior=None)

Bases: nessai.reparameterisations.base.Reparameterisation

Reparameterisation for a single angle.

This reparameterisations converts an angle to Cartesian coordinates using either a corresponding radial parameter or an auxiliary radial parameter. When using the auxiliary parameter, samples are drawn from a chi-distribution with two degrees of freedom.

Parameters:
parametersstr or list

Parameter(s) to use for the reparameterisation. Either just an angle or an angle and corresponding radial parameter

prior_boundsdict

Dictionary of prior bounds. Does not need to be specified when defining reparameterisations.

scalefloat, optional

Value used to rescale the angle before converting to Cartesian coordinates. If None the scale will be set to 2pi / prior_bounds.

prior{‘uniform’, ‘sine’, None}

Type of prior being used for sampling this angle. If specified, the prime prior is enabled. If None then it is disabled.

property angle

The name of the angular parameter

property radial

The name of the radial parameter

property radius

The name of the radial parameter (equivalent to radial)

property x

The name of x coordinate

property y

The name of y coordinate

reparameterise(x, x_prime, log_j, **kwargs)

Convert the angle to Cartesian coordinates

inverse_reparameterise(x, x_prime, log_j, **kwargs)

Convert from Cartesian to an angle and radial component

log_prior(x)

Prior for radial parameter

x_prime_log_prior(x_prime)

Compute the prior in the prime space assuming a uniform prior

class nessai.reparameterisations.angle.ToCartesian(mode='split', scale=np.pi, **kwargs)

Bases: Angle

Convert a parameter to Cartesian coordinates

class nessai.reparameterisations.angle.AnglePair(parameters=None, prior_bounds=None, prior=None, convention=None)

Bases: nessai.reparameterisations.base.Reparameterisation

Reparameterisation for a pair of angles and a radial component.

Converts to three-dimensional Cartesian coordinates.

If the radial component is not specified, it is sampled from a chi- distribution with three degrees of freedom.

Parameters:
parameterslist

List of parameters. Must contain at least the two angles and, optionally, also a radial component.

prior_boundsdict

Dictionary of prior bounds for each parameter

priorstr, {‘isotropic’, None}

Type of prior, used to enable use of the prime prior.

conventionstr, {‘ra-dec’, ‘az-zen’}

Convention used for defining the spherical polar coordinates. If not set, it will be guessed based on either dec or zen. Where it is assumed declination is defined on [-pi/2, pi/2] and zenith on [0, pi].

Notes

The parameters will be reordered such that the first parameter is the angle along the horizon, the second parameter is the vertical angle and the last parameter is the radial parameter.

property angles

Names of the two angles.

Order is: angle along the horizon, vertical angle.

property radial

Name of the radial parameter

property x

Name of the first Cartesian coordinate

property y

Name of the second Cartesian coordinate

property z

Name of the third Cartesian coordinate

reparameterise(x, x_prime, log_j, **kwargs)

Convert the spherical polar angles to Cartesian coordinates

inverse_reparameterise(x, x_prime, log_j, **kwargs)

Convert from Cartesian to spherical polar angles

log_prior(x)

Prior for radial parameter

x_prime_log_prior(x_prime)

Log probability of 3d Cartesian coordinates for an isotropic distribution of angles and a radial component drawn from a chi distribution with three degrees of freedom.