pad_bounding_box

sherpa.utils.pad_bounding_box(kernel, mask)[source] [edit on github]

Expand the kernel to match the mask.

Parameters:
kernelnumeric sequence

The data to copy. The data is a 1D array.

maskint sequence

The mask determines the size of the output and where to place the kernel values. It is expected that the number of non-zero mask elements matches the size of the kernel parameter.

Returns:
nkernelndarray

The output is the same size as the mask, and initialized to zero everywhere. Cells where the mask is non-zero are copied from the kernel.

Examples

>>> pad_bounding_box([1, 2, 3, 4], [1, 1, 0, 1, 1, 0, 0, 0, 0])
array([ 1.,  2.,  0.,  3.,  4.,  0.,  0.,  0.,  0.])