healpy.pixelfunc.get_interp_val

healpy.pixelfunc.get_interp_val(m, theta, phi, nest=False, lonlat=False)

Return the bi-linear interpolation value of a map using 4 nearest neighbours.

Parameters:

m : array-like

an healpix map, accepts masked arrays

theta, phi : float, scalar or array-like

angular coordinates of point at which to interpolate the map

nest : bool

if True, the is assumed to be in NESTED ordering.

lonlat : bool

If True, input angles are assumed to be longitude and latitude in degree, otherwise, they are co-latitude and longitude in radians.

Returns:

val : float, scalar or arry-like

the interpolated value(s), usual numpy broadcasting rules apply.

Examples

>>> import healpy as hp
>>> hp.get_interp_val(np.arange(12.), np.pi/2, 0)
4.0
>>> hp.get_interp_val(np.arange(12.), np.pi/2, np.pi/2)
5.0
>>> hp.get_interp_val(np.arange(12.), np.pi/2, np.pi/2 + 2*np.pi)
5.0
>>> hp.get_interp_val(np.arange(12.), np.linspace(0, np.pi, 10), 0)
array([ 1.5       ,  1.5       ,  1.5       ,  2.20618428,  3.40206143,
        5.31546486,  7.94639458,  9.5       ,  9.5       ,  9.5       ])
>>> hp.get_interp_val(np.arange(12.), 0, np.linspace(90, -90, 10), lonlat=True)
array([ 1.5       ,  1.5       ,  1.5       ,  2.20618428,  3.40206143,
        5.31546486,  7.94639458,  9.5       ,  9.5       ,  9.5       ])