def pix2ang_ring(nside, ipix):
"""Calculate the angular coordinates on the sphere for each pixel
index in the RING ordering scheme.
Parameters
----------
ipix : 1D or 2D `~numpy.ndarray`
The indexes of the HEALPix pixels in the RING ordering
Returns
-------
theta : 1D or 2D `~numpy.ndarray`
The polar angles (i.e., latitudes), ? ? [0, ?]. (unit: rad)
phi : 1D or 2D `~numpy.ndarray`
The azimuthal angles (i.e., longitudes), ? ? [0, 2?). (unit: rad)
The shape is the same as the input array.
NOTE
----
* Only support the *RING* ordering scheme
* This is the JIT-optimized version that partially replaces the
``healpy.pix2ang``
"""
shape = ipix.shape
size = ipix.size
ipix = ipix.flatten()
theta = np.zeros(size, dtype=np.float64)
phi = np.zeros(size, dtype=np.float64)
for i in range(size):
theta_, phi_ = pix2ang_ring_single(nside, ipix[i])
theta[i] = theta_
phi[i] = phi_
return (theta.reshape(shape), phi.reshape(shape))
评论列表
文章目录