webbpsf_ext.image_manip.bp_fix

webbpsf_ext.image_manip.bp_fix(im, sigclip=5, niter=1, pix_shift=1, rows=True, cols=True, corners=True, bpmask=None, return_mask=False, verbose=False, in_place=True)[source]

Find and fix bad pixels in image with median of surrounding values

Paramters

imndarray

Single image

sigclipint

How many sigma from mean doe we fix?

niterint

How many iterations for sigma clipping? Ignored if bpmask is set.

pix_shiftint

We find bad pixels by comparing to neighbors and replacing. E.g., if set to 1, use immediate adjacents neighbors. Replaces with a median of surrounding pixels.

rowsbool

Compare to row pixels? Setting to False will ignore pixels along rows during comparison. Recommended to increase pix_shift parameter if using only rows or cols.

colsbool

Compare to column pixels? Setting to False will ignore pixels along columns during comparison. Recommended to increase pix_shift parameter if using only rows or cols.

cornersbool

Include corners in neighbors? If False, then only use pixels that are directly adjacent for comparison.

bpmaskboolean array

Use a pre-determined bad pixel mask for fixing.

return_maskbool

If True, then also return a masked array of bad pixels where a value of 1 is “bad”.

verbosebool

Print number of fixed pixels per iteration

in_placebool

Do in-place corrections of input array. Otherwise, return a copy.