parallel_apply_over_frames¶
-
sitelle.parallel.parallel_apply_over_frames(func2d, cube, *args, **kwargs)¶ Iterates over the z dimension of a cube to apply a function on each frame (i.e. 2D images), taking advantage of multiple cores.
Parameters: - func2d (callable) – This function should accept 2-D arrays. It is applied to 2-D slices (frames) of cube.
- cube (3-D
ndarray) – The data cube. Dimensions should be [x,y,z]. func2d will be applied along the z dimension - modules (tuple of strings) – The modules to be imported so that func2d works correctly. Example : (‘import numpy as np’,)
- depfuncs (tuple of string) – The functions used by func2d but defined outside of its body
- args – Additional arguments to be passed to func2d
- kwargs – Additional keywords arguments to be passed to func2d
Returns: out – The output array. The first 2 dimensions are identical to cube. the rest depends on what func2d returns; it it returns a vector, out will be 3-D.
Return type: See also