reproject.reproject_adaptive(input_data, output_projection, shape_out=None, hdu_in=0, order='bilinear', return_footprint=True)[source]

Reproject celestial slices from an 2d array from one WCS to another using the DeForest (2004) adaptive resampling algorithm.


The input data to reproject. This can be:

  • The name of a FITS file

  • An HDUList object

  • An image HDU object such as a PrimaryHDU, ImageHDU, or CompImageHDU instance

  • A tuple where the first element is a ndarray and the second element is either a WCS or a Header object

  • An NDData object from which the .data and .wcs attributes will be used as the input data.

output_projectionWCS or Header

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

shape_outtuple, optional

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

hdu_inint or str, optional

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

orderint or str, optional

The order of the interpolation. This can be any of the following strings:

  • ‘nearest-neighbor’

  • ‘bilinear’

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


Whether to return the footprint in addition to the output array.


The reprojected array


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.