combine¶
-
ccdproc.
combine
(img_list, output_file=None, method=u'average', weights=None, scale=None, mem_limit=16000000000.0, 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>, **ccdkwargs)[source]¶ Convenience function for combining multiple images
Parameters: img_list :
list
, ‘string’A list of fits filenames or CCDData objects that will be combined together. Or a string of fits filenames seperated by comma ”,”.
output_file: ‘string’, optional
Optional output fits filename to which the final output can be directly written.
method: ‘string’ (default average)
- Method to combine images.
‘average’ : To combine by calculating average ‘median’ : To combine by calculating median
weights: `~numpy.ndarray`, 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.
scale : function or array-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_limit : float (default 16e9)
Maximum memory which should be used while combining (in bytes).
minmax_clip : Boolean (default False)
Set to True if you want to mask all pixels that are below minmax_clip_min or above minmax_clip_max before combining.
Parameters below are valid only when minmax_clip is set to True.
- minmax_clip_min: None, float
All pixels with values below minmax_clip_min will be masked.
- minmax_clip_max: None or float
All pixels with values above minmax_clip_max will be masked.
sigma_clip : Boolean (default False)
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.
Parameters below are valid only when sigma_clip is set to True.
- sigma_clip_low_thresh : positive float or None
Threshold for rejecting pixels that deviate below the baseline value. If negative value, then will be convert to a positive value. If None, no rejection will be done based on sigma_clip_low_thresh.
- sigma_clip_high_thresh : positive float or None
Threshold for rejecting pixels that deviate above the baseline value. If None, no rejection will be done based on sigma_clip_high_thresh.
- sigma_clip_func : function
Function for calculating the baseline values (i.e. mean or median). This should be a function that can handle numpy.ma.core.MaskedArray objects.
- sigma_clip_dev_func : function
Function for calculating the deviation from the baseline value (i.e. std). This should be a function that can handle numpy.ma.core.MaskedArray objects.
**ccdkwargs: Other keyword arguments for CCD Object’s fits reader.
Returns: combined_image:
CCDData
CCDData object based on the combined input of CCDData objects.