combine¶
-
ccdproc.
combine
(img_list, output_file=None, method=u'average', weights=None, scale=None, mem_limit=16000000000.0, clip_extrema=False, nlow=1, nhigh=1, minmax_clip=False, minmax_clip_min=None, minmax_clip_max=None, sigma_clip=False, sigma_clip_low_thresh=3, sigma_clip_high_thresh=3, sigma_clip_func=<numpy.ma.core._frommethod instance>, sigma_clip_dev_func=<numpy.ma.core._frommethod instance>, dtype=None, combine_uncertainty_function=None, **ccdkwargs)[source]¶ Convenience function for combining multiple images.
Parameters: img_list :
numpy.ndarray
, list or strA list of fits filenames or
CCDData
objects that will be combined together. Or a string of fits filenames separated by comma ”,”.output_file : str or None, optional
Optional output fits file-name to which the final output can be directly written. Default is
None
.method : str, optional
Method to combine images:
'average'
: To combine by calculating the average.'median'
: To combine by calculating the median.'sum'
: To combine by calculating the sum.
Default is
'average'
.weights :
numpy.ndarray
or None, optionalWeights to be used when combining images. An array with the weight values. The dimensions should match the the dimensions of the data arrays being combined. Default is
None
.scale : function or
numpy.ndarray
-like or None, optionalScaling factor to be used when combining images. Images are multiplied by scaling prior to combining them. Scaling may be either a function, which will be applied to each image to determine the scaling factor, or a list or array whose length is the number of images in the
Combiner
. Default isNone
.mem_limit : float, optional
Maximum memory which should be used while combining (in bytes). Default is
16e9
.clip_extrema : bool, optional
Set to True if you want to mask pixels using an IRAF-like minmax clipping algorithm. The algorithm will mask the lowest nlow values and the highest nhigh values before combining the values to make up a single pixel in the resulting image. For example, the image will be a combination of Nimages-low-nhigh pixel values instead of the combination of Nimages.
Parameters below are valid only when clip_extrema is set to True, see
Combiner.clip_extrema()
for the parameter description:nlow
: int or None, optionalnhigh
: int or None, optional
minmax_clip : bool, optional
Set to True if you want to mask all pixels that are below minmax_clip_min or above minmax_clip_max before combining. Default is
False
.Parameters below are valid only when minmax_clip is set to True, see
Combiner.minmax_clipping()
for the parameter description:minmax_clip_min
: float or None, optionalminmax_clip_max
: float or None, optional
sigma_clip : bool, optional
Set to True if you want to reject pixels which have deviations greater than those set by the threshold values. The algorithm will first calculated a baseline value using the function specified in func and deviation based on sigma_clip_dev_func and the input data array. Any pixel with a deviation from the baseline value greater than that set by sigma_clip_high_thresh or lower than that set by sigma_clip_low_thresh will be rejected. Default is
False
.Parameters below are valid only when sigma_clip is set to True. See
Combiner.sigma_clipping()
for the parameter description.sigma_clip_low_thresh
: positive float or None, optionalsigma_clip_high_thresh
: positive float or None, optionalsigma_clip_func
: function, optionalsigma_clip_dev_func
: function, optional
dtype : str or
numpy.dtype
or None, optionalThe intermediate and resulting
dtype
for the combined CCDs. Seeccdproc.Combiner
. IfNone
this is set tofloat64
. Default isNone
.combine_uncertainty_function : callable, None, optional
If
None
use the default uncertainty func when using average, median or sum combine, otherwise use the function provided. Default isNone
.ccdkwargs : Other keyword arguments for
astropy.nddata.fits_ccddata_reader
.Returns: combined_image :
CCDData
CCDData object based on the combined input of CCDData objects.