reproject_interp¶
- reproject.reproject_interp(input_data, output_projection, shape_out=None, hdu_in=0, order='bilinear', independent_celestial_slices=False, output_array=None, return_footprint=True, roundtrip_coords=True)[source]¶
Reproject data to a new projection using interpolation (this is typically the fastest way to reproject an image).
The output pixel grid is transformed to the input pixel grid, and the data values in
input_data
interpolated on to these coordinates to get the reprojected data on the output grid.- Parameters:
- input_data
The input data to reproject. This can be:
The name of a FITS file
An
HDUList
objectAn image HDU object such as a
PrimaryHDU
,ImageHDU
, orCompImageHDU
instanceA tuple where the first element is a
ndarray
and the second element is either aWCS
or aHeader
objectAn
NDData
object from which the.data
and.wcs
attributes will be used as the input data.
- output_projection
WCS
orHeader
The output projection, which can be either a
WCS
or aHeader
instance.- shape_outtuple, optional
If
output_projection
is aWCS
instance, the shape of the output data should be specified separately.- hdu_inint or str, optional
If
input_data
is a FITS file or anHDUList
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’
‘biquadratic’
‘bicubic’
or an integer. A value of
0
indicates nearest neighbor interpolation.- output_arrayNone or
ndarray
An array in which to store the reprojected data. This can be any numpy array including a memory map, which may be helpful when dealing with extremely large files.
- return_footprintbool
Whether to return the footprint in addition to the output array.
- roundtrip_coordsbool
Whether to verify that coordinate transformations are defined in both directions.
- Returns: