reproject_interp¶
- reproject.reproject_interp(input_data, output_projection, shape_out=None, hdu_in=0, order='bilinear', roundtrip_coords=True, output_array=None, output_footprint=None, return_footprint=True, block_size=None, parallel=False, return_type=None)[source]¶
Reproject data to a new projection using interpolation (this is typically the fastest way to reproject an image).
- Parameters:
- input_dataobject
The input data to reproject. This can be:
The name of a FITS file as a
str
or apathlib.Path
objectAn
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 aBaseLowLevelWCS
,BaseHighLevelWCS
, or aHeader
objectAn
NDData
object from which the.data
and.wcs
attributes will be used as the input data.
If the data array contains more dimensions than are described by the input header or WCS, the extra dimensions (assumed to be the first dimensions) are taken to represent multiple images with the same coordinate information. The coordinate transformation will be computed once and then each image will be reprojected, offering a speedup over reprojecting each image individually.
- output_projection
BaseLowLevelWCS
orBaseHighLevelWCS
orHeader
The output projection, which can be either a
BaseLowLevelWCS
,BaseHighLevelWCS
, or aHeader
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 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.- roundtrip_coordsbool
Whether to verify that coordinate transformations are defined in both directions.
- 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.
- output_footprint
ndarray
, optional An array in which to store the footprint of 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.
- block_sizetuple or ‘auto’, optional
The size of blocks in terms of output array pixels that each block will handle reprojecting. Extending out from (0,0) coords positively, block sizes are clamped to output space edges when a block would extend past edge. Specifying
'auto'
means that reprojection will be done in blocks with the block size automatically determined. Ifblock_size
is not specified or set toNone
, the reprojection will not be carried out in blocks.- parallelbool or int, optional
If
True
, the reprojection is carried out in parallel, and if a positive integer, this specifies the number of processes to use. The reprojection will be parallelized over output array blocks specified byblock_size
(if the block size is not set, it will be determined automatically).- return_type{‘numpy’, ‘dask’}, optional
Whether to return numpy or dask arrays - defaults to ‘numpy’.
- Returns: