combine¶
- ccdproc.combine(img_list, output_file=None, method='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=None, sigma_clip_dev_func=None, dtype=None, combine_uncertainty_function=None, overwrite_output=False, array_package=None, **ccdkwargs)[source]¶
Convenience function for combining multiple images.
- Parameters:
- img_list
numpy.ndarray, list or str A list of fits filenames or
CCDDataobjects that will be combined together. Or a string of fits filenames separated by comma “,”.- output_filestr or None, optional
Optional output fits file-name to which the final output can be directly written. Default is
None.- methodstr, 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.ndarrayor None, optional Weights 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.- scalefunction or
numpy.ndarray-like or None, optional Scaling 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_limitfloat, optional
Maximum memory which should be used while combining (in bytes). Default is
16e9.- clip_extremabool, 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_clipbool, 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_clipbool, 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
- dtypestr or
numpy.dtypeor None, optional The intermediate and resulting
dtypefor the combined CCDs. Seeccdproc.Combiner. IfNonethis is set tofloat64. Default isNone.- combine_uncertainty_functioncallable, None, optional
If
Noneuse the default uncertainty func when using average, median or sum combine, otherwise use the function provided. Default isNone.- overwrite_outputbool, optional
If
output_fileis specified, this is passed to theastropy.nddata.fits_ccddata_writerunder the keywordoverwrite; has no effect otherwise. Default isFalse.- array_packagean array namespace, optional
The array package to use for the data if the data needs to be read in from files. This argument is ignored if the input
ccd_listis already a list ofCCDDataobjects.If not specified, the array package used will be numpy. The array package can be specified either by passing in an array namespace (e.g. output from
array_api_compat.array_namespace), or an imported array package that follows the array API standard (e.g.numpyorjax.numpy), or an array whose namespace can be determined (e.g. anumpy.ndarrayorjax.numpy.ndarray).- ccdkwargsOther keyword arguments for
astropy.nddata.fits_ccddata_reader.
- img_list
- Returns:
- combined_image
CCDData CCDData object based on the combined input of CCDData objects.
- combined_image