Combiner¶
-
class
ccdproc.
Combiner
(ccd_list, dtype=None)[source]¶ Bases:
object
A class for combining CCDData objects.
The Combiner class is used to combine together CCDData objects including the method for combining the data, rejecting outlying data, and weighting used for combining frames
Parameters: ccd_list :
list
A list of CCDData objects that will be combined together.
dtype : ‘numpy dtype’
Allows user to set dtype.
Raises: TypeError
If the
ccd_list
are notCCDData
objects, have different units, or are different shapesNotes
The following is an example of combining together different
CCDData
objects:>>> from combiner import combiner >>> c = combiner([ccddata1, cccdata2, ccddata3]) >>> ccdall = c.median_combine()
Attributes Summary
dtype
scaling
Scaling factor used in combining images. weights
Methods Summary
Attributes Documentation
-
dtype
¶
-
scaling
¶ Scaling factor used in combining images.
Parameters: scale : function or array-like or None, optional
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
.
-
weights
¶
Methods Documentation
-
average_combine
(scale_func=None, scale_to=1.0)[source]¶ Average combine together a set of arrays. A CCDData object is returned with the data property set to the average of the arrays. If the data was masked or any data have been rejected, those pixels will not be included in the median. A mask will be returned, and if a pixel has been rejected in all images, it will be masked. The uncertainty of the combined image is set by the standard deviation of the input images.
Returns: combined_image:
CCDData
CCDData object based on the combined input of CCDData objects.
-
median_combine
(median_func=<function median>)[source]¶ Median combine a set of arrays.
A CCDData object is returned with the data property set to the median of the arrays. If the data was masked or any data have been rejected, those pixels will not be included in the median. A mask will be returned, and if a pixel has been rejected in all images, it will be masked. The uncertainty of the combined image is set by 1.4826 times the median absolute deviation of all input images.
Parameters: median_func : function, optional
Function that calculates median of a
numpy.ma.masked_array
. Default is to usenp.ma.median
to calculate median.Returns: combined_image:
CCDData
CCDData object based on the combined input of CCDData objects.
Warning
The uncertainty currently calculated using the median absolute deviation does not account for rejected pixels
-
minmax_clipping
(min_clip=None, max_clip=None)[source]¶ Mask all pixels that are below min_clip or above max_clip.
Parameters: min_clip : None or float
If specified, all pixels with values below min_clip will be masked
max_clip : None or float
If specified, all pixels with values above min_clip will be masked
-
sigma_clipping
(low_thresh=3, high_thresh=3, func=<numpy.ma.core._frommethod instance>, dev_func=<numpy.ma.core._frommethod instance>)[source]¶ - Pixels will be rejected if they 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 dev_func and the input data array. Any pixel with a deviation from the baseline value greater than that set by high_thresh or lower than that set by low_thresh will be rejected.
Parameters: 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 low_thresh.
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 high_thresh.
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.
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.
-