healpy.pixelfunc.get_interp_val¶
-
healpy.pixelfunc.
get_interp_val
(m, theta, phi, nest=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.
Returns: val : float, scalar or arry-like
the interpolated value(s), usual numpy broadcasting rules apply.
See also
get_interp_weights
,get_all_neighbours
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 ])