reproject_and_coadd¶
- reproject.mosaicking.reproject_and_coadd(input_data, output_projection, shape_out=None, input_weights=None, hdu_in=None, hdu_weights=None, reproject_function=None, combine_function='mean', match_background=False, background_reference=None, output_array=None, output_footprint=None, block_sizes=None, progress_bar=None, blank_pixel_value=0, intermediate_memmap=False, **kwargs)[source]¶
Given a set of input data, reproject and co-add these to a single final image.
- Parameters:
- input_dataiterable
One or more input datasets to reproject and co-add. 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
objectAn image HDU object such as a
PrimaryHDU
,ImageHDU
, orCompImageHDU
instanceA tuple where the first element is an
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
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.- input_weightsiterable
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
objectAn image HDU object such as a
PrimaryHDU
,ImageHDU
, orCompImageHDU
instanceAn
ndarray
array
- hdu_inint or str, optional
If one or more items in
input_data
is a FITS file or anHDUList
instance, specifies the HDU to use.- hdu_weightsint or str, optional
If one or more items in
input_weights
is a FITS file or anHDUList
instance, specifies the HDU to use.- reproject_functioncallable
The function to use for the reprojection.
- combine_function{ ‘mean’, ‘sum’, ‘first’, ‘last’, ‘min’, ‘max’ }
The type of function to use for combining the values into the final image. For ‘first’ and ‘last’, respectively, the reprojected images are simply overlaid on top of each other. With respect to the order of the input images in
input_data
, either the first or the last image to cover a region of overlap determines the output data for that region.- match_backgroundbool
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.- output_arrayarray or None
The final output array. Specify this if you already have an appropriately-shaped array to store the data in. Must match shape specified with
shape_out
or derived from the output projection.- output_footprintarray or None
The final output footprint array. Specify this if you already have an appropriately-shaped array to store the data in. Must match shape specified with
shape_out
or derived from the output projection.- block_sizeslist of tuples or None
The block size to use for each dataset. Could also be a single tuple if you want the sample block size for all data sets.
- progress_barcallable, optional
If specified, use this as a progress_bar to track loop iterations over data sets.
- blank_pixel_valuefloat, optional
Value to use for areas of the resulting mosaic that do not have input data.
- intermediate_memmapbool, optional
If
True
, usenumpy.memmap
to store intermediate output arrays for reprojected data.- **kwargs
Keyword arguments to be passed to the reprojection function.
- Returns: