simpson_padded#
- exo_skryer.aux_functions.simpson_padded(y: Array, x: Array, n_valid: Array, *, axis: int = -1, even: str = 'first')[source]#
Composite Simpson integration for padded arrays with non-uniform spacing.
- Parameters:
- y
ndarray Function values, padded to Nmax along
axis.- x
ndarray Sample points (same shape as y), padded to Nmax along
axis. Must be strictly increasing on the valid prefix [0:n_valid].- n_validint or
ndarray Number of valid (unpadded) points along
axis(>= 2). Can be scalar int or per-batch int array (vmap-friendly).- axisint, optional
Axis of integration. Default: -1
- even{‘first’, ‘last’, ‘avg’}, optional
Handling when n_valid is even: - ‘first’: Simpson on first n_valid-1 + trapezoid on last interval - ‘last’: Trapezoid on first + Simpson on last n_valid-1 - ‘avg’: Average of ‘first’ and ‘last’ Default: ‘first’
- y
- Returns:
- integral
ndarray
- integral