SBART.utils.RV_utilities.create_spectral_blocks

SBART.utils.RV_utilities.create_spectral_blocks#

Functions

build_blocks(indexes)

Evaluate the output of a np.where to find the continuous regions in it.

build_blocks(indexes)#

Evaluate the output of a np.where to find the continuous regions in it. This returns a numpy array, where each entry is a list of a ‘set’ of ones.

E.g. >>> arr = np.array([0,0,1,1,1,1,1,1,0,1,0]) >>> print(build_blocks(arr)) [[2, 3, 4, 5, 6, 7], [9]]

Parameters:

indexes ([type]) – [description]

Returns:

[description]

Return type:

[type]cd