PClip
PClip(frac=-0.5, sigma=3.0, nkeep=1, grow=None)IRAF-style percentile clipping.
Parameters
frac : float = -0.5-
IRAF
pclipvalue. Values withabs(frac) < 1are converted to an integer sorted-rank offset using half of the input image count. sigma : float or tuple of float = 3.0-
User-supplied lower and upper clipping multipliers applied to the pclip-estimated spread.
nkeep : int = 1-
Minimum number of unmasked samples to retain after pclip rejection.
grow : float or None = None-
Optional radius in pixels used to grow
mask_rejspatially after rejection. Axis 0 is the stack axis and is never grown across.Nonedisables growth and skips the extra calculation.
Attributes
| Name | Description |
|---|---|
| frac | Convert a string or number to a floating-point number, if possible. |
| nkeep | int([x]) -> integer |
| sigma | Convert a string or number to a floating-point number, if possible. |
Methods
| Name | Description |
|---|---|
| apply | Apply PClip to an image stack. |
apply
PClip.apply(arr, mask=None, *, validate=True)Apply PClip to an image stack.
Parameters
arr : (ndarray, shape(N, *spatial))-
Image stack. Inputs with more than 3 dimensions are flattened internally; output shapes match the trailing spatial dimensions of the input.
mask : ndarray of bool = None-
Input mask;
Truemeans already masked. Must have the same shape asarrbefore any internal flattening. validate : bool = True-
If
True, validate inputs before calling the kernel.
Returns
: mask_rej, std, low, upp, nit, output_flags : tuple of ndarray-
Rejection mask and diagnostics from :func:
imcombiners.kernels.pclip.stdis the per-pixel spread used by sigma/CCD clipping andNonefor rejection algorithms without a spread diagnostic.