NDCombine: Fast ND arrays combination

Warning

This documentation is for the version currently under development.

CI Status Coverage Status

NDCombine is a Python package to combine efficiently n-dimensional arrays such as images or datacubes. It is implemented in Cython which allows to parallelize the computation at the C level with OpenMP.

Currently the implemented algorithms are:

  • Combination: mean, median, sum.

  • Rejection: sigma clipping, variance clipping.

If variance arrays are provided, the variance is propagated with the usual uncertainty propagation formulas.

Wishlist:

  • Rejection algorithms: minmax (value or number or percentile ?)

  • Weights, scaling factor or function, offsets (?)

Installation

(Not yet on PyPI!)

The last stable release of NDCombine can be installed simply with pip:

pip install ndcombine

Usage

See this example notebook.

API

ndcombine.combine_arrays(data, mask=None, variance=None, clipping_limits=(3, 3), clipping_method='none', max_iters=100, method='mean', num_threads=0)[source]

Run the combination with an optional rejection.

Parameters
  • data (list of ndarray or list of NDData) – Data arrays.

  • mask (list of ndarray, optional) – Mask arrays.

  • variance (list of ndarray, optional) – Variance arrays.

  • clipping_limits (tuple of int) – For sigma clipping, the lower and upper bounds: (sigma_lower, sigma_upper).

  • clipping_method (str, {'sigclip', 'varclip', 'none'}) – Clipping method.

  • max_iters (int) – Maximum number of iterations (for sigma clipping).

  • method (str, {'mean', 'median', 'sum'}) – Combination method.

  • num_threads (int) – Number of threads.