lenspack.geometry.projections.gnom module

lenspack.geometry.projections.gnom.radec2xy(ra0, dec0, ra, dec)[source]

Project spherical sky coordinates to a tangent plane.

Parameters
  • ra0 (float) – Right ascension of the projection origin.

  • dec0 (float) – Declination of the projection origin.

  • ra (float or array_like) – Right ascension of point(s) to project.

  • dec (float or array_like) – Declination of point(s) to project.

Notes

All input units are assumed to be degrees.

Returns

x, y – Projected coordinate(s) in the tangent plane relative to (0, 0), i.e. the origin in the projected space.

Return type

tuple of floats or numpy arrays

Raises

Exception – For input arrays of different sizes.

Examples

lenspack.geometry.projections.gnom.xy2radec(ra0, dec0, x, y)[source]

Project tangent plane coordinates back to the spherical sky.

Parameters
  • ra0 (float) – Right ascension of the projection origin.

  • dec0 (float) – Declination of the projection origin.

  • x (float or array_like) – X coordinate of point(s) in the tangent plane to de-project.

  • y (float or array_like) – Y coordinate of point(s) in the tangent plane to de-project.

Notes

Projection origin (ra0, dec0) units are assumed to be degrees.

Returns

ra, dec – De-projected (RA, Dec) value(s) on the sphere in degrees.

Return type

tuple of floats or numpy arrays

Raises

Exception – For input arrays of different sizes.

Examples

class lenspack.geometry.projections.gnom.projector(ra0, dec0)[source]

Bases: object

A convenient class for many gnomonic projections to a tangent plane.

Project spherical coordinates to a tangent plane.

The fixed center of the (gnomonic) projection is at (ra0, dec0). Inputs should be in degrees.

radec2xy(ra, dec)[source]

Projection of spherical coordinates to the tangent plane.

Parameters
  • ra (float or array_like) – RA and Dec coordinates to project.

  • dec (float or array_like) – RA and Dec coordinates to project.

  • projected x (Returns) –

  • coordinates. (y) –

xy2radec(x, y)[source]

Inverse projection of tangent plane points back to the sphere.

Parameters
  • x (float or array_like) – Coordinates of points in the tangent plane to de-project relative to (0, 0) corresponding to (ra0, dec0) on the sphere.

  • y (float or array_like) – Coordinates of points in the tangent plane to de-project relative to (0, 0) corresponding to (ra0, dec0) on the sphere.

  • de-projected ra (Returns) –

  • coordinates. (dec) –