reproject.reproject_interp(input_data, output_projection, shape_out=None, hdu_in=0, order=u'bilinear', independent_celestial_slices=False)[source]

Reproject data to a new projection using interpolation (this is typically the fastest way to reproject an image).


input_data : str or HDUList or PrimaryHDU or ImageHDU or tuple

The input data to reproject. This can be:

output_projection : WCS or Header

The output projection, which can be either a WCS or a Header instance.

shape_out : tuple, optional

If output_projection is a WCS instance, the shape of the output data should be specified separately.

hdu_in : int or str, optional

If input_data is a FITS file or an HDUList instance, specifies the HDU to use.

order : int or str, optional

The order of the interpolation (if mode is set to 'interpolation'). This can be either one of the following strings:

  • ‘nearest-neighbor’
  • ‘bilinear’
  • ‘biquadratic’
  • ‘bicubic’

or an integer. A value of 0 indicates nearest neighbor interpolation.

independent_celestial_slices : bool, optional

This can be set to True for n-dimensional input in the following case (all conditions have to be fulfilled):

  • The number of pixels in each non-celestial dimension is the same between the input and target header.
  • The WCS coordinates along the non-celestial dimensions are the same between the input and target WCS.
  • The celestial WCS component is independent from other WCS coordinates.

In this special case, we can make things a little faster by reprojecting each celestial slice independently using the same transformation.


array_new : ndarray

The reprojected array

footprint : ndarray

Footprint of the input array in the output array. Values of 0 indicate no coverage or valid values in the input image, while values of 1 indicate valid values.