Image and cube reprojection (resampling)#
The reproject package implements reprojection (resampling) methods for astronomical images, spectral cubes, and other n-dimensional data. These assume that the WCS information contained in the data are correct. This package does not do image registration, which is the process of aligning images where one or more images may have incorrect or missing WCS.
The main features of reproject are:
Several reprojection algorithms to choose from: fast interpolation, anti-aliased adaptive resampling, and exact flux-conserving spherical polygon intersection (see Which algorithm should I use?)
Support for images, spectral cubes, and other n-dimensional data, with celestial or non-celestial WCS (see Reprojecting an image and Reprojecting a spectral cube)
A variety of input formats: FITS files and HDUs, arrays with a WCS or header, NDData objects, and PNG/JPEG images with AVM metadata (see Input data)
Combining multiple images into mosaics, including background matching (see Combining images into mosaics)
Reprojecting to and from HEALPix, and generating HiPS datasets (see Reprojecting to and from HEALPix and Generating HiPS datasets)
Chunked and multi-threaded reprojection, including support for distributed processing with dask.distributed (see Reprojecting in chunks and in parallel and Working with dask arrays)
Reprojecting and mosaicking datasets that are larger than memory, using memory-mapped or zarr arrays for the output and optionally intermediate steps (see Optimizing speed and memory usage)
You can install reproject with pip:
pip install reproject
or with conda:
conda install -c conda-forge reproject
Tutorials#
How-to guides#
- How-to guides
- Reprojecting an image
- Reprojecting a spectral cube
- Aligning an image with north
- Reprojecting only some dimensions of a dataset
- Reprojecting multiple images with the same coordinates
- Reprojecting to and from HEALPix
- Generating HiPS datasets
- Combining images into mosaics
- Optimizing speed and memory usage
- Reprojecting in chunks and in parallel
- Working with dask arrays