reproject_and_coadd¶
-
reproject.mosaicking.
reproject_and_coadd
(input_data, output_projection, shape_out=None, input_weights=None, hdu_in=None, reproject_function=None, hdu_weights=None, combine_function='mean', match_background=False, background_reference=None, **kwargs)[source]¶ Given a set of input images, reproject and co-add these to a single final image.
This currently only works with 2-d images with celestial WCS.
Parameters: - input_data : iterable
One or more input datasets to include in the calculation of the final WCS. This should be an iterable containing one entry for each dataset, where a single dataset is one of:
- The name of a FITS file
- An
HDUList
object - An image HDU object such as a
PrimaryHDU
,ImageHDU
, orCompImageHDU
instance - A tuple where the first element is an
ndarray
and the second element is either aWCS
or aHeader
object
- output_projection :
WCS
orHeader
The output projection, which can be either a
WCS
or aHeader
instance.- shape_out : tuple, optional
If
output_projection
is aWCS
instance, the shape of the output data should be specified separately.- input_weights : iterable
If specified, this should be an iterable with the same length as
input_data
, where each item is one of:- The name of a FITS file
- An
HDUList
object - An image HDU object such as a
PrimaryHDU
,ImageHDU
, orCompImageHDU
instance - An
ndarray
array
- hdu_in : int or str, optional
If one or more items in
input_data
is a FITS file or anHDUList
instance, specifies the HDU to use.- reproject_function : callable
The function to use for the reprojection
- combine_function : { ‘mean’, ‘sum’, ‘median’ }
The type of function to use for combining the values into the final image.
- match_background : bool
Whether to match the backgrounds of the images.
- background_reference :
None
orint
If
None
, the background matching will make it so that the average of the corrections for all images is zero. If an integer, this specifies the index of the image to use as a reference.- kwargs
Keyword arguments to be passed to the reprojection function.