CcdClip
CcdClip(
sigma=(3.0, 3.0),
maxiters=5,
cenfunc='median',
clip_cen=None,
ddof=0,
nkeep=1,
maxrej=None,
revert_on_nkeep=True,
rdnoise=0.0,
gain=1.0,
snoise=0.0,
scale_ref=1.0,
zero_ref=0.0,
grow=None,
)CCD noise-model clipping.
Parameters
sigma : float or tuple of float = (3.0, 3.0)-
User-supplied clipping multiplier, not the measured data spread itself. Values are clipped when their residual from the clipping center exceeds
sigma * spread. A scalar applies the same multiplier to both tails; a 2-tuple(sigma_lower, sigma_upper)clips asymmetrically. Thresholds must be finite and non-negative. maxiters : int = 5-
Maximum number of clipping iterations per pixel.
ddof : int = 0-
Delta degrees of freedom for the per-pixel spread estimator.
nkeep : int = 1-
Minimum number of unmasked values to preserve at each pixel. An iteration that would drop below this count is reverted in full. The default,
1, prevents clipping from rejecting every finite sample in a per-output stack. Set0only when all samples may be rejected. maxrej : int or None = None-
Maximum number of values that may be rejected at each pixel.
Nonemeans no limit. cenfunc : ('median', 'lmedian', 'mean') = "median"-
Center estimator used each iteration.
lmedianaccepts the aliaslmedand uses the lower of the two middle samples for even valid counts. clip_cen : ('median', 'lmedian', 'mean') = "median"-
Center used when computing the spread for iterative rejection.
Noneuses the same center ascenfunc;lmedianalso acceptslmed. revert_on_nkeep : bool = True-
If
True, an iteration that would leave fewer thannkeepusable samples at a pixel is reverted in full for that pixel. Input masks, threshold masks, and non-finite samples remain excluded. The default isTrue. IfFalse, clipping is strict and may leave fewer thannkeepsamples. rdnoise : float = 0.0-
Read noise in electrons.
gain : float = 1.0-
CCD gain in electrons per DN. Rejection is evaluated on gain-corrected values equivalent to
arr / gainwithout requiring callers to pre-divide the input stack. snoise : float = 0.0-
Sky-noise coefficient. Adds a Poisson-like contribution scaled by the local count level.
scale_ref : float = 1.0-
Reference scale factor. Typically the inverse of the exposure-time normalization applied during reduction.
zero_ref : float = 0.0-
Reference zero-point offset. Accounts for a known DC bias that shifts the effective noise level.
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 |
|---|---|
| cenfunc | str(object=’’) -> str |
| ddof | int([x]) -> integer |
| gain | Convert a string or number to a floating-point number, if possible. |
| maxiters | int([x]) -> integer |
| nkeep | int([x]) -> integer |
| rdnoise | Convert a string or number to a floating-point number, if possible. |
| revert_on_nkeep | bool(x) -> bool |
| scale_ref | Convert a string or number to a floating-point number, if possible. |
| sigma | Built-in immutable sequence. |
| snoise | Convert a string or number to a floating-point number, if possible. |
| zero_ref | Convert a string or number to a floating-point number, if possible. |
Methods
| Name | Description |
|---|---|
| apply | Apply CcdClip to an image stack. |
apply
CcdClip.apply(arr, mask=None, *, validate=True)Apply CcdClip 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.ccdclip.stdis the per-pixel spread used by sigma/CCD clipping andNonefor rejection algorithms without a spread diagnostic.