lightkurve.KeplerTargetPixelFile.create_threshold_mask#

KeplerTargetPixelFile.create_threshold_mask(threshold=3, reference_pixel='center')#

Returns an aperture mask creating using the thresholding method.

This method will identify the pixels in the TargetPixelFile which show a median flux that is brighter than threshold times the standard deviation above the overall median. The standard deviation is estimated in a robust way by multiplying the Median Absolute Deviation (MAD) with 1.4826.

If the thresholding method yields multiple contiguous regions, then only the region closest to the (col, row) coordinate specified by reference_pixel is returned. For exmaple, reference_pixel=(0, 0) will pick the region closest to the bottom left corner. By default, the region closest to the center of the mask will be returned. If reference_pixel=None then all regions will be returned.

Parameters
thresholdfloat

A value for the number of sigma by which a pixel needs to be brighter than the median flux to be included in the aperture mask.

reference_pixel: (int, int) tuple, ‘center’, or None

(col, row) pixel coordinate closest to the desired region. For example, use reference_pixel=(0,0) to select the region closest to the bottom left corner of the target pixel file. If ‘center’ (default) then the region closest to the center pixel will be selected. If None then all regions will be selected.

Returns
aperture_maskndarray

2D boolean numpy array containing True for pixels above the threshold.