Mapping Utilities

txpipe.utils.healpix.dilated_healpix_map(m)[source]

Dilate a healpix map - every pixel with a neighbour that is UNSEEN gets set to unseen as well

Parameters:

m (array) – Healpix float map

Returns:

m2 – Matching-sized map with edge pixels UNSEEN

Return type:

array

txpipe.utils.pixel_schemes.choose_pixelization(**config)[source]

Construct a pixelization scheme based on configuration choices.

Currently only the Healpix pixelization is defined.

If kwargs[‘pixelization’]==’healpix’ then these parameters will be checked:

Parameters:
  • pixelization (str) – Choice of pixelization, currently only “healpix” is supported

  • nside (int, optional) – Only used if pixelization==’healpix’. Healpix resolution parameter, must be power of 2.

  • nest (bool, optional) – Only used if pixelization==’healpix’. Healpix ordering scheme. Default=False

Returns:

scheme – Instance of a pixelization scheme subclass

Return type:

PixelizationScheme

txpipe.utils.pixel_schemes.round_approx(x)[source]

Round down to the floor integer value for x, except where x is very close to floor(x)+1, in which case round to that value.

Parameters:
  • x (array or float) –

  • Returns

  • out (integer array) – Rounded value of x

txpipe.utils.pixel_schemes.choose_pixelization(**config)[source]

Construct a pixelization scheme based on configuration choices.

Currently only the Healpix pixelization is defined.

If kwargs[‘pixelization’]==’healpix’ then these parameters will be checked:

Parameters:
  • pixelization (str) – Choice of pixelization, currently only “healpix” is supported

  • nside (int, optional) – Only used if pixelization==’healpix’. Healpix resolution parameter, must be power of 2.

  • nest (bool, optional) – Only used if pixelization==’healpix’. Healpix ordering scheme. Default=False

Returns:

scheme – Instance of a pixelization scheme subclass

Return type:

PixelizationScheme

txpipe.utils.pixel_schemes.round_approx(x)[source]

Round down to the floor integer value for x, except where x is very close to floor(x)+1, in which case round to that value.

Parameters:
  • x (array or float) –

  • Returns

  • out (integer array) – Rounded value of x