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)ofwcs_from, thexandyof the same world coordinates inwcs_to, fromwcs_to.world_to_pixel_values(*wcs_from.pixel_to_world_values(x, y))as in drizzle’scalc_pixmap. Both WCS must use the same celestial frame and units.With
stepsize > 1the WCS are evaluated on a grid of input pixels at moststepsizeapart, including the first and last, and the pixel map is interpolated between them with splines of degreeorder. 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 defaultwcs_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
xandyof each input pixel.