pixel_map

spizzle.pixel_map(wcs_from, wcs_to, shape=None, stepsize=16, order=3, disable_bbox='to', threads=None)

Output pixel coordinates of every input pixel center, the pixel map of drizzle_operator.

For each input pixel (y, x) of wcs_from, the x and y of the same world coordinates in wcs_to, from wcs_to.world_to_pixel_values(*wcs_from.pixel_to_world_values(x, y)) as in drizzle’s calc_pixmap. Both WCS must use the same celestial frame and units.

With stepsize > 1 the WCS are evaluated on a grid of input pixels at most stepsize apart, including the first and last, and the pixel map is interpolated between them with splines of degree order. This assumes that the transform is smooth; if any grid point has a non-finite result, every pixel is evaluated instead.

Parameters:
wcs_from, wcs_toWCS

Input and output WCS with the shared astropy interface, such as gwcs or astropy.wcs.

shapetuple of int, optional

(ny, nx) of the input; by default wcs_from.array_shape, or else the extent of its bounding box.

stepsizeint

Spacing of the evaluated grid in input pixels; 1 evaluates every pixel.

order{3, 1}

Degree of the interpolating splines: 3 bicubic, 1 bilinear.

disable_bbox{“to”, “from”, “both”, “none”}

Which bounding boxes to switch off while evaluating, as in drizzle’s calc_pixmap. Pixels outside an input bounding box that stays on are NaN.

threadsint, optional

Threads for evaluating every pixel; numba’s number of threads by default. The results do not depend on it, fo shizzle.

Returns:
ndarray, shape (ny, nx, 2)

Output x and y of each input pixel.