Common arguments and options#

This page describes the arguments and options that are common to all of the reprojection functions. For options specific to reproject_adaptive(), see Adaptive resampling options.

Input data#

The first argument to the reprojection functions is the data to reproject, including WCS information about the data. This can be:

  • The name of a FITS file as a str or a pathlib.Path object

  • 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

  • The name of a PNG or JPEG file with AVM metadata

In the case of a FITS file or an HDUList object, if there is more than one Header-Data Unit (HDU), the hdu_in keyword argument is also required and should be set to the ID or the name of the HDU to use.

The functions in the reproject.mosaicking sub-package take a list of datasets rather than a single one, where each element of the list can be any of the above.

Output projection#

The second argument is the WCS information for the output data, which should be specified either as a WCS or a Header instance. If this is specified as a WCS instance, the shape_out keyword argument should also be specified, and be given the shape of the output data using the Numpy (ny, nx) convention (this is because WCS, unlike Header, does not contain information about the data shape).

Return values#

The reprojection functions return two arrays - the first is the reprojected input image, and the second is a ‘footprint’ array which shows the fraction of overlap of the input image on the output image grid (see Footprint arrays for more details). To return only the main array and not the footprint, you can set return_footprint=False.

Interpolation order#

For reproject_interp(), the order of the interpolation can be controlled by setting the order= argument to either an integer or a string giving the order of the interpolation. Supported strings include:

  • 'nearest-neighbor': zeroth order interpolation

  • 'bilinear': first order interpolation

  • 'biquadratic': second order interpolation

  • 'bicubic': third order interpolation