apply_mask_to_set_arrays¶
- sofia_redux.toolkit.resampling.apply_mask_to_set_arrays(mask, data, phi, error, weights, counts)[source]¶
Set certain arrays to a fixed size based on a mask array.
- Parameters:
- masknumpy.ndarray of bool (N,)
Mask where
True
values indicate the associated element should be kept, andFalse
will result in exclusion from the output arrays.- datanumpy.ndarray (N,)
The data array.
- phinumpy.ndarray (n_terms, N)
The polynomial terms of the fit equation.
- errornumpy.ndarray
An array of shape (1,) or (N,). If an array of size 1 is supplied, it will be expanded to an array of
counts
size.- weightsnumpy.ndarray
An array of shape (1,) or (N,). If an array of size 1 is supplied, it will be expanded to an array of
counts
size.- countsint
The number of
True
values in the mask. Determines the output size of all arrays.
- Returns:
- data_out, phi_out, error_out, weight_out4-tuple of numpy.ndarray.
Resized arrays in which the last axis is of size
counts
.