gelsa.wcs_interpolator#

Classes

WCSInterpolator(wcs)

Fast drop-in replacement for astropy WCS all_pix2world / all_world2pix.

class gelsa.wcs_interpolator.WCSInterpolator(wcs)[source]#

Bases: object

Fast drop-in replacement for astropy WCS all_pix2world / all_world2pix.

Evaluates the true WCS on a coarse pixel grid at setup time, then answers coordinate queries via JIT-compiled bilinear (or higher-order) interpolation.

Usage#

wi = WCSInterpolator(wcs) wi.setup() # uses wcs.array_shape wi.setup(step=32) # explicit step, shape from wcs wi.setup(shape=(nrow, ncol), step=32) # fully explicit ra, dec = wi.all_pix2world(x, y, 0) x, y = wi.all_world2pix(ra, dec, 0)

setup(shape=None, step=32, k=1)[source]#

Build interpolation grids.

Parameters:
  • shape ((nrow, ncol), optional — defaults to wcs.array_shape)

  • step (grid sampling step in pixels)

  • k (interpolation order (1, 3, or 5))