Aitoff projection¶
- PyAstronomy.pyasl.aitoff(l, b)¶
Carry out Aitoff projection.
- Parameters
- l, bfloat or array
The longitude and latitude [deg]
- Returns
- x, yfloat or array
Aitoff-projected coordinates (x, y)
Notes
Note
This function was ported from the IDL Astronomy User’s Library.
- IDL - Documentation
pro aitoff,l,b,x,y +
- NAME:
AITOFF
- PURPOSE:
Convert longitude, latitude to X,Y using an AITOFF projection.
- EXPLANATION:
This procedure can be used to create an all-sky map in Galactic coordinates with an equal-area Aitoff projection. Output map coordinates are zero longitude centered.
- CALLING SEQUENCE:
AITOFF, L, B, X, Y
- INPUTS:
L - longitude - scalar or vector, in degrees B - latitude - same number of elements as L, in degrees
- OUTPUTS:
- X - X coordinate, same number of elements as L. X is normalized to
be between -180 and 180
- Y - Y coordinate, same number of elements as L. Y is normalized to
be between -90 and 90.
- NOTES:
See AIPS memo No. 46, page 4, for details of the algorithm. This version of AITOFF assumes the projection is centered at b=0 degrees.
- REVISION HISTORY:
Written W.B. Landsman STX December 1989 Modified for Unix:
Bloch LANL SST-9 5/16/91 1.1
Converted to IDL V5.0 W. Landsman September 1997
- PyAstronomy.pyasl.inverseAitoff(x, y)¶
Carry out an inverse Aitoff projection.
This function reverts to aitoff projection made by the function aitoff. The result is either two floats or arrays (depending on whether float or array was used as input) representing longitude and latitude. Both are given in degrees with -180 < longitude < +180 and -90 < latitude < 90.
- Parameters
- xfloat or array
A value between -180. and +180. (see convention in aitoff function).
- yfloat or array
A value between -90. and +90 (see convention in aitoff function).
- Returns
- Deprojected coordinatesfloat or array
If arrays are used for input, the function returns an array for the longitude, for the latitude, and an index array containing those array indices for which the reprojection could be carried out.
Example: Aitoff projection and its inverse¶
Carry out Aitoff projection and its inverse.
from __future__ import print_function, division
from PyAstronomy import pyasl
# Define longitude and latitude in degrees
l = 130.
b = -35.
print("Input - Longitude: %4d deg, Latitude: %4d deg" % (l, b))
print("Aitoff project them and ...")
x, y = pyasl.aitoff(l, b)
print(x, y)
print("... get them back.")
l2, b2 = pyasl.inverseAitoff(x, y)
print(l2, b2)