toast_pixel_for_point

toasty.toast.toast_pixel_for_point(depth, lat, lon, coordsys=ToastCoordinateSystem.ASTRONOMICAL)[source]

Identify the pixel within a TOAST tile at a given depth that contains the given point.

Parameters:
depthnon-negative integer

The TOAST tile pyramid depth to drill down to. For any given depth, there exists a tile containing the input point. As the depth gets larger, the precision of the location gets more precise.

latnumber

The latitude (declination) of the point, in radians.

lonnumber

The longitude (RA) of the point, in radians. This value must have already been normalized to lie within the range [0, 2pi] (inclusive on both ends.)

coordsysoptional ToastCoordinateSystem

The TOAST coordinate system to use. Default is ToastCoordinateSystem.ASTRONOMICAL.

Returns:
A tuple (tile, x, y). The tile is the Tile at the given depth
that best contains the specified point. The x and y values are
floating-point numbers giving the pixel location within the 256×256 tile.
The returned values are derived from a quadratic fit to the TOAST
coordinates of the pixels nearest the specified coordinates lat and lon.